Skip to content

Commit 3abdf76

Browse files
committed
增加ol/L下高效率点图层示例的loading 控件;
替换三个端下客户端专题图 toFeature() 方法替换为 toiClientFeature() 方法,保留toFeature(),并在下个版本弃用。 review by songyumeng.
1 parent fb90199 commit 3abdf76

29 files changed

+183288
-257
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@
8181
- `L.supermap.tiledMapLayer` 新增`options.format`参数,支持 "png" 、"bmp" 、"jpg" 和 "git" 四种表述类型,默认为 "png",表述类型
8282

8383
- GeoJSON数据处理对接iServer数据类型"RECTANGLE"
84+
85+
- 废弃 ` L.supermap.ThemeLayer.toFeature` 方法,由 ` L.supermap.ThemeLayer.toiClientFeature` 方法代替
8486

8587

8688
### for OpenLayers
@@ -151,6 +153,8 @@
151153

152154
- GeoJSON数据处理对接iServer数据类型"RECTANGLE"
153155

156+
- 废弃 `ol.source.Theme.toFeature` 方法,由 ` ol.source.Theme.toiClientFeature` 方法代替
157+
154158
### for MapboxGL
155159

156160
- 废弃 `SuperMap.ElasticSearch``options.change` 参数,直接使用 `SuperMap.ElasticSearch.msearch` `SuperMap.ElasticSearch.msearch``callback` 参数
@@ -191,6 +195,9 @@
191195

192196
- GeoJSON数据处理对接iServer数据类型"RECTANGLE"
193197

198+
199+
- 废弃 ` mapboxgl.supermap.ThemeLayer.toFeature` 方法,由 ` mapboxgl.supermap.ThemeLayer.toiClientFeature` 方法代替
200+
194201
### Classic
195202

196203
- 废弃 `SuperMap.ElasticSearch``options.change` 参数,直接使用 `SuperMap.ElasticSearch.msearch` `SuperMap.ElasticSearch.msearch``callback` 参数

dist/iclient-classic.js

Lines changed: 46 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3007,7 +3007,9 @@ var CommonServiceBase = exports.CommonServiceBase = function () {
30073007
key: 'serviceProcessCompleted',
30083008
value: function serviceProcessCompleted(result) {
30093009
result = _Util.Util.transformResult(result);
3010-
this.events.triggerEvent("processCompleted", { result: result });
3010+
this.events.triggerEvent("processCompleted", {
3011+
result: result
3012+
});
30113013
}
30123014

30133015
/**
@@ -3021,7 +3023,9 @@ var CommonServiceBase = exports.CommonServiceBase = function () {
30213023
value: function serviceProcessFailed(result) {
30223024
result = _Util.Util.transformResult(result);
30233025
var error = result.error || result;
3024-
this.events.triggerEvent("processFailed", { error: error });
3026+
this.events.triggerEvent("processFailed", {
3027+
error: error
3028+
});
30253029
}
30263030
}, {
30273031
key: '_commit',
@@ -3052,9 +3056,13 @@ var CommonServiceBase = exports.CommonServiceBase = function () {
30523056
}
30533057
if (!result || result.error || result.code >= 300 && result.code !== 304) {
30543058
if (result && result.error) {
3055-
result = { error: result.error };
3059+
result = {
3060+
error: result.error
3061+
};
30563062
} else {
3057-
result = { error: result };
3063+
result = {
3064+
error: result
3065+
};
30583066
}
30593067
}
30603068
if (result.error) {
@@ -3074,6 +3082,21 @@ var CommonServiceBase = exports.CommonServiceBase = function () {
30743082

30753083
_SuperMap.SuperMap.CommonServiceBase = CommonServiceBase;
30763084

3085+
/**
3086+
* 服务器请求回调函数
3087+
* @callback RequestCallback
3088+
* @example
3089+
* var requestCallback = function (serviceResult){
3090+
* console.log(serviceResult.result);
3091+
* }
3092+
* new QueryService(url).queryByBounds(param, requestCallback);
3093+
* @param {Object} serviceResult
3094+
* @param {Object} serviceResult.result 服务器返回结果
3095+
* @param {Object} serviceResult.object 发布应用程序事件的对象
3096+
* @param {Object} serviceResult.type 事件类型
3097+
* @param {Object} serviceResult.element 接受浏览器事件的DOM节点
3098+
*/
3099+
30773100
/***/ }),
30783101
/* 7 */
30793102
/***/ (function(module, exports, __webpack_require__) {
@@ -5064,12 +5087,12 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
50645087
* @class SuperMap.TopologyValidatorJobsParameter
50655088
* @category iServer ProcessingService TopologyValidator
50665089
* @classdesc 拓扑检查分析任务参数类
5067-
* @param options - {Object} 必填参数。<br>
5068-
* datasetName -{string} 数据集名。 <br>
5069-
* datasetTopology -{string} 检查对象所在的数据集名称。 <br>
5070-
* rule -{{@link SuperMap.TopologyValidatorRule}} 拓扑检查规则 。 <br>
5071-
* tolerance -{string} 容限 <br>
5072-
* output -{SuperMap.OutputSetting} 输出参数设置 <br>
5090+
* @param {Object} options - 必填参数。<br>
5091+
* @param {string} options.datasetName -数据集名。<br>
5092+
* @param {string} options.datasetTopology -检查对象所在的数据集名称。<br>
5093+
* @param {SuperMap.TopologyValidatorRule} options.rule - 拓扑检查规则。<br>
5094+
* @param {string} options.tolerance - 容限<br>
5095+
* @param {SuperMap.OutputSetting} options.output - 输出参数设置。<br>
50735096
*/
50745097
var TopologyValidatorJobsParameter = exports.TopologyValidatorJobsParameter = function () {
50755098
function TopologyValidatorJobsParameter(options) {
@@ -5079,31 +5102,31 @@ var TopologyValidatorJobsParameter = exports.TopologyValidatorJobsParameter = fu
50795102
return;
50805103
}
50815104
/**
5082-
* @member SuperMap.TopologyValidatorJobsParameter.prototype.datasetName -{string}
5105+
* @member {string} SuperMap.TopologyValidatorJobsParameter.prototype.datasetName
50835106
* @description 数据集名。
50845107
*/
50855108
this.datasetName = "";
50865109

50875110
/**
5088-
* @member SuperMap.TopologyValidatorJobsParameter.prototype.datasetTopology -{string}
5111+
* @member {string} SuperMap.TopologyValidatorJobsParameter.prototype.datasetTopology
50895112
* @description 拓扑检查对象所在的数据集名称。
50905113
*/
50915114
this.datasetTopology = "";
50925115

50935116
/**
5094-
* @member SuperMap.TopologyValidatorJobsParameter.prototype.tolerance -{string}
5117+
* @member {string} SuperMap.TopologyValidatorJobsParameter.prototype.tolerance
50955118
* @description 容限,指定的拓扑错误检查时使用的容限。
50965119
*/
50975120
this.tolerance = "";
50985121

50995122
/**
5100-
* @member SuperMap.TopologyValidatorJobsParameter.prototype.rule -{SuperMap.TopologyValidatorRule}
5123+
* @member {SuperMap.TopologyValidatorRule} SuperMap.TopologyValidatorJobsParameter.prototype.rule
51015124
* @description 拓扑检查模式 。
51025125
*/
51035126
this.rule = _REST.TopologyValidatorRule.REGIONNOOVERLAP;
51045127

51055128
/**
5106-
* @member SuperMap.TopologyValidatorJobsParameter.prototype.output -{SuperMap.OutputSetting}
5129+
* @member {SuperMap.OutputSetting} SuperMap.TopologyValidatorJobsParameter.prototype.output
51075130
* @description 输出参数设置类
51085131
*/
51095132
this.output = null;
@@ -5134,8 +5157,8 @@ var TopologyValidatorJobsParameter = exports.TopologyValidatorJobsParameter = fu
51345157

51355158
/**
51365159
* @function SuperMap.TopologyValidatorJobsParameter.toObject
5137-
* @param TopologyValidatorJobsParameter -{Object} 拓扑检查分析任务参数
5138-
* @param tempObj - {Object} 目标对象
5160+
* @param {Object} TopologyValidatorJobsParameter -拓扑检查分析任务参数
5161+
* @param {Object} tempObj - 目标对象
51395162
* @description 生成拓扑检查分析任务对象
51405163
*/
51415164

@@ -6982,9 +7005,9 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
69827005
* @class SuperMap.TopologyValidatorJobsService
69837006
* @category iServer ProcessingService TopologyValidator
69847007
* @classdesc 拓扑检查分析服务类
6985-
* @extends SuperMap.ProcessingServiceBase
6986-
* @param url -{string} 拓扑检查分析服务地址。
6987-
* @param options - {Object} 交互服务时所需可选参数
7008+
* @extends {SuperMap.ProcessingServiceBase}
7009+
* @param {string} url - 拓扑检查分析服务地址。
7010+
* @param {Object} options - 参数
69887011
*/
69897012
var TopologyValidatorJobsService = exports.TopologyValidatorJobsService = function (_ProcessingServiceBas) {
69907013
_inherits(TopologyValidatorJobsService, _ProcessingServiceBas);
@@ -7024,7 +7047,7 @@ var TopologyValidatorJobsService = exports.TopologyValidatorJobsService = functi
70247047
/**
70257048
* @function SuperMap.TopologyValidatorJobsService.protitype.getTopologyValidatorJob
70267049
* @description 获取指定id的拓扑检查分析服务
7027-
* @param id -{string} 指定要获取数据的id
7050+
* @param {string} id - 指定要获取数据的id
70287051
*/
70297052

70307053
}, {
@@ -7036,8 +7059,8 @@ var TopologyValidatorJobsService = exports.TopologyValidatorJobsService = functi
70367059
/**
70377060
* @function SuperMap.TopologyValidatorJobsService.protitype.addTopologyValidatorJob
70387061
* @description 新建拓扑检查分析服务
7039-
* @param params - {SuperMap.TopologyValidatorJobsParameter} 创建一个空间分析的请求参数。
7040-
* @param seconds - {number}开始创建后,获取创建成功结果的时间间隔。
7062+
* @param {SuperMap.TopologyValidatorJobsParameter} params - 创建一个空间分析的请求参数。
7063+
* @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
70417064
*/
70427065

70437066
}, {

dist/iclient9-leaflet.js

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15484,7 +15484,7 @@ var _CommontypesConversion = __webpack_require__(28);
1548415484
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
1548515485

1548615486
/**
15487-
* @function L.supermap.GeoFeatureThemeLayer
15487+
* @class L.supermap.GeoFeatureThemeLayer
1548815488
* @classdesc 地理几何专题要素型专题图层基类。此类型专题图的专题要素形状就是由 feature.geometry 决定。此类不建议直接实例化调用。
1548915489
* @category Visualization Theme
1549015490
* @extends L.supermap.ThemeLayer
@@ -15542,7 +15542,7 @@ var GeoFeatureThemeLayer = exports.GeoFeatureThemeLayer = _ThemeLayer.ThemeLayer
1554215542
me.fire("beforefeaturesadded", { features: features });
1554315543

1554415544
//转换 features 形式
15545-
this.features = this.toFeature(features);
15545+
this.features = this.toiClientFeature(features);
1554615546

1554715547
if (!me.isCustomSetMaxCacheCount) {
1554815548
me.maxCacheCount = me.features.length * 5;
@@ -21910,12 +21910,12 @@ var ThemeLayer = exports.ThemeLayer = _leaflet2["default"].Layer.extend({
2191021910
},
2191121911

2191221912
/**
21913-
* @function L.supermap.ThemeLayer.prototype.toFeature
21913+
* @function L.supermap.ThemeLayer.prototype.toiClientFeature
2191421914
* @description 转为 iClient 要素
2191521915
* @param features -{L.supermap.themeFeature|Object} 待转要素包括 mapboxgl.supermap.ThemeFeature 类型和 GeoJOSN 规范数据类型
2191621916
* @return {SuperMap.Feature.Vector} 转换后的iClient要素
2191721917
*/
21918-
toFeature: function toFeature(features) {
21918+
toiClientFeature: function toiClientFeature(features) {
2191921919
if (_iclientCommon.CommonUtil.isArray(features)) {
2192021920
var featuresTemp = [];
2192121921
for (var i = 0; i < features.length; i++) {
@@ -21943,6 +21943,17 @@ var ThemeLayer = exports.ThemeLayer = _leaflet2["default"].Layer.extend({
2194321943
throw new Error('features\'s type is not be supported.');
2194421944
},
2194521945

21946+
/**
21947+
* @function L.supermap.ThemeLayer.prototype.toFeature
21948+
* @deprecated
21949+
* @description 转为 iClient 要素,该方法将被弃用,由 {@link L.supermap.ThemeLayer#toiClientFeature} 代替。
21950+
* @param features -{L.supermap.themeFeature|Object} 待转要素包括 mapboxgl.supermap.ThemeFeature 类型和 GeoJOSN 规范数据类型
21951+
* @return {SuperMap.Feature.Vector} 转换后的iClient要素
21952+
*/
21953+
toFeature: function toFeature(features) {
21954+
return this.toiClientFeature(features);
21955+
},
21956+
2194621957
_initContainer: function _initContainer() {
2194721958
var parentContainer = this.getPane();
2194821959
var animated = this._map.options.zoomAnimation && _leaflet2["default"].Browser.any3d;
@@ -31216,7 +31227,7 @@ var GraphThemeLayer = exports.GraphThemeLayer = _ThemeLayer.ThemeLayer.extend({
3121631227
me.fire("beforefeaturesadded", { features: features });
3121731228

3121831229
//转换 features 形式
31219-
this.features = this.toFeature(features);
31230+
this.features = this.toiClientFeature(features);
3122031231

3122131232
//绘制专题要素
3122231233
if (!me.renderer) {
@@ -63391,7 +63402,7 @@ var HeatMapLayer = exports.HeatMapLayer = _leaflet2["default"].Layer.extend({
6339163402
}
6339263403
return featuresTemp;
6339363404
}
63394-
throw new Error("features 类型不符,请检查。");
63405+
throw new Error("Features's type does not match, please check.");
6339563406
},
6339663407

6339763408
_zoomAnim: function _zoomAnim(e) {
@@ -72447,7 +72458,7 @@ module.exports = function (proj4) {
7244772458
/* 384 */
7244872459
/***/ (function(module) {
7244972460

72450-
module.exports = {"_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","_shasum":"5ad06e8bca30be0ffa389a49e4565f51f06d089e","_spec":"proj4@2.3.15","_where":"E:\\2018\\git\\iClient-JavaScript","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":"~0.0.2"},"deprecated":false,"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"};
72461+
module.exports = {"_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","_shasum":"5ad06e8bca30be0ffa389a49e4565f51f06d089e","_spec":"proj4@2.3.15","_where":"G:\\iClient\\iClient-JavaScript","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":"~0.0.2"},"deprecated":false,"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"};
7245172462

7245272463
/***/ }),
7245372464
/* 385 */

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: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15261,7 +15261,7 @@ var GeoFeature = exports.GeoFeature = function (_Theme) {
1526115261
value: function addFeatures(features) {
1526215262
_mapboxGl2.default.Evented.prototype.fire('beforefeaturesadded', { features: features });
1526315263
//转换 features 形式
15264-
this.features = this.toFeature(features);
15264+
this.features = this.toiClientFeature(features);
1526515265

1526615266
if (!this.isCustomSetMaxCacheCount) {
1526715267
this.maxCacheCount = this.features.length * 5;
@@ -21387,8 +21387,8 @@ var Theme = function () {
2138721387
*/
2138821388

2138921389
}, {
21390-
key: 'toFeature',
21391-
value: function toFeature(features) {
21390+
key: 'toiClientFeature',
21391+
value: function toiClientFeature(features) {
2139221392
if (_iclientCommon.CommonUtil.isArray(features)) {
2139321393
var featuresTemp = [];
2139421394
for (var i = 0; i < features.length; i++) {
@@ -21416,6 +21416,20 @@ var Theme = function () {
2141621416

2141721417
throw new Error('features\'s type is not be supported.');
2141821418
}
21419+
21420+
/**
21421+
* @function mapboxgl.supermap.ThemeLayer.prototype.toFeature
21422+
* @deprecated
21423+
* @description 转为 iClient 要素,该方法将被弃用,由 {@link mapboxgl.supermap.ThemeLayer#toiClientFeature} 代替。
21424+
* @param features -{mapboxgl.supermap.ThemeFeature|Object} 待转要素包括 mapboxgl.supermap.ThemeFeature 类型和 GeoJOSN 规范数据类型
21425+
* @return {SuperMap.Feature.Vector} 转换后的iClient要素
21426+
*/
21427+
21428+
}, {
21429+
key: 'toFeature',
21430+
value: function toFeature(features) {
21431+
return this.toiClientFeature(features);
21432+
}
2141921433
}, {
2142021434
key: 'moveEndEvent',
2142121435
value: function moveEndEvent() {
@@ -28938,7 +28952,7 @@ var Graph = exports.Graph = function (_Theme) {
2893828952
return;
2893928953
}
2894028954
//转换 features 形式
28941-
this.features = this.toFeature(features);
28955+
this.features = this.toiClientFeature(features);
2894228956
//绘制专题要素
2894328957
if (this.renderer) {
2894428958
this.redrawThematicFeatures(this.map.getBounds());
@@ -57944,6 +57958,7 @@ var HeatMapLayer = exports.HeatMapLayer = function (_mapboxgl$Evented) {
5794457958
var format = new _iclientCommon.GeoJSON();
5794557959
return format.read(feature, "FeatureCollection");
5794657960
}
57961+
throw new Error("Features's type does not match, please check.");
5794757962
}
5794857963

5794957964
/**

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.

0 commit comments

Comments
 (0)