egovamap 0.18.2 → 0.18.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -125,6 +125,18 @@ var egovaBI = function(globeMap, gisMap, mapType){
125
125
  p.symbolUrl = options.textStyle.symbolUrl || "location.png";
126
126
  p.scale = options.textStyle.scale;
127
127
  p.angle = options.textStyle.angle;
128
+ //classify symbol
129
+ if (options.textStyle.enableClassify) {
130
+ const customScheme = options.textStyle.customScheme;
131
+ const classField = options.textStyle.classField;
132
+ if (p[classField] && Object.prototype.toString.call(customScheme)=="[object Array]" && customScheme.length) {
133
+ customScheme.forEach(scheme => {
134
+ if (scheme.type == p[classField]) {
135
+ scheme.imageUrl && (p.symbolUrl = scheme.imageUrl);
136
+ }
137
+ });
138
+ }
139
+ }
128
140
  //textValue
129
141
  if (options.textStyle.enableText) {
130
142
  p.labelStyle = {
@@ -136,7 +148,7 @@ var egovaBI = function(globeMap, gisMap, mapType){
136
148
  font: {
137
149
  size: options.textStyle.fontSize + "px",
138
150
  weight: options.textStyle.fontWeight,
139
- family: options.textStyle.family || "microsoft-yahei"
151
+ family: options.textStyle.family || "microsoft-yahei-regular"
140
152
  }
141
153
  };
142
154
  }
@@ -178,7 +190,7 @@ var egovaBI = function(globeMap, gisMap, mapType){
178
190
  font: {
179
191
  size: options.clusterStyle.fontSize + "px",
180
192
  weight: options.clusterStyle.fontWeight || "normal",
181
- family: options.clusterStyle.family || "microsoft-yahei"
193
+ family: options.clusterStyle.family || "microsoft-yahei-regular"
182
194
  }
183
195
  }
184
196
  };
@@ -302,76 +314,82 @@ var egovaBI = function(globeMap, gisMap, mapType){
302
314
  * @author: Hetianhong
303
315
  * @date: 2021-09-09 14:49:49
304
316
  */
305
- this.drawPoints = function (layerName, positions, options) {
306
- if(globeMap && mapType == "globe"){
307
- if (!options.layerUsage || !options.layerUsage.usageID) {
317
+ this.drawPoints = function (layerName, positions, options) {
318
+ let drawData = function (layerName, positions, options) {
319
+ if (globeMap && mapType == "globe") {
308
320
  globeMap.drawPoints(layerName, positions, options);
309
- return;
310
- }
311
- let queryFeature = (queryParams) => {
312
- return new Promise(function(resolve) {
313
- let cb = function(result) {
314
- resolve(result)
315
- }
316
- if(gisMap) {
317
- gisMap.queryFeature(queryParams, cb);
318
- }else{
319
- return Promise.resolve(undefined)
320
- }
321
- })
322
-
323
- }
324
- let queryParams = {
325
- layerID: options.layerUsage.usageID,
326
- outGeometry: true,
321
+ }else if(gisMap && mapType == "map"){
322
+ deal2DPoints(layerName, positions, options).then(args => {
323
+ gisMap.showMultiObjectCurrentPosition(
324
+ args.datalist,
325
+ args.zoom,
326
+ args.clear,
327
+ args.highLightType,
328
+ args.infoStyle,
329
+ args.renderCanvas,
330
+ args.tagName,
331
+ options.clickCallback,
332
+ options.mouseOverCallback,
333
+ args.clusterOption,
334
+ args.hasHover,
335
+ layerName,
336
+ options.mouseOutCallback,
337
+ options.option
338
+ );
339
+ });
327
340
  }
328
- queryFeature(queryParams)
329
- .then(function(resultData) {
330
- if(!resultData) {
331
- console.log('没有查询到数据,请检查查询参数')
332
- return
333
- }
334
- let dataCache=[];
335
- let errorSize=0;
336
- resultData.forEach(element => {
337
- let x,y;
338
- if(element.geometry){
339
- x=element.geometry.x;
340
- y=element.geometry.y;
341
+ }
342
+
343
+
344
+ if (!options.usageID) {
345
+ drawData(layerName, positions, options);
346
+ return;
347
+ }
348
+ let queryFeature = (queryParams) => {
349
+ return new Promise(function(resolve) {
350
+ let cb = function(result) {
351
+ resolve(result)
341
352
  }
342
- if(x&&y){
343
- let item={...element.attributes,x,y};
344
- dataCache.push(item);
353
+ if(gisMap) {
354
+ gisMap.queryFeature(queryParams, cb);
345
355
  }else{
346
- errorSize++;
356
+ return Promise.resolve(undefined)
347
357
  }
348
- });
349
- if(errorSize>0){
350
- console.error(`${errorSize}个点格式错误,无法正常加载`);
351
- }
352
- globeMap.drawPoints(layerName, dataCache, options);
353
- })
358
+ })
359
+
354
360
  }
355
- if(gisMap && mapType == "map"){
356
- deal2DPoints(layerName, positions, options).then(args => {
357
- gisMap.showMultiObjectCurrentPosition(
358
- args.datalist,
359
- args.zoom,
360
- args.clear,
361
- args.highLightType,
362
- args.infoStyle,
363
- args.renderCanvas,
364
- args.tagName,
365
- options.clickCallback,
366
- options.mouseOverCallback,
367
- args.clusterOption,
368
- args.hasHover,
369
- layerName,
370
- options.mouseOutCallback,
371
- options.option
372
- );
373
- });
361
+ let queryParams = {
362
+ layerID: options.usageID,
363
+ outGeometry: true,
374
364
  }
365
+ queryFeature(queryParams)
366
+ .then(function(resultData) {
367
+ if(!resultData) {
368
+ console.log('没有查询到数据,请检查查询参数')
369
+ return
370
+ }
371
+ let dataCache=[];
372
+ let errorSize=0;
373
+ resultData.forEach(element => {
374
+ let x,y;
375
+ if(element.geometry){
376
+ x=element.geometry.x;
377
+ y=element.geometry.y;
378
+ }
379
+ if(x&&y){
380
+ let item={...element.attributes,x,y};
381
+ dataCache.push(item);
382
+ }else{
383
+ errorSize++;
384
+ }
385
+ });
386
+ if(errorSize>0){
387
+ console.error(`${errorSize}个点格式错误,无法正常加载`);
388
+ }
389
+
390
+ drawData(layerName, dataCache, options);
391
+ })
392
+
375
393
  }
376
394
  this.getLabel = function (attributes) {
377
395
  if (!attributes) return;
@@ -675,6 +693,9 @@ var egovaBI = function(globeMap, gisMap, mapType){
675
693
  }
676
694
  }
677
695
  }
696
+ this.cancelHighlightedRegion=function(layerName){
697
+ globeMap.cancelHighlightedRegion(layerName);
698
+ }
678
699
  /*
679
700
  * @description:新参数格式的旧线接口,主要用来做中间层参数格式转换
680
701
  * @method showPolyline_BI
@@ -848,7 +869,8 @@ var egovaBI = function(globeMap, gisMap, mapType){
848
869
  if(!specialArea.geometries){
849
870
  specialArea.geometries=[];
850
871
  }
851
- let filterResult=new Function(`return ${specialArea.statusControl.compiled}`)().call(null,feature.attributes);
872
+ var attributes=JSON.parse(JSON.stringify(feature.attributes));
873
+ let filterResult=new Function(`return ${specialArea.statusControl.compiled}`)().call(null,attributes);
852
874
  if(filterResult==true){
853
875
  specialArea.geometries.push(geom);
854
876
  hasPush=true;
@@ -604,10 +604,10 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
604
604
  scene.fire((msgPrefix + ":getBuffer"), {args: args}, parentScene, true);
605
605
  }
606
606
  /* 获取多点的缓冲区 */
607
- that.getMultiPointBuffer = function(points, radius){
607
+ that.getMultiPointBuffer = function(points, radius, callback, options){
608
608
  if (scene == null)
609
609
  return;
610
- scene.fire((msgPrefix + ":getMultiPointBuffer"), {args: [points, radius]}, parentScene, true);
610
+ scene.fire((msgPrefix + ":getMultiPointBuffer"), {args: [points, radius, callback, options]}, parentScene, true);
611
611
 
612
612
  }
613
613
  /**
@@ -1837,6 +1837,11 @@ var EGovaGlobeMap = function ($container, pScene, prefix, mapConfig, context, ca
1837
1837
  if (scene == null)
1838
1838
  return;
1839
1839
  scene.fire((msgPrefix + ":regionOperation"), {args: [options, data]}, parentScene, false);
1840
+ };
1841
+ that.cancelHighlightedRegion = function(layerName){
1842
+ if (scene == null)
1843
+ return;
1844
+ scene.fire((msgPrefix + ":cancelHighlightedPrimitive"), {args: [layerName]}, parentScene, false);
1840
1845
  };
1841
1846
  that.activeLayer = function(layerName, options, filter){
1842
1847
  if (scene == null)
@@ -1843,7 +1843,7 @@ var EGovaMap = function (containerID, callback, mapConfig, mapType, mapParam, co
1843
1843
  * @param {*} radius 缓冲距离,单位为米
1844
1844
  * @returns
1845
1845
  */
1846
- that.getMultiPointBuffer = function(points, radius){
1846
+ that.getMultiPointBuffer = function(points, radius, callback, options){
1847
1847
  if (scene == null)
1848
1848
  return;
1849
1849
  if (gisMap != null)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "egovamap",
3
- "version": "0.18.2",
3
+ "version": "0.18.5",
4
4
  "description": "eUrbanGIS SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {