egovamap 0.15.15 → 0.15.18

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.
@@ -142,6 +142,9 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
142
142
  }
143
143
  }
144
144
  that.$gisMapFrame.src = url;
145
+ that.$gisMapFrame.onload = function(){
146
+ that.$gisMapFrame.contentWindow.postMessage(gisServerURL, "*");
147
+ }
145
148
  });
146
149
  try {
147
150
  //如果启用了实景功能需要注册实景监听
@@ -475,7 +478,7 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
475
478
  parentScene);
476
479
  }
477
480
  /* 显示案件分布 */
478
- that.showRecListDistribution = function(infoJson, zoom, clickCallback, labelInfo,isShowLegend) {
481
+ that.showRecListDistribution = function(infoJson, zoom, clickCallback, labelInfo,isShowLegend, symbolUrl, options) {
479
482
  if (scene == null || infoJson.length == 0)
480
483
  return;
481
484
  //如果xy坐标没有值不处理
@@ -493,7 +496,7 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
493
496
  clickCallback(evt.args);
494
497
  });
495
498
  }
496
- scene.fire((msgPrefix + ":showRecListDistribution"), { args : [ infoJson, zoom, labelInfo,isShowLegend ] }, parentScene, false);
499
+ scene.fire((msgPrefix + ":showRecListDistribution"), { args : [ infoJson, zoom, labelInfo,isShowLegend, symbolUrl, options] }, parentScene, false);
497
500
 
498
501
  //如果启用了实景功能,同时进行实景定位
499
502
  if(mmsMap && infoJson.length == 1) {
@@ -516,32 +519,31 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
516
519
  // 移除监听
517
520
  var clickBackName = "showMultiObjectCurrentPositionClick";
518
521
  var mouseOverBackName = "showMultiObjectCurrentPositionMouseover";
519
- if(options&&options.callbacksuffix){
522
+ var mouseOutBackName = "showMultiObjectCurrentPositionMouseout";
523
+ if (options&&options.callbacksuffix) {
520
524
  clickBackName += options.callbacksuffix;
521
525
  mouseOverBackName += options.callbacksuffix;
526
+ mouseOutBackName += options.callbacksuffix;
522
527
  }
523
528
  that.removeEventBind(clickBackName);
524
529
  that.removeEventBind(mouseOverBackName);
525
- var args =[];
526
- var FuncList = [];
527
- for(var i = 0;i<arguments.length;i++){
528
- if (arguments[i] instanceof Function) {
529
- FuncList.push(arguments[i]);
530
- }else{
531
- args.push(arguments[i]);
532
- }
533
- }
534
- if (FuncList[0] instanceof Function) {
530
+ that.removeEventBind(mouseOutBackName);
531
+ if (clickCallback instanceof Function) {
535
532
  that.bindEvent(clickBackName, function(evt) {
536
- FuncList[0](evt.args);
533
+ clickCallback(evt.args);
537
534
  });
538
535
  }
539
- if (FuncList[1] instanceof Function) {
536
+ if (mouseOverCallBack instanceof Function) {
540
537
  that.bindEvent(mouseOverBackName, function(evt) {
541
- FuncList[1](evt.args);
538
+ mouseOverCallBack(evt.args);
542
539
  });
543
540
  }
544
- scene.fire((msgPrefix + ":showMultiObjectCurrentPosition"), {args: args}, parentScene, false);
541
+ if(mouseOutCallback instanceof Function){
542
+ that.bindEvent(mouseOutBackName, function(evt) {
543
+ mouseOutCallback(evt.args);
544
+ });
545
+ }
546
+ scene.fire((msgPrefix + ":showMultiObjectCurrentPosition"), {args: [jsonInfo, zoom, bClear, hStyleID, infoStyle, bCanvas, tagName, clusterOption, hasHover, layerID, options]}, parentScene, false);
545
547
  }
546
548
  /* 显示监督员 */
547
549
  that.showPatrolCurrentPosition = function (jsonInfo, zoom, bClear, hStyleID, clickCallback) {
@@ -563,24 +565,24 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
563
565
  scene.fire((msgPrefix + ":showPatrolCurrentPosition"), { args: args }, parentScene, false);
564
566
  }
565
567
  /* 获取缓冲区 */
566
- that.getBuffer = function (layerID, x, y, radius,getBufferCallback) {
567
- if (scene == null)
568
- return;
569
-
570
- var args = Array.prototype.slice.call(arguments);
571
- if (arguments[arguments.length - 1] instanceof Function) {
572
- getBufferCallback = arguments[arguments.length - 1];
573
- args = args.slice(0, args.length - 1);
574
- }
568
+ that.getBuffer = function (layerID, x, y, radius,getBufferCallback) {
569
+ if (scene == null)
570
+ return;
575
571
 
576
- if (getBufferCallback) {
577
- that.removeEventBind("getBufferCallback");
578
- that.bindEvent("getBufferCallback", function (evt) {
579
- getBufferCallback(evt.args);
580
- });
581
- }
582
- scene.fire((msgPrefix + ":getBuffer"), {args: args}, parentScene, true);
583
- }
572
+ var args = Array.prototype.slice.call(arguments);
573
+ if (arguments[arguments.length - 1] instanceof Function) {
574
+ getBufferCallback = arguments[arguments.length - 1];
575
+ args = args.slice(0, args.length - 1);
576
+ }
577
+
578
+ if (getBufferCallback) {
579
+ that.removeEventBind("getBufferCallback");
580
+ that.bindEvent("getBufferCallback", function (evt) {
581
+ getBufferCallback(evt.args);
582
+ });
583
+ }
584
+ scene.fire((msgPrefix + ":getBuffer"), {args: args}, parentScene, true);
585
+ }
584
586
  /* 获取多点的缓冲区 */
585
587
  that.getMultiPointBuffer = function(points, radius){
586
588
  if (scene == null)
@@ -588,6 +590,18 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
588
590
  scene.fire((msgPrefix + ":getMultiPointBuffer"), {args: args}, parentScene, true);
589
591
 
590
592
  }
593
+ /**
594
+ * 设置指定图层的样式
595
+ * @param id 元素的id
596
+ * @param tag 图层的标签
597
+ * @param style 图层样式
598
+ * @returns
599
+ */
600
+ that.setGraphicStyle = function(id, tag, style){
601
+ if (scene == null)
602
+ return;
603
+ scene.fire((msgPrefix + ":setGraphicStyle"), {args: args}, parentScene, true);
604
+ }
591
605
  /* 显示监督员责任网格 */
592
606
  that.showPatrolDutygridCells = function(infoJson, zoom, clickCallback) {
593
607
  if (scene == null)
@@ -303,7 +303,6 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig, co
303
303
  var mainScript = document.createElement('script');
304
304
  mainScript.setAttribute('type', 'text/javascript');
305
305
  var distOrSource = getLocalStorageItem('gisDebug') ? 'source' : 'dist';
306
- distOrSource = 'source';
307
306
  var cssUrl = gisServerURL + '/library/egovaviewer/build/' + distOrSource + '/index.css';
308
307
  var mainLink = document.createElement('link');
309
308
  // mainLink.setAttribute('name','egoavagisviewer_' + uniqueID);
@@ -759,7 +758,7 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig, co
759
758
  that.callMap('locateFeatureByIDs', layerID, keyValue, keyFiled, clearMap, style, hStyle, bZoom, randomColor, labelfield, labelstyle, geometry, where, renderCanvas, singleSelected, options, extendProperty, layerTag, outFieldStr, animiteStep, index, clipGeom, cb, popupTemplate);
760
759
  }
761
760
  /* 显示案件分布 */
762
- that.showRecListDistribution = function (infoJson, zoom, clickCallback, labelInfo, isShowLegend, symbolUrl) {
761
+ that.showRecListDistribution = function (infoJson, zoom, clickCallback, labelInfo, isShowLegend, symbolUrl, options) {
763
762
  if (scene == null || infoJson.length == 0)
764
763
  return;
765
764
  //如果xy坐标没有值不处理
@@ -769,23 +768,12 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig, co
769
768
  return;
770
769
  }
771
770
  }
772
- /*
773
- // 移除监听
774
- that.removeEventBind("showRecListDistributionCallback");
775
-
776
- if (clickCallback != undefined) {
777
- that.bindEvent("showRecListDistributionCallback", function (evt) {
778
- clickCallback(evt.args);
779
- });
780
- }
781
- scene.fire((msgPrefix + ":showRecListDistribution"), { args: [infoJson, zoom, labelInfo, isShowLegend] }, parentScene, false);
782
- */
783
-
771
+
784
772
  var cb = function (type, data) {
785
773
  if (clickCallback && type == 'showRecListDistributionCallback')
786
774
  clickCallback(data);
787
775
  };
788
- that.callMap('showRecListDistribution', infoJson, zoom, labelInfo, isShowLegend, symbolUrl, cb);
776
+ that.callMap('showRecListDistribution', infoJson, zoom, labelInfo, isShowLegend, symbolUrl, cb, options);
789
777
  //如果启用了实景功能,同时进行实景定位
790
778
  if (mmsMap && infoJson.length == 1) {
791
779
  var recInfo = infoJson[0];
@@ -130,6 +130,14 @@ var EGovaGlobeMap = function ($container, pScene, prefix, mapConfig, context, ca
130
130
  }
131
131
  }
132
132
  that.$globeMapFrame.src = globeMapUrl;
133
+ that.$globeMapFrame.onload = function(){
134
+ // that.$globeMapFrame.contentWindow.postMessage(globeConfig.globeServerURL, "*");
135
+
136
+ var mainScript = this.contentDocument.createElement("script");
137
+ mainScript.setAttribute("type", "text/javascript");
138
+ mainScript.setAttribute("src", serverURL + "/library/globe/api/initGlobe.js");
139
+ this.contentDocument.documentElement.getElementsByTagName("head").item(0).appendChild(mainScript);
140
+ }
133
141
  }
134
142
  }
135
143
  //callback && callback();
@@ -1859,6 +1867,31 @@ var EGovaGlobeMap = function ($container, pScene, prefix, mapConfig, context, ca
1859
1867
  return;
1860
1868
  scene.fire((msgPrefix + ":getMapConfig"), {args: [key, callback]}, parentScene, false);
1861
1869
  };
1870
+ that.addCIMMap = function(options) {
1871
+ if (scene == null)
1872
+ return;
1873
+ scene.fire((msgPrefix + ":addCIMMap"), { args: [options] }, parentScene, false);
1874
+ };
1875
+ that.addCIMModel = function(options) {
1876
+ if (scene == null)
1877
+ return;
1878
+ scene.fire((msgPrefix + ":addCIMModel"), { args: [options] }, parentScene, false);
1879
+ };
1880
+ that.setLayerVisible = function(options) {
1881
+ if (scene == null)
1882
+ return;
1883
+ scene.fire((msgPrefix + ":setLayerVisible"), { args: [options] }, parentScene, false);
1884
+ };
1885
+ that.flyToLayer = function(options) {
1886
+ if (scene == null)
1887
+ return;
1888
+ scene.fire((msgPrefix + ":flyToLayer"), { args: [options] }, parentScene, false);
1889
+ };
1890
+ that.controlCamera = function(options) {
1891
+ if (scene == null)
1892
+ return;
1893
+ scene.fire((msgPrefix + ":controlCamera"), { args: [options] }, parentScene, false);
1894
+ };
1862
1895
 
1863
1896
  that.init();
1864
1897
  };
@@ -1638,7 +1638,7 @@ var EGovaMap = function (containerID, callback, mapConfig, mapType, mapParam, co
1638
1638
  }
1639
1639
  };
1640
1640
  /* 显示案件分布 */
1641
- that.showRecListDistribution = function (infoJson, zoom, clickCallback, labelInfo, isShowLegend) {
1641
+ that.showRecListDistribution = function (infoJson, zoom, clickCallback, labelInfo, isShowLegend, symbolUrl, options) {
1642
1642
  if (scene == null)
1643
1643
  return;
1644
1644
  if (gisMap != null) {
@@ -1804,7 +1804,14 @@ var EGovaMap = function (containerID, callback, mapConfig, mapType, mapParam, co
1804
1804
  if (gisMap != null)
1805
1805
  gismap.getMultiPointBuffer(this, arguments);
1806
1806
  }
1807
-
1807
+ that.setGraphicStyle = function(id, tag, style){
1808
+ if (scene == null){
1809
+ return;
1810
+ }
1811
+ if(gisMap!=null){
1812
+ gisMap.setGraphicStyle(this, arguments);
1813
+ }
1814
+ }
1808
1815
  /* 显示监督员责任网格 */
1809
1816
  that.showPatrolDutygridCells = function (infoJson, zoom, clickCallback) {
1810
1817
  if (scene == null)
@@ -3747,7 +3754,43 @@ var EGovaMap = function (containerID, callback, mapConfig, mapType, mapParam, co
3747
3754
  gisMap.clearLayerSelectStyle.apply(this, arguments);
3748
3755
  }
3749
3756
  }
3757
+ //添加影像wms、wmts等
3758
+ that.addCIMMap = function(options) {
3759
+ if (scene == null)
3760
+ return;
3761
+ if (globeMap != null) {
3762
+ globeMap.addCIMMap(options);
3763
+ }
3764
+ }
3765
+ that.addCIMModel = function(options) {
3766
+ if (scene == null)
3767
+ return;
3768
+ if (globeMap != null) {
3769
+ globeMap.addCIMModel(options);
3770
+ }
3771
+ };
3772
+ that.setLayerVisible = function(options) {
3773
+ if (scene == null)
3774
+ return;
3775
+ if (globeMap != null) {
3776
+ globeMap.setLayerVisible(options);
3777
+ }
3778
+ };
3750
3779
 
3780
+ that.flyToLayer = function(options) {
3781
+ if (scene == null)
3782
+ return;
3783
+ if (globeMap != null) {
3784
+ globeMap.flyToLayer(options);
3785
+ }
3786
+ };
3787
+ that.controlCamera = function(options) {
3788
+ if (scene == null)
3789
+ return;
3790
+ if (globeMap != null) {
3791
+ globeMap.controlCamera(options);
3792
+ }
3793
+ };
3751
3794
 
3752
3795
  that.initMap(containerID, callback, mapType, mapConfig);
3753
3796
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "egovamap",
3
- "version": "0.15.15",
3
+ "version": "0.15.18",
4
4
  "description": "eUrbanGIS SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {