Skip to content

Commit 3f06dc8

Browse files
committed
fix BufferAnalyst bug,fix echarts缩放
1 parent 522cf97 commit 3f06dc8

File tree

10 files changed

+52
-57
lines changed

10 files changed

+52
-57
lines changed

dist/iclient9-leaflet.js

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2786,7 +2786,8 @@ var SpatialAnalystBase = function (_CommonServiceBase) {
27862786
}
27872787
} else if (result.recordset && result.recordset.features) {
27882788
result.recordset.features = JSON.parse(geoJSONFormat.write(result.recordset.features));
2789-
} else if (result.resultGeometry) {
2789+
}
2790+
if (result.resultGeometry) {
27902791
result.resultGeometry = JSON.parse(geoJSONFormat.write(result.resultGeometry));
27912792
}
27922793

@@ -17085,10 +17086,6 @@ var EchartsMapLayer = exports.EchartsMapLayer = _leaflet2.default.Layer.extend({
1708517086
map.on("zoomstart", function (e) {
1708617087
me._disableEchartsContainer();
1708717088
});
17088-
map.on("zoomend", function (e) {
17089-
me._enableEchartsContainer();
17090-
});
17091-
1709217089
_echarts2.default.registerAction({
1709317090
type: 'LeafletMapLayout',
1709417091
event: 'LeafletMapLayout',
@@ -17131,9 +17128,11 @@ var EchartsMapLayer = exports.EchartsMapLayer = _leaflet2.default.Layer.extend({
1713117128
if (rendering) {
1713217129
return;
1713317130
}
17131+
1713417132
api.dispatchAction({
1713517133
type: 'LeafletMapLayout'
1713617134
});
17135+
me._enableEchartsContainer();
1713717136
}
1713817137
if (me.options.loadWhileAnimating) {
1713917138
leafletMap.off('move', this._oldMoveHandler);
@@ -26086,21 +26085,19 @@ var BufferAnalystService = function (_SpatialAnalystBase) {
2608626085
* @param result - {Object} 服务器返回的结果对象。
2608726086
*
2608826087
*/
26088+
// toGeoJSONResult(result) {
26089+
// if (!result) {
26090+
// return result;
26091+
// }
26092+
//
26093+
// var analystResult = super.toGeoJSONResult(result);
26094+
// if (analystResult.resultGeometry) {
26095+
// var geoJSONFormat = new GeoJSON();
26096+
// result = JSON.parse(geoJSONFormat.write(analystResult.resultGeometry));
26097+
// }
26098+
// return result;
26099+
// }
2608926100

26090-
}, {
26091-
key: 'toGeoJSONResult',
26092-
value: function toGeoJSONResult(result) {
26093-
if (!result) {
26094-
return result;
26095-
}
26096-
26097-
var analystResult = _get(BufferAnalystService.prototype.__proto__ || Object.getPrototypeOf(BufferAnalystService.prototype), 'toGeoJSONResult', this).call(this, result);
26098-
if (analystResult.resultGeometry) {
26099-
var geoJSONFormat = new _GeoJSON2.default();
26100-
result = JSON.parse(geoJSONFormat.write(analystResult.resultGeometry));
26101-
}
26102-
return result;
26103-
}
2610426101
}]);
2610526102

2610626103
return BufferAnalystService;
@@ -63546,7 +63543,7 @@ var names = ["Van_der_Grinten_I", "VanDerGrinten", "vandg"];
6354663543
/* 396 */
6354763544
/***/ (function(module, exports) {
6354863545

63549-
module.exports = {"_from":"proj4@2.4.3","_id":"proj4@2.4.3","_inBundle":false,"_integrity":"sha1-87t+Yxv/wEfDaho8wUUzoDu+mWk=","_location":"/proj4","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"proj4@2.4.3","name":"proj4","escapedName":"proj4","rawSpec":"2.4.3","saveSpec":null,"fetchSpec":"2.4.3"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/proj4/-/proj4-2.4.3.tgz","_shasum":"f3bb7e631bffc047c36a1a3cc14533a03bbe9969","_spec":"proj4@2.4.3","_where":"E:\\codes\\iClient9","author":"","bugs":{"url":"https://github.com/proj4js/proj4js/issues"},"bundleDependencies":false,"contributors":[{"name":"Mike Adair","email":"madair@dmsolutions.ca"},{"name":"Richard Greenwood","email":"rich@greenwoodmap.com"},{"name":"Calvin Metcalf","email":"calvin.metcalf@gmail.com"},{"name":"Richard Marsden","url":"http://www.winwaed.com"},{"name":"T. Mittan"},{"name":"D. Steinwand"},{"name":"S. Nelson"}],"dependencies":{"mgrs":"1.0.0","wkt-parser":"^1.1.3"},"deprecated":false,"description":"Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.","devDependencies":{"chai":"~1.8.1","curl":"git://github.com/cujojs/curl.git","grunt":"~0.4.2","grunt-cli":"~0.1.13","grunt-contrib-connect":"~0.6.0","grunt-contrib-jshint":"~1.1.0","grunt-contrib-uglify":"~0.11.1","grunt-mocha-phantomjs":"~0.4.0","grunt-rollup":"^1.0.1","istanbul":"~0.2.4","mocha":"~1.17.1","rollup":"^0.41.4","rollup-plugin-json":"^2.0.1","rollup-plugin-node-resolve":"^2.0.0","tin":"~0.4.0"},"directories":{"test":"test","doc":"docs"},"homepage":"https://github.com/proj4js/proj4js#readme","license":"MIT","main":"dist/proj4-src.js","module":"lib/index.js","name":"proj4","repository":{"type":"git","url":"git://github.com/proj4js/proj4js.git"},"scripts":{"build":"grunt","build:tmerc":"grunt build:tmerc","test":"npm run build && istanbul test _mocha test/test.js"},"version":"2.4.3"}
63546+
module.exports = {"_args":[[{"raw":"proj4@2.4.3","scope":null,"escapedName":"proj4","name":"proj4","rawSpec":"2.4.3","spec":"2.4.3","type":"version"},"E:\\git\\iClient9"]],"_from":"proj4@2.4.3","_id":"proj4@2.4.3","_inCache":true,"_location":"/proj4","_nodeVersion":"6.9.2","_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/proj4-2.4.3.tgz_1488570790416_0.3068596587982029"},"_npmUser":{"name":"cwmma","email":"calvin.metcalf@gmail.com"},"_npmVersion":"4.0.5","_phantomChildren":{},"_requested":{"raw":"proj4@2.4.3","scope":null,"escapedName":"proj4","name":"proj4","rawSpec":"2.4.3","spec":"2.4.3","type":"version"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/proj4/-/proj4-2.4.3.tgz","_shasum":"f3bb7e631bffc047c36a1a3cc14533a03bbe9969","_shrinkwrap":null,"_spec":"proj4@2.4.3","_where":"E:\\git\\iClient9","author":"","bugs":{"url":"https://github.com/proj4js/proj4js/issues"},"contributors":[{"name":"Mike Adair","email":"madair@dmsolutions.ca"},{"name":"Richard Greenwood","email":"rich@greenwoodmap.com"},{"name":"Calvin Metcalf","email":"calvin.metcalf@gmail.com"},{"name":"Richard Marsden","url":"http://www.winwaed.com"},{"name":"T. Mittan"},{"name":"D. Steinwand"},{"name":"S. Nelson"}],"dependencies":{"mgrs":"1.0.0","wkt-parser":"^1.1.3"},"description":"Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.","devDependencies":{"chai":"~1.8.1","curl":"git://github.com/cujojs/curl.git","grunt":"~0.4.2","grunt-cli":"~0.1.13","grunt-contrib-connect":"~0.6.0","grunt-contrib-jshint":"~1.1.0","grunt-contrib-uglify":"~0.11.1","grunt-mocha-phantomjs":"~0.4.0","grunt-rollup":"^1.0.1","istanbul":"~0.2.4","mocha":"~1.17.1","rollup":"^0.41.4","rollup-plugin-json":"^2.0.1","rollup-plugin-node-resolve":"^2.0.0","tin":"~0.4.0"},"directories":{"test":"test","doc":"docs"},"dist":{"shasum":"f3bb7e631bffc047c36a1a3cc14533a03bbe9969","tarball":"https://registry.npmjs.org/proj4/-/proj4-2.4.3.tgz"},"gitHead":"e975a5462ad7abb23e33ea75281eb749e77e1510","homepage":"https://github.com/proj4js/proj4js#readme","license":"MIT","main":"dist/proj4-src.js","maintainers":[{"name":"cwmma","email":"calvin.metcalf@gmail.com"},{"name":"ahocevar","email":"andreas.hocevar@gmail.com"}],"module":"lib/index.js","name":"proj4","optionalDependencies":{},"readme":"ERROR: No README data found!","repository":{"type":"git","url":"git://github.com/proj4js/proj4js.git"},"scripts":{"build":"grunt","build:tmerc":"grunt build:tmerc","test":"npm run build && istanbul test _mocha test/test.js"},"version":"2.4.3"}
6355063547

6355163548
/***/ }),
6355263549
/* 397 */

dist/iclient9-leaflet.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/iclient9-openlayers.js

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2698,7 +2698,8 @@ var SpatialAnalystBase = function (_CommonServiceBase) {
26982698
}
26992699
} else if (result.recordset && result.recordset.features) {
27002700
result.recordset.features = JSON.parse(geoJSONFormat.write(result.recordset.features));
2701-
} else if (result.resultGeometry) {
2701+
}
2702+
if (result.resultGeometry) {
27022703
result.resultGeometry = JSON.parse(geoJSONFormat.write(result.resultGeometry));
27032704
}
27042705

@@ -21137,21 +21138,19 @@ var BufferAnalystService = function (_SpatialAnalystBase) {
2113721138
* @param result - {Object} 服务器返回的结果对象。
2113821139
*
2113921140
*/
21141+
// toGeoJSONResult(result) {
21142+
// if (!result) {
21143+
// return result;
21144+
// }
21145+
//
21146+
// var analystResult = super.toGeoJSONResult(result);
21147+
// if (analystResult.resultGeometry) {
21148+
// var geoJSONFormat = new GeoJSON();
21149+
// result = JSON.parse(geoJSONFormat.write(analystResult.resultGeometry));
21150+
// }
21151+
// return result;
21152+
// }
2114021153

21141-
}, {
21142-
key: 'toGeoJSONResult',
21143-
value: function toGeoJSONResult(result) {
21144-
if (!result) {
21145-
return result;
21146-
}
21147-
21148-
var analystResult = _get(BufferAnalystService.prototype.__proto__ || Object.getPrototypeOf(BufferAnalystService.prototype), 'toGeoJSONResult', this).call(this, result);
21149-
if (analystResult.resultGeometry) {
21150-
var geoJSONFormat = new _GeoJSON2.default();
21151-
result = JSON.parse(geoJSONFormat.write(analystResult.resultGeometry));
21152-
}
21153-
return result;
21154-
}
2115521154
}]);
2115621155

2115721156
return BufferAnalystService;

dist/iclient9-openlayers.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/leaflet/04_bufferAnalystService_geometry.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
})
8484
});
8585
bufferAnalystService.bufferAnalysis(geoBufferAnalystParams, function (serviceResult) {
86-
resultLayer = L.geoJSON(serviceResult.result).addTo(map);
86+
resultLayer = L.geoJSON(serviceResult.result.resultGeometry).addTo(map);
8787
//查询出缓冲区内信号影响范围内的工厂
8888
queryService = L.supermap.queryService(baseUrl);
8989
queryByGeometryParameters = new SuperMap.QueryByGeometryParameters({

examples/openlayers/04_bufferAnalystService_geometry.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
//向iServer发送请求并返回结果
124124
new ol.supermap.SpatialAnalystService(serviceUrl).bufferAnalysis(geoBufferAnalystParams, function (serviceResult) {
125125
var bufferSource = new ol.source.Vector({
126-
features: (new ol.format.GeoJSON()).readFeatures(serviceResult.result)
126+
features: (new ol.format.GeoJSON()).readFeatures(serviceResult.result.resultGeometry)
127127
});
128128
var resultLayer = new ol.layer.Vector({
129129
source: bufferSource,

src/common/iServer/BufferAnalystService.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,18 @@ export default class BufferAnalystService extends SpatialAnalystBase {
111111
* @param result - {Object} 服务器返回的结果对象。
112112
*
113113
*/
114-
toGeoJSONResult(result) {
115-
if (!result) {
116-
return result;
117-
}
118-
119-
var analystResult = super.toGeoJSONResult(result);
120-
if (analystResult.resultGeometry) {
121-
var geoJSONFormat = new GeoJSON();
122-
result = JSON.parse(geoJSONFormat.write(analystResult.resultGeometry));
123-
}
124-
return result;
125-
}
114+
// toGeoJSONResult(result) {
115+
// if (!result) {
116+
// return result;
117+
// }
118+
//
119+
// var analystResult = super.toGeoJSONResult(result);
120+
// if (analystResult.resultGeometry) {
121+
// var geoJSONFormat = new GeoJSON();
122+
// result = JSON.parse(geoJSONFormat.write(analystResult.resultGeometry));
123+
// }
124+
// return result;
125+
// }
126126

127127
CLASS_NAME = "SuperMap.BufferAnalystService"
128128
}

src/common/iServer/SpatialAnalystBase.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ export default class SpatialAnalystBase extends CommonServiceBase {
7474
}
7575
} else if (result.recordset && result.recordset.features) {
7676
result.recordset.features = JSON.parse(geoJSONFormat.write(result.recordset.features));
77-
}else if(result.resultGeometry){
77+
}
78+
if(result.resultGeometry){
7879
result.resultGeometry = JSON.parse(geoJSONFormat.write(result.resultGeometry));
7980
}
8081

src/leaflet/overlay/EChartMapLayer.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ export var EchartsMapLayer = L.Layer.extend({
4444
map.on("zoomstart", function (e) {
4545
me._disableEchartsContainer();
4646
});
47-
map.on("zoomend", function (e) {
48-
me._enableEchartsContainer();
49-
});
50-
5147
echarts.registerAction({
5248
type: 'LeafletMapLayout',
5349
event: 'LeafletMapLayout',
@@ -92,9 +88,11 @@ export var EchartsMapLayer = L.Layer.extend({
9288
if (rendering) {
9389
return
9490
}
91+
9592
api.dispatchAction({
9693
type: 'LeafletMapLayout'
9794
})
95+
me._enableEchartsContainer();
9896
}
9997
if(me.options.loadWhileAnimating){
10098
leafletMap.off('move', this._oldMoveHandler)

test/common/iServer/BufferAnalystServiceSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ describe('testBufferAnalystService_processAsync', function () {
9292

9393
setTimeout(function () {
9494
try {
95-
var bfMode = analystEventArgsSystem.result;
95+
var bfMode = analystEventArgsSystem.result.resultGeometry;
9696
expect(bfMode).not.toBeNull();
9797
expect(bfMode.type).toEqual("Feature");
9898
bfServiceByGeometry.destroy();

0 commit comments

Comments
 (0)