@@ -65351,11 +65351,11 @@ external_mapboxgl_default.a.supermap.LogoControl = Logo_Logo;
65351
65351
* @classdesc 工具类。
65352
65352
*/
65353
65353
class core_Util_Util {
65354
-
65355
65354
/**
65356
65355
* @function mapboxgl.supermap.Util.toSuperMapGeometry
65357
65356
* @description 将 GeoJSON 对象转为 SuperMap 几何图形。
65358
65357
* @param {GeoJSONObject} geoJSON - GeoJSON 对象。
65358
+ * @returns {SuperMap.Geometry}
65359
65359
*/
65360
65360
static toSuperMapGeometry(geoJSON) {
65361
65361
if (geoJSON && geoJSON.type) {
@@ -65368,19 +65368,9 @@ class core_Util_Util {
65368
65368
static toSuperMapBounds(bounds) {
65369
65369
if (this.isArray(bounds)) {
65370
65370
//左下右上
65371
- return new Bounds_Bounds(
65372
- bounds[0],
65373
- bounds[1],
65374
- bounds[2],
65375
- bounds[3]
65376
- );
65371
+ return new Bounds_Bounds(bounds[0], bounds[1], bounds[2], bounds[3]);
65377
65372
}
65378
- return new Bounds_Bounds(
65379
- bounds.getWest(),
65380
- bounds.getSouth(),
65381
- bounds.getEast(),
65382
- bounds.getNorth()
65383
- );
65373
+ return new Bounds_Bounds(bounds.getWest(), bounds.getSouth(), bounds.getEast(), bounds.getNorth());
65384
65374
}
65385
65375
65386
65376
static toSuperMapPoint(lnglat) {
@@ -65392,6 +65382,26 @@ class core_Util_Util {
65392
65382
}
65393
65383
return new Point_Point(lnglat.geometry.coordinates[0], lnglat.geometry.coordinates[1]);
65394
65384
}
65385
+ /**
65386
+ * @function mapboxgl.supermap.Util.toSuperMapPolygon
65387
+ * @description 将 Mapbox GL LngLatbounds 对象转为 SuperMap 几何图形。
65388
+ * @param {Mapboxgl.LngLatbounds} lnglatBounds - Mapbox GL LngLatbounds对象。
65389
+ * @returns {SuperMap.Geometry.Polygon}
65390
+ */
65391
+ static toSuperMapPolygon(lnglatBounds) {
65392
+ const west = lnglatBounds.getWest();
65393
+ const east = lnglatBounds.getEast();
65394
+ const sourth = lnglatBounds.getSouth();
65395
+ const north = lnglatBounds.getNorth();
65396
+ return new Polygon_Polygon([
65397
+ new LinearRing_LinearRing([
65398
+ new Point_Point(west, sourth),
65399
+ new Point_Point(east, sourth),
65400
+ new Point_Point(east, north),
65401
+ new Point_Point(west, north)
65402
+ ])
65403
+ ]);
65404
+ }
65395
65405
65396
65406
/**
65397
65407
* @function mapboxgl.supermap.Util.isArray
@@ -65400,10 +65410,9 @@ class core_Util_Util {
65400
65410
* @returns {boolean} 是否是数组。
65401
65411
*/
65402
65412
static isArray(obj) {
65403
- return Object.prototype.toString.call(obj) == ' [object Array]'
65413
+ return Object.prototype.toString.call(obj) == " [object Array]";
65404
65414
}
65405
65415
65406
-
65407
65416
/**
65408
65417
* @function mapboxgl.supermap.Util.toGeoJSON
65409
65418
* @description 将传入对象转为 GeoJSON 格式。
@@ -65467,14 +65476,13 @@ class core_Util_Util {
65467
65476
return dest;
65468
65477
}
65469
65478
65470
-
65471
65479
/**
65472
65480
* 检测数据是否为number
65473
65481
* @param value 值,未知数据类型
65474
65482
* @returns {boolean}
65475
65483
*/
65476
65484
static isNumber(value) {
65477
- if (value === '' ) {
65485
+ if (value === "" ) {
65478
65486
return false;
65479
65487
}
65480
65488
let mdata = Number(value);
@@ -65484,7 +65492,7 @@ class core_Util_Util {
65484
65492
return !isNaN(mdata);
65485
65493
}
65486
65494
65487
- /**
65495
+ /**
65488
65496
* 随机生成id
65489
65497
* @param attr
65490
65498
* @returns {string}
@@ -65505,7 +65513,8 @@ class core_Util_Util {
65505
65513
* @returns {string} 生成的 RGBA 格式。
65506
65514
*/
65507
65515
static hexToRgba(hex, opacity) {
65508
- var color = [], rgba = [];
65516
+ var color = [],
65517
+ rgba = [];
65509
65518
hex = hex.replace(/#/, "");
65510
65519
if (hex.length == 3) {
65511
65520
var tmp = [];
@@ -65524,6 +65533,7 @@ class core_Util_Util {
65524
65533
}
65525
65534
65526
65535
external_mapboxgl_default.a.supermap.Util = core_Util_Util;
65536
+
65527
65537
// CONCATENATED MODULE: ./src/mapboxgl/core/index.js
65528
65538
/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved.
65529
65539
* This program are made available under the terms of the Apache License, Version 2.0
@@ -73201,7 +73211,7 @@ class FeatureService_FeatureService extends ServiceBase_ServiceBase {
73201
73211
return {};
73202
73212
}
73203
73213
var me = this;
73204
- params.returnContent = ( params.returnContent == null) ? true : params.returnContent;
73214
+ params.returnContent = params.returnContent == null ? true : params.returnContent;
73205
73215
params.fromIndex = params.fromIndex ? params.fromIndex : 0;
73206
73216
params.toIndex = params.toIndex ? params.toIndex : -1;
73207
73217
if (params.bounds) {
@@ -73213,13 +73223,17 @@ class FeatureService_FeatureService extends ServiceBase_ServiceBase {
73213
73223
73214
73224
//mapboxgl geojson要素对象转 SuperMap Geometry 对象
73215
73225
if (params.geometry) {
73216
- params.geometry = core_Util_Util.toSuperMapGeometry(params.geometry);
73226
+ if (params.geometry instanceof external_mapboxgl_default.a.LngLatBounds) {
73227
+ params.geometry = core_Util_Util.toSuperMapPolygon(params.geometry);
73228
+ } else {
73229
+ params.geometry = core_Util_Util.toSuperMapGeometry(params.geometry);
73230
+ }
73217
73231
}
73218
73232
//editFeature服务参数转换,传入单独得对象或对象数组
73219
73233
if (params.features) {
73220
73234
var features = [];
73221
73235
if (core_Util_Util.isArray(params.features)) {
73222
- params.features.map(function (feature) {
73236
+ params.features.map(function(feature) {
73223
73237
features.push(me._createServerFeature(feature));
73224
73238
return features;
73225
73239
});
@@ -73233,7 +73247,9 @@ class FeatureService_FeatureService extends ServiceBase_ServiceBase {
73233
73247
73234
73248
//geoFeature严格按照 mapboxgl geojson的结构
73235
73249
_createServerFeature(geoFeature) {
73236
- var feature = {}, fieldNames = [], fieldValues = [];
73250
+ var feature = {},
73251
+ fieldNames = [],
73252
+ fieldValues = [];
73237
73253
var properties = geoFeature.properties;
73238
73254
for (var key in properties) {
73239
73255
fieldNames.push(key);
@@ -73249,11 +73265,12 @@ class FeatureService_FeatureService extends ServiceBase_ServiceBase {
73249
73265
}
73250
73266
73251
73267
_processFormat(resultFormat) {
73252
- return ( resultFormat) ? resultFormat : REST_DataFormat.GEOJSON;
73268
+ return resultFormat ? resultFormat : REST_DataFormat.GEOJSON;
73253
73269
}
73254
73270
}
73255
73271
73256
73272
external_mapboxgl_default.a.supermap.FeatureService = FeatureService_FeatureService;
73273
+
73257
73274
// CONCATENATED MODULE: ./src/mapboxgl/services/FieldService.js
73258
73275
/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved.
73259
73276
* This program are made available under the terms of the Apache License, Version 2.0
@@ -75138,8 +75155,8 @@ external_mapboxgl_default.a.supermap.ProcessingService = ProcessingService_Proce
75138
75155
* @classdesc 地图查询服务类。
75139
75156
* 提供:范围查询,SQL 查询,几何查询,距离查询。
75140
75157
* @extends {mapboxgl.supermap.ServiceBase}
75141
- * @param {string} url - 地图查询服务访问地址。
75142
- * @param {Object} options - 服务交互时所需的可选参数。
75158
+ * @param {string} url - 地图查询服务访问地址。
75159
+ * @param {Object} options - 服务交互时所需的可选参数。
75143
75160
* @param {string} [options.proxy] - 服务代理地址。
75144
75161
* @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
75145
75162
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
@@ -75151,7 +75168,6 @@ external_mapboxgl_default.a.supermap.ProcessingService = ProcessingService_Proce
75151
75168
* })
75152
75169
*/
75153
75170
class services_QueryService_QueryService extends ServiceBase_ServiceBase {
75154
-
75155
75171
constructor(url, options) {
75156
75172
super(url, options);
75157
75173
}
@@ -75257,24 +75273,17 @@ class services_QueryService_QueryService extends ServiceBase_ServiceBase {
75257
75273
queryByGeometryService.processAsync(me._processParams(params));
75258
75274
}
75259
75275
75260
-
75261
75276
_processParams(params) {
75262
-
75263
75277
if (!params) {
75264
75278
return {};
75265
75279
}
75266
- params.returnContent = ( params.returnContent == null) ? true : params.returnContent;
75280
+ params.returnContent = params.returnContent == null ? true : params.returnContent;
75267
75281
if (params.queryParams && !core_Util_Util.isArray(params.queryParams)) {
75268
75282
params.queryParams = [params.queryParams];
75269
75283
}
75270
75284
if (params.bounds) {
75271
75285
if (params.bounds instanceof Array) {
75272
- params.bounds = new Bounds_Bounds(
75273
- params.bounds[0],
75274
- params.bounds[1],
75275
- params.bounds[2],
75276
- params.bounds[3]
75277
- );
75286
+ params.bounds = new Bounds_Bounds(params.bounds[0], params.bounds[1], params.bounds[2], params.bounds[3]);
75278
75287
}
75279
75288
if (params.bounds instanceof external_mapboxgl_default.a.LngLatBounds) {
75280
75289
params.bounds = new Bounds_Bounds(
@@ -75284,11 +75293,9 @@ class services_QueryService_QueryService extends ServiceBase_ServiceBase {
75284
75293
params.bounds.getNorthEast().lat
75285
75294
);
75286
75295
}
75287
-
75288
75296
}
75289
75297
75290
75298
if (params.geometry) {
75291
-
75292
75299
if (params.geometry instanceof external_mapboxgl_default.a.LngLat) {
75293
75300
params.geometry = new Point_Point(params.geometry.lng, params.geometry.lat);
75294
75301
}
@@ -75297,20 +75304,24 @@ class services_QueryService_QueryService extends ServiceBase_ServiceBase {
75297
75304
params.geometry = new Point_Point(params.geometry.x, params.geometry.y);
75298
75305
}
75299
75306
75300
- if (!(params.geometry instanceof Geometry_Geometry)) {
75307
+ if (params.geometry instanceof external_mapboxgl_default.a.LngLatBounds) {
75308
+ params.geometry = core_Util_Util.toSuperMapPolygon(params.geometry);
75309
+ }
75301
75310
75311
+ if (!(params.geometry instanceof Geometry_Geometry)) {
75302
75312
params.geometry = core_Util_Util.toSuperMapGeometry(params.geometry);
75303
75313
}
75304
75314
}
75305
75315
return params;
75306
75316
}
75307
75317
75308
75318
_processFormat(resultFormat) {
75309
- return ( resultFormat) ? resultFormat : REST_DataFormat.GEOJSON;
75319
+ return resultFormat ? resultFormat : REST_DataFormat.GEOJSON;
75310
75320
}
75311
75321
}
75312
75322
75313
75323
external_mapboxgl_default.a.supermap.QueryService = services_QueryService_QueryService;
75324
+
75314
75325
// CONCATENATED MODULE: ./src/mapboxgl/services/SpatialAnalystService.js
75315
75326
/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved.
75316
75327
* This program are made available under the terms of the Apache License, Version 2.0
0 commit comments