Skip to content

Commit 50cfda3

Browse files
committed
修改leaflet下themeFeature缺陷 by FV; 新增leaflet下wmts和天地图支持代理;新增空间分析返回批量结果处理;处理mapbox专题图层可叠加。 review by caoxinke.
1 parent bf17ef8 commit 50cfda3

17 files changed

+113
-52
lines changed

dist/iclient9-leaflet.css

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-leaflet.js

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3955,7 +3955,16 @@ var SpatialAnalystBase = exports.SpatialAnalystBase = function (_CommonServiceBa
39553955
analystResult;
39563956
result = _Util.Util.transformResult(result);
39573957
if (result && me.format === _REST.DataFormat.GEOJSON && typeof me.toGeoJSONResult === 'function') {
3958-
analystResult = me.toGeoJSONResult(result);
3958+
//批量分析时会返回多个结果
3959+
if (_Util.Util.isArray(result)) {
3960+
analystResult = [];
3961+
result.map(function (item) {
3962+
analystResult.push(me.toGeoJSONResult(item));
3963+
return item;
3964+
});
3965+
} else {
3966+
analystResult = me.toGeoJSONResult(result);
3967+
}
39593968
}
39603969
if (!analystResult) {
39613970
analystResult = result;
@@ -20069,6 +20078,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
2006920078
* crs - {{@link L.Proj.CRS}} 坐标系统类。<br>
2007020079
* serverType - {{@link SuperMap.ServerType}} 服务来源 iServer|iPortal|online。<br>
2007120080
* attribution - {string} 版权信息。
20081+
* tileProxy - {string} 启用托管地址
2007220082
*/
2007320083
var WMTSLayer = exports.WMTSLayer = _leaflet2["default"].TileLayer.extend({
2007420084

@@ -20115,7 +20125,13 @@ var WMTSLayer = exports.WMTSLayer = _leaflet2["default"].TileLayer.extend({
2011520125
tilerow: coords.y,
2011620126
tilecol: coords.x
2011720127
};
20118-
return url + _leaflet2["default"].Util.getParamString(obj, url);
20128+
20129+
if (this.options.tileProxy) {
20130+
url = this.options.tileProxy + encodeURIComponent(url + _leaflet2["default"].Util.getParamString(obj, url));
20131+
} else {
20132+
url += _leaflet2["default"].Util.getParamString(obj, url);
20133+
}
20134+
return url;
2011920135
}
2012020136
});
2012120137

@@ -26060,7 +26076,7 @@ var GeoFeatureThemeLayer = exports.GeoFeatureThemeLayer = _ThemeLayer.ThemeLayer
2606026076
/**
2606126077
* @function L.supermap.GeoFeatureThemeLayer.prototype.addFeatures
2606226078
* @description 向专题图图层中添加数据, 支持的feature类型为:iServer返回的feature json对象 或L.supermap.themeFeature类型
26063-
* @param features - {JSONObject|L.supermap.themeFeature} 待填加的要素
26079+
* @param features - {SuperMap.ServerFeature|L.supermap.themeFeature} 待填加的要素
2606426080
*/
2606526081
addFeatures: function addFeatures(features) {
2606626082
//数组
@@ -26353,19 +26369,22 @@ var ThemeFeature = exports.ThemeFeature = _leaflet2["default"].Class.extend({
2635326369
toFeature: function toFeature() {
2635426370
var geometry = this.geometry;
2635526371
var points = [];
26356-
if (geometry instanceof _leaflet2["default"].Polyline) {
26357-
points = this.reverseLatLngs(geometry.getLatLngs());
26358-
geometry = new _iclientCommon.LineString(points);
26359-
} else if (geometry instanceof _leaflet2["default"].Polygon) {
26372+
if (geometry instanceof _leaflet2["default"].Polygon) {
2636026373
points = this.reverseLatLngs(geometry.getLatLngs());
2636126374
geometry = new _iclientCommon.Polygon(points);
26375+
} else if (geometry instanceof _leaflet2["default"].Polyline) {
26376+
points = this.reverseLatLngs(geometry.getLatLngs());
26377+
geometry = new _iclientCommon.LineString(points);
2636226378
} else if (geometry.length === 3) {
2636326379
geometry = new _iclientCommon.GeoText(geometry[1], geometry[0], geometry[2]);
2636426380
} else {
2636526381
if (geometry instanceof _leaflet2["default"].LatLng) {
2636626382
points = [geometry.lng, geometry.lat];
2636726383
} else if (geometry instanceof _leaflet2["default"].Point) {
2636826384
points = [geometry.x, geometry.y];
26385+
} else if (geometry instanceof _leaflet2["default"].CircleMarker) {
26386+
var latLng = geometry.getLatLng();
26387+
points = [latLng.lng, latLng.lat];
2636926388
} else {
2637026389
points = geometry;
2637126390
}
@@ -26386,7 +26405,7 @@ var ThemeFeature = exports.ThemeFeature = _leaflet2["default"].Class.extend({
2638626405
latlngs = [latlngs];
2638726406
}
2638826407
for (var i = 0; i < latlngs.length; i++) {
26389-
latlngs[i] = [latlngs[i][1], latlngs[i][0]];
26408+
latlngs[i] = [latlngs[i].lng, latlngs[i].lat];
2639026409
}
2639126410
return latlngs;
2639226411
}
@@ -71038,11 +71057,11 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
7103871057
* @example 例如:
7103971058
* (start code)
7104071059
* var myOverlayAnalystService = new SuperMap.OverlayAnalystService(url, {
71041-
* eventListeners: {
71042-
* "processCompleted": OverlayCompleted,
71043-
* "processFailed": OverlayFailed
71044-
* }
71045-
* });
71060+
* eventListeners: {
71061+
* "processCompleted": OverlayCompleted,
71062+
* "processFailed": OverlayFailed
71063+
* }
71064+
* });
7104671065
* (end)
7104771066
*/
7104871067

@@ -93991,7 +94010,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
9399194010
/* 500 */
9399294011
/***/ (function(module, exports) {
9399394012

93994-
module.exports = {"_args":[["proj4@2.3.15","E:\\git\\iClient9"]],"_from":"proj4@2.3.15","_id":"proj4@2.3.15","_inBundle":false,"_integrity":"sha1-WtBui8owvg/6OJpJ5FZfUfBtCJ4=","_location":"/proj4","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"proj4@2.3.15","name":"proj4","escapedName":"proj4","rawSpec":"2.3.15","saveSpec":null,"fetchSpec":"2.3.15"},"_requiredBy":["/"],"_resolved":"http://registry.npm.taobao.org/proj4/download/proj4-2.3.15.tgz","_spec":"2.3.15","_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":"~0.0.2"},"description":"Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.","devDependencies":{"browserify":"~12.0.1","chai":"~1.8.1","curl":"git://github.com/cujojs/curl.git","grunt":"~0.4.2","grunt-browserify":"~4.0.1","grunt-cli":"~0.1.13","grunt-contrib-connect":"~0.6.0","grunt-contrib-jshint":"~0.8.0","grunt-contrib-uglify":"~0.11.1","grunt-mocha-phantomjs":"~0.4.0","istanbul":"~0.2.4","mocha":"~1.17.1","tin":"~0.4.0"},"directories":{"test":"test","doc":"docs"},"homepage":"https://github.com/proj4js/proj4js#readme","jam":{"main":"dist/proj4.js","include":["dist/proj4.js","README.md","AUTHORS","LICENSE.md"]},"license":"MIT","main":"lib/index.js","name":"proj4","repository":{"type":"git","url":"git://github.com/proj4js/proj4js.git"},"scripts":{"test":"./node_modules/istanbul/lib/cli.js test ./node_modules/mocha/bin/_mocha test/test.js"},"version":"2.3.15"}
94013+
module.exports = {"_args":[["proj4@2.3.15","G:\\iClient9"]],"_from":"proj4@2.3.15","_id":"proj4@2.3.15","_inBundle":false,"_integrity":"sha1-WtBui8owvg/6OJpJ5FZfUfBtCJ4=","_location":"/proj4","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"proj4@2.3.15","name":"proj4","escapedName":"proj4","rawSpec":"2.3.15","saveSpec":null,"fetchSpec":"2.3.15"},"_requiredBy":["/"],"_resolved":"http://registry.npm.taobao.org/proj4/download/proj4-2.3.15.tgz","_spec":"2.3.15","_where":"G:\\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":"~0.0.2"},"description":"Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.","devDependencies":{"browserify":"~12.0.1","chai":"~1.8.1","curl":"git://github.com/cujojs/curl.git","grunt":"~0.4.2","grunt-browserify":"~4.0.1","grunt-cli":"~0.1.13","grunt-contrib-connect":"~0.6.0","grunt-contrib-jshint":"~0.8.0","grunt-contrib-uglify":"~0.11.1","grunt-mocha-phantomjs":"~0.4.0","istanbul":"~0.2.4","mocha":"~1.17.1","tin":"~0.4.0"},"directories":{"test":"test","doc":"docs"},"homepage":"https://github.com/proj4js/proj4js#readme","jam":{"main":"dist/proj4.js","include":["dist/proj4.js","README.md","AUTHORS","LICENSE.md"]},"license":"MIT","main":"lib/index.js","name":"proj4","repository":{"type":"git","url":"git://github.com/proj4js/proj4js.git"},"scripts":{"test":"./node_modules/istanbul/lib/cli.js test ./node_modules/mocha/bin/_mocha test/test.js"},"version":"2.3.15"}
9399594014

9399694015
/***/ }),
9399794016
/* 501 */

dist/iclient9-leaflet.min.css

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-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-mapboxgl.js

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3927,7 +3927,16 @@ var SpatialAnalystBase = exports.SpatialAnalystBase = function (_CommonServiceBa
39273927
analystResult;
39283928
result = _Util.Util.transformResult(result);
39293929
if (result && me.format === _REST.DataFormat.GEOJSON && typeof me.toGeoJSONResult === 'function') {
3930-
analystResult = me.toGeoJSONResult(result);
3930+
//批量分析时会返回多个结果
3931+
if (_Util.Util.isArray(result)) {
3932+
analystResult = [];
3933+
result.map(function (item) {
3934+
analystResult.push(me.toGeoJSONResult(item));
3935+
return item;
3936+
});
3937+
} else {
3938+
analystResult = me.toGeoJSONResult(result);
3939+
}
39313940
}
39323941
if (!analystResult) {
39333942
analystResult = result;
@@ -25613,7 +25622,7 @@ var GeoFeature = exports.GeoFeature = function (_Theme) {
2561325622
/**
2561425623
* @function mapboxgl.supermap.GeoFeatureThemeLayer.prototype.addFeatures
2561525624
* @description 添加要素
25616-
* @param features - {Object} 要素对象
25625+
* @param features - {mapboxgl.supermap.ThemeFeature|SuperMap.ServerFeature} 要素对象
2561725626
*/
2561825627

2561925628

@@ -51500,8 +51509,10 @@ var Theme = exports.Theme = function () {
5150051509
this.div = document.createElement('div');
5150151510
var container = this.map.getCanvasContainer();
5150251511
var canvas = this.map.getCanvas();
51512+
this.div.id = this.name;
5150351513
this.div.style.width = canvas.style.width;
5150451514
this.div.style.height = canvas.style.height;
51515+
this.div.style.position = "absolute";
5150551516
this.div.className = options.name != null ? opt_options.name : "themeLayer";
5150651517
this.div.width = parseInt(canvas.width);
5150751518
this.div.height = parseInt(canvas.height);
@@ -64425,11 +64436,11 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
6442564436
* @example 例如:
6442664437
* (start code)
6442764438
* var myOverlayAnalystService = new SuperMap.OverlayAnalystService(url, {
64428-
* eventListeners: {
64429-
* "processCompleted": OverlayCompleted,
64430-
* "processFailed": OverlayFailed
64431-
* }
64432-
* });
64439+
* eventListeners: {
64440+
* "processCompleted": OverlayCompleted,
64441+
* "processFailed": OverlayFailed
64442+
* }
64443+
* });
6443364444
* (end)
6443464445
*/
6443564446

@@ -80401,7 +80412,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
8040180412
}
8040280413

8040380414
function Promise(fn) {
80404-
if (_typeof(this) !== 'object') throw new TypeError('Promises must be constructed via new');
80415+
if (!(this instanceof Promise)) throw new TypeError('Promises must be constructed via new');
8040580416
if (typeof fn !== 'function') throw new TypeError('not a function');
8040680417
this._state = 0;
8040780418
this._handled = false;
@@ -80525,9 +80536,9 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
8052580536
};
8052680537

8052780538
Promise.all = function (arr) {
80528-
var args = Array.prototype.slice.call(arr);
80529-
8053080539
return new Promise(function (resolve, reject) {
80540+
if (!arr || typeof arr.length === 'undefined') throw new TypeError('Promise.all accepts an array');
80541+
var args = Array.prototype.slice.call(arr);
8053180542
if (args.length === 0) return resolve([]);
8053280543
var remaining = args.length;
8053380544

dist/iclient9-mapboxgl.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.css

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: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4234,7 +4234,16 @@ var SpatialAnalystBase = exports.SpatialAnalystBase = function (_CommonServiceBa
42344234
analystResult;
42354235
result = _Util.Util.transformResult(result);
42364236
if (result && me.format === _REST.DataFormat.GEOJSON && typeof me.toGeoJSONResult === 'function') {
4237-
analystResult = me.toGeoJSONResult(result);
4237+
//批量分析时会返回多个结果
4238+
if (_Util.Util.isArray(result)) {
4239+
analystResult = [];
4240+
result.map(function (item) {
4241+
analystResult.push(me.toGeoJSONResult(item));
4242+
return item;
4243+
});
4244+
} else {
4245+
analystResult = me.toGeoJSONResult(result);
4246+
}
42384247
}
42394248
if (!analystResult) {
42404249
analystResult = result;
@@ -69879,11 +69888,11 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
6987969888
* @example 例如:
6988069889
* (start code)
6988169890
* var myOverlayAnalystService = new SuperMap.OverlayAnalystService(url, {
69882-
* eventListeners: {
69883-
* "processCompleted": OverlayCompleted,
69884-
* "processFailed": OverlayFailed
69885-
* }
69886-
* });
69891+
* eventListeners: {
69892+
* "processCompleted": OverlayCompleted,
69893+
* "processFailed": OverlayFailed
69894+
* }
69895+
* });
6988769896
* (end)
6988869897
*/
6988969898

@@ -91725,7 +91734,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
9172591734
/* 472 */
9172691735
/***/ (function(module, exports) {
9172791736

91728-
module.exports = {"_args":[["proj4@2.3.15","E:\\git\\iClient9"]],"_from":"proj4@2.3.15","_id":"proj4@2.3.15","_inBundle":false,"_integrity":"sha1-WtBui8owvg/6OJpJ5FZfUfBtCJ4=","_location":"/proj4","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"proj4@2.3.15","name":"proj4","escapedName":"proj4","rawSpec":"2.3.15","saveSpec":null,"fetchSpec":"2.3.15"},"_requiredBy":["/"],"_resolved":"http://registry.npm.taobao.org/proj4/download/proj4-2.3.15.tgz","_spec":"2.3.15","_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":"~0.0.2"},"description":"Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.","devDependencies":{"browserify":"~12.0.1","chai":"~1.8.1","curl":"git://github.com/cujojs/curl.git","grunt":"~0.4.2","grunt-browserify":"~4.0.1","grunt-cli":"~0.1.13","grunt-contrib-connect":"~0.6.0","grunt-contrib-jshint":"~0.8.0","grunt-contrib-uglify":"~0.11.1","grunt-mocha-phantomjs":"~0.4.0","istanbul":"~0.2.4","mocha":"~1.17.1","tin":"~0.4.0"},"directories":{"test":"test","doc":"docs"},"homepage":"https://github.com/proj4js/proj4js#readme","jam":{"main":"dist/proj4.js","include":["dist/proj4.js","README.md","AUTHORS","LICENSE.md"]},"license":"MIT","main":"lib/index.js","name":"proj4","repository":{"type":"git","url":"git://github.com/proj4js/proj4js.git"},"scripts":{"test":"./node_modules/istanbul/lib/cli.js test ./node_modules/mocha/bin/_mocha test/test.js"},"version":"2.3.15"}
91737+
module.exports = {"_args":[["proj4@2.3.15","G:\\iClient9"]],"_from":"proj4@2.3.15","_id":"proj4@2.3.15","_inBundle":false,"_integrity":"sha1-WtBui8owvg/6OJpJ5FZfUfBtCJ4=","_location":"/proj4","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"proj4@2.3.15","name":"proj4","escapedName":"proj4","rawSpec":"2.3.15","saveSpec":null,"fetchSpec":"2.3.15"},"_requiredBy":["/"],"_resolved":"http://registry.npm.taobao.org/proj4/download/proj4-2.3.15.tgz","_spec":"2.3.15","_where":"G:\\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":"~0.0.2"},"description":"Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.","devDependencies":{"browserify":"~12.0.1","chai":"~1.8.1","curl":"git://github.com/cujojs/curl.git","grunt":"~0.4.2","grunt-browserify":"~4.0.1","grunt-cli":"~0.1.13","grunt-contrib-connect":"~0.6.0","grunt-contrib-jshint":"~0.8.0","grunt-contrib-uglify":"~0.11.1","grunt-mocha-phantomjs":"~0.4.0","istanbul":"~0.2.4","mocha":"~1.17.1","tin":"~0.4.0"},"directories":{"test":"test","doc":"docs"},"homepage":"https://github.com/proj4js/proj4js#readme","jam":{"main":"dist/proj4.js","include":["dist/proj4.js","README.md","AUTHORS","LICENSE.md"]},"license":"MIT","main":"lib/index.js","name":"proj4","repository":{"type":"git","url":"git://github.com/proj4js/proj4js.git"},"scripts":{"test":"./node_modules/istanbul/lib/cli.js test ./node_modules/mocha/bin/_mocha test/test.js"},"version":"2.3.15"}
9172991738

9173091739
/***/ }),
9173191740
/* 473 */

dist/iclient9-openlayers.min.css

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.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.

0 commit comments

Comments
 (0)