egovamap 0.15.17 → 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.
@@ -565,24 +565,24 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
565
565
  scene.fire((msgPrefix + ":showPatrolCurrentPosition"), { args: args }, parentScene, false);
566
566
  }
567
567
  /* 获取缓冲区 */
568
- that.getBuffer = function (layerID, x, y, radius,getBufferCallback) {
569
- if (scene == null)
570
- return;
571
-
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
- }
568
+ that.getBuffer = function (layerID, x, y, radius,getBufferCallback) {
569
+ if (scene == null)
570
+ return;
577
571
 
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
- }
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
+ }
586
586
  /* 获取多点的缓冲区 */
587
587
  that.getMultiPointBuffer = function(points, radius){
588
588
  if (scene == null)
@@ -590,6 +590,18 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
590
590
  scene.fire((msgPrefix + ":getMultiPointBuffer"), {args: args}, parentScene, true);
591
591
 
592
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
+ }
593
605
  /* 显示监督员责任网格 */
594
606
  that.showPatrolDutygridCells = function(infoJson, zoom, clickCallback) {
595
607
  if (scene == null)
@@ -131,7 +131,12 @@ var EGovaGlobeMap = function ($container, pScene, prefix, mapConfig, context, ca
131
131
  }
132
132
  that.$globeMapFrame.src = globeMapUrl;
133
133
  that.$globeMapFrame.onload = function(){
134
- that.$globeMapFrame.contentWindow.postMessage(globeConfig.globeServerURL, "*");
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);
135
140
  }
136
141
  }
137
142
  }
@@ -1862,6 +1867,31 @@ var EGovaGlobeMap = function ($container, pScene, prefix, mapConfig, context, ca
1862
1867
  return;
1863
1868
  scene.fire((msgPrefix + ":getMapConfig"), {args: [key, callback]}, parentScene, false);
1864
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
+ };
1865
1895
 
1866
1896
  that.init();
1867
1897
  };
@@ -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.17",
3
+ "version": "0.15.18",
4
4
  "description": "eUrbanGIS SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {