egovamap 0.13.2 → 0.14.2

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.
@@ -290,6 +290,65 @@ var egovaBI = function(globeMap, gisMap, mapType){
290
290
  });
291
291
  }
292
292
  }
293
+ this.getLabel = function(attributes){
294
+ if(!attributes) return;
295
+ var label = [], field = {};
296
+ for(var key in attributes){
297
+ field = {};
298
+ field[key] = attributes[key];
299
+ label.push(field);
300
+ }
301
+ return label;
302
+ }
303
+ this.drawParts = function (options, data) {
304
+ var self = this;
305
+ function showParts(data) {
306
+ var drawParam = options.drawParam || [];
307
+ drawParam.unshift(data);
308
+ if (globeMap) {
309
+ globeMap.showMultiObjectCurrentPosition(...drawParam);
310
+ } else if (gisMap) {
311
+ gisMap.showMultiObjectCurrentPosition(...drawParam);
312
+ }
313
+ }
314
+
315
+ if(data) {
316
+ showParts(data);
317
+ } else {
318
+ let queryFromGIS = () => {
319
+ let queryParam = options.queryParam;
320
+ var subTypeName = options.subTypeName;
321
+ var subUniqueCode = options.subUniqueCode;
322
+ let queryCallback = function (featureInfos) {
323
+ var features = featureInfos[queryParam.phyLayerIDs];
324
+ var symbolUrl = "";
325
+ if(subUniqueCode.indexOf("http") > -1){
326
+ symbolUrl = subUniqueCode;
327
+ }else if(subUniqueCode.indexOf(".") > -1){
328
+ symbolUrl = subUniqueCode;
329
+ }else{
330
+ symbolUrl = "".concat(subUniqueCode, ".png");
331
+ }
332
+ var dataList = features.map((function (feature) {
333
+ return Object.assign({}, {x:feature.geometry.x,y:feature.geometry.y}, {
334
+ attributes: feature.attributes,
335
+ //label:self.getLabel(feature.attributes),
336
+ symbolType: -1,
337
+ symbolUrl: symbolUrl,
338
+ });
339
+ }));
340
+ showParts(dataList);
341
+ };
342
+ if(gisMap) {
343
+ gisMap.queryPhylayerFeatures(queryParam, queryCallback);
344
+ }
345
+ }
346
+ queryFromGIS();
347
+ }
348
+ }
349
+
350
+
351
+
293
352
  /*
294
353
  * @description:新的轨迹线接口
295
354
  * @method traceOperation
@@ -621,6 +680,65 @@ var egovaBI = function(globeMap, gisMap, mapType){
621
680
  }
622
681
  }
623
682
  }
683
+
684
+ this.networkCloud = function (options, positions) {
685
+ if(!globeMap) {return}
686
+ globeMap.networkCloud(options, positions)
687
+ }
688
+ this.clearNetworkCloud = function (layerNames) {
689
+ if(!globeMap) {return}
690
+ globeMap.clearNetworkCloud(layerNames)
691
+ }
692
+ this.lineOperation = function(options, data) {
693
+ if(!options || !options.layerName){
694
+ console.log('图层名必须传递')
695
+ return
696
+ }
697
+ // 数据获取
698
+ let queryFeature = (queryParams) => {
699
+ if(gisMap) {
700
+ return new Promise(function(resolve) {
701
+ let cb = function(result) {
702
+ resolve(result)
703
+ }
704
+ gisMap.queryFeature(queryParams, cb)
705
+ })
706
+ } else {
707
+ return Promise.resolve(undefined)
708
+ }
709
+ }
710
+ // 执行绘制
711
+ let drawLine = (options, data) => {
712
+ if(!globeMap) {return}
713
+ globeMap.lineOperation(options, data)
714
+ }
715
+
716
+ // 主逻辑
717
+ if(!!data) {
718
+ drawLine(options, data)
719
+ } else {
720
+ if(!options.usageID) {
721
+ console.log('图层用途必须传递')
722
+ return
723
+ }
724
+ let queryParams = {
725
+ layerID: options.usageID,
726
+ where: options.filterString || "1=1",
727
+ geometry: '',
728
+ outGeometry: true,
729
+ options: { originalData: true }
730
+ }
731
+ queryFeature(queryParams)
732
+ .then(function(resultData) {
733
+ if(!resultData) {
734
+ console.log('没有查询到数据,请检查查询参数')
735
+ return
736
+ }
737
+ drawLine(options, resultData)
738
+ })
739
+ }
740
+
741
+ }
624
742
  }
625
743
 
626
744
 
@@ -510,7 +510,7 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
510
510
  }
511
511
  }
512
512
  /* 显示多个自定义图标 */
513
- that.showMultiObjectCurrentPosition = function (jsonInfo, zoom, bClear, hStyleID, infoStyle, bCanvas, tagName, clusterOption, hasHover, layerID, clickCallback, mouseOverCallBack) {
513
+ that.showMultiObjectCurrentPosition = function (jsonInfo, zoom, bClear, hStyleID, infoStyle, bCanvas, tagName, clickCallback, mouseOverCallBack, clusterOption, hasHover, layerID, mouseOutCallback, options) {
514
514
  if (scene == null)
515
515
  return;
516
516
  // 移除监听
@@ -698,6 +698,14 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
698
698
  parentScene);
699
699
  }
700
700
 
701
+ /**
702
+ *停止绘制要素
703
+ **/
704
+ that.stopDraw = function(){
705
+ scene.fire(msgPrefix + ":stopDraw", { args: [] },
706
+ parentScene);
707
+ }
708
+
701
709
  /**
702
710
  *等值面生成
703
711
  **/
@@ -857,7 +857,7 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig, co
857
857
  }
858
858
 
859
859
  /* 显示多个自定义图标 */
860
- that.showMultiObjectCurrentPosition = function (jsonInfo, zoom, bClear, hStyleID, infoStyle, bCanvas, clickCallback, tagName, clusterOption, hasHover, mouseOverCallback, mouseOutCallback, layerName, options) {
860
+ that.showMultiObjectCurrentPosition = function (jsonInfo, zoom, bClear, hStyleID, infoStyle, bCanvas, tagName, clickCallback, mouseOverCallback, clusterOption, hasHover, layerName, mouseOutCallback, options) {
861
861
  if (scene == null)
862
862
  return;
863
863
 
@@ -1799,7 +1799,28 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig, co
1799
1799
 
1800
1800
  that.callMap('removeWMSLayer', layerName);
1801
1801
  }
1802
+
1803
+ that.getMainSubTypeTree = function (params, callback) {
1804
+ if (scene == null)
1805
+ return;
1806
+ var cb = function (type, data) {
1807
+ if (callback && type == 'getMainSubTypeTreeCallback') {
1808
+ callback(data);
1809
+ }
1810
+ };
1811
+ that.callMap('getMainSubTypeTree', params, cb);
1812
+ }
1802
1813
 
1814
+ that.getRegion = function (params, callback) {
1815
+ if (scene == null)
1816
+ return;
1817
+ var cb = function (type, data) {
1818
+ if (callback && type == 'getRegionCallback') {
1819
+ callback(data);
1820
+ }
1821
+ };
1822
+ that.callMap('getRegion', params, cb);
1823
+ }
1803
1824
  that.init();
1804
1825
  }
1805
1826
 
@@ -1819,6 +1819,21 @@ var EGovaGlobeMap = function ($container, pScene, prefix, mapConfig, context, ca
1819
1819
  return;
1820
1820
  scene.fire((msgPrefix + ":activeLayer"), {args: [layerName, options, filter]}, parentScene, false);
1821
1821
  };
1822
+ that.networkCloud = function(options, positions){
1823
+ if (scene == null)
1824
+ return;
1825
+ scene.fire((msgPrefix + ":networkCloud"), {args: [options, positions]}, parentScene, false);
1826
+ };
1827
+ that.clearNetworkCloud = function(layerNames){
1828
+ if (scene == null)
1829
+ return;
1830
+ scene.fire((msgPrefix + ":clearNetworkCloud"), {args: [layerNames]}, parentScene, false);
1831
+ };
1832
+ that.lineOperation = function(options, data){
1833
+ if (scene == null)
1834
+ return;
1835
+ scene.fire((msgPrefix + ":lineOperation"), {args: [options, data]}, parentScene, false);
1836
+ };
1822
1837
 
1823
1838
  that.init();
1824
1839
  };
@@ -1664,7 +1664,7 @@ var EGovaMap = function (containerID, callback, mapConfig, mapType, mapParam, co
1664
1664
  };
1665
1665
 
1666
1666
  /* 显示多个自定义图标 */
1667
- that.showMultiObjectCurrentPosition = function (jsonInfo, zoom, bClear, hStyleID, infoStyle, bCanvas, tagName, clickCallback, mouseOverCallBack, clusterOption, hasHover, layerID) {
1667
+ that.showMultiObjectCurrentPosition = function (jsonInfo, zoom, bClear, hStyleID, infoStyle, bCanvas, tagName, clickCallback, mouseOverCallBack, clusterOption, hasHover, layerID, mouseOutCallback, options) {
1668
1668
  if (scene == null)
1669
1669
  return;
1670
1670
  if (gisMap != null && that.synchroSetting === true) {
@@ -3596,6 +3596,43 @@ var EGovaMap = function (containerID, callback, mapConfig, mapType, mapParam, co
3596
3596
  gisMap.removeWMSLayer(layerName);
3597
3597
  }
3598
3598
  }
3599
+
3600
+ /**
3601
+ * 获取大小类树
3602
+ * @param {String} params:{
3603
+ * usageid: 3002, //区域图层用途
3604
+ * regioncode: 420115001, //区域编码
3605
+ * where: 'MAIN_UNIQUE_CODE > 0',
3606
+ * orderfield: 'SUB_UNIQUE_CODE',
3607
+ * returntree: true
3608
+ * };
3609
+ * @callback 回调函数
3610
+ * @returns {void}
3611
+ */
3612
+ that.getMainSubTypeTree = function (params, callback) {
3613
+ if (scene == null)
3614
+ return;
3615
+ if (gisMap != null) {
3616
+ gisMap.getMainSubTypeTree(params, callback);
3617
+ }
3618
+ }
3619
+
3620
+ /**
3621
+ * 获取区域信息
3622
+ * @param {String} params: {
3623
+ * regionType: 1, // 区域类型:1:市 | 2:区 | 3:街道 | 4:社区
3624
+ * seniorId: -1
3625
+ * }
3626
+ * @callback 回调函数
3627
+ * @returns {void}
3628
+ */
3629
+ that.getRegion = function (params, callback) {
3630
+ if (scene == null)
3631
+ return;
3632
+ if (gisMap != null) {
3633
+ gisMap.getRegion(params, callback);
3634
+ }
3635
+ }
3599
3636
 
3600
3637
  /**
3601
3638
  * 二维展示案件荧光点位接口
@@ -3653,7 +3690,7 @@ var EGovaMap = function (containerID, callback, mapConfig, mapType, mapParam, co
3653
3690
  if (gisMap != null) {
3654
3691
  gisMap.traceMultiSelectbyID.apply(this, arguments);
3655
3692
  }
3656
- }
3693
+ }
3657
3694
 
3658
3695
 
3659
3696
  that.initMap(containerID, callback, mapType, mapConfig);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "egovamap",
3
- "version": "0.13.2",
3
+ "version": "0.14.2",
4
4
  "description": "eUrbanGIS SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {