egovamap 0.15.18 → 0.15.19

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.
@@ -143,7 +143,12 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
143
143
  }
144
144
  that.$gisMapFrame.src = url;
145
145
  that.$gisMapFrame.onload = function(){
146
- that.$gisMapFrame.contentWindow.postMessage(gisServerURL, "*");
146
+ if(!this.contentDocument.documentElement.getElementsByTagName("head").item(0).outerHTML.includes("/library/egovagis/map/map.js")) {
147
+ var mainScript = this.contentDocument.createElement("script");
148
+ mainScript.setAttribute("type", "text/javascript");
149
+ mainScript.setAttribute("src", gisServerURL + "/library/egovagis/map/map.js");
150
+ this.contentDocument.documentElement.getElementsByTagName("head").item(0).appendChild(mainScript);
151
+ }
147
152
  }
148
153
  });
149
154
  try {
@@ -186,6 +191,14 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
186
191
  }
187
192
  }
188
193
  that.$gisMapFrame.src = url;
194
+ that.$gisMapFrame.onload = function(){
195
+ if(!this.contentDocument.documentElement.getElementsByTagName("head").item(0).outerHTML.includes("/library/egovagis/map/map.js")) {
196
+ var mainScript = this.contentDocument.createElement("script");
197
+ mainScript.setAttribute("type", "text/javascript");
198
+ mainScript.setAttribute("src", gisServerURL + "/library/egovagis/map/map.js");
199
+ this.contentDocument.documentElement.getElementsByTagName("head").item(0).appendChild(mainScript);
200
+ }
201
+ }
189
202
  });
190
203
  try {
191
204
  //如果启用了实景功能需要注册实景监听,msgPrefix+'old',为了兼容以前的GIS实景结合
@@ -131,12 +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, "*");
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);
134
+ if(!this.contentDocument.documentElement.getElementsByTagName("head").item(0).outerHTML.includes("initGlobe.js")) {
135
+ var mainScript = this.contentDocument.createElement("script");
136
+ mainScript.setAttribute("type", "text/javascript");
137
+ mainScript.setAttribute("src", serverURL + "/library/globe/api/initGlobe.js");
138
+ this.contentDocument.documentElement.getElementsByTagName("head").item(0).appendChild(mainScript);
139
+ }
140
140
  }
141
141
  }
142
142
  }
@@ -249,6 +249,14 @@ var EGovaGlobeMap = function ($container, pScene, prefix, mapConfig, context, ca
249
249
  }
250
250
  }
251
251
  that.$globeMapFrame.src=globeMapUrl;
252
+ that.$globeMapFrame.onload = function(){
253
+ if(!this.contentDocument.documentElement.getElementsByTagName("head").item(0).outerHTML.includes("initGlobe.js")) {
254
+ var mainScript = this.contentDocument.createElement("script");
255
+ mainScript.setAttribute("type", "text/javascript");
256
+ mainScript.setAttribute("src", serverURL + "/library/globe/api/initGlobe.js");
257
+ this.contentDocument.documentElement.getElementsByTagName("head").item(0).appendChild(mainScript);
258
+ }
259
+ }
252
260
  }
253
261
  checkGlobeServerURL(context.globeServerURL || context.gisServerURL, function(serverURL) {
254
262
  context.globeServerURL = serverURL;
@@ -1892,6 +1900,51 @@ var EGovaGlobeMap = function ($container, pScene, prefix, mapConfig, context, ca
1892
1900
  return;
1893
1901
  scene.fire((msgPrefix + ":controlCamera"), { args: [options] }, parentScene, false);
1894
1902
  };
1903
+ that.zoomIn = function() {
1904
+ if (scene == null)
1905
+ return;
1906
+ scene.fire((msgPrefix + ":zoomIn"), { args: [] }, parentScene, false);
1907
+ };
1908
+ that.zoomOut = function(options) {
1909
+ if (scene == null)
1910
+ return;
1911
+ scene.fire((msgPrefix + ":zoomOut"), { args: [options] }, parentScene, false);
1912
+ };
1913
+ that.measureDistance = function(options) {
1914
+ if (scene == null)
1915
+ return;
1916
+ scene.fire((msgPrefix + ":measureDistance"), { args: [options] }, parentScene, false);
1917
+ };
1918
+ that.measureArea = function(options) {
1919
+ if (scene == null)
1920
+ return;
1921
+ scene.fire((msgPrefix + ":measureArea"), { args: [options] }, parentScene, false);
1922
+ };
1923
+ that.measureHeight = function(options) {
1924
+ if (scene == null)
1925
+ return;
1926
+ scene.fire((msgPrefix + ":measureHeight"), { args: [options] }, parentScene, false);
1927
+ };
1928
+ that.onUndergroundModel = function(alpha, distance) {
1929
+ if (scene == null)
1930
+ return;
1931
+ scene.fire((msgPrefix + ":onUndergroundModel"), { args: [alpha, distance] }, parentScene, false);
1932
+ };
1933
+ that.offUndergroundModel = function() {
1934
+ if (scene == null)
1935
+ return;
1936
+ scene.fire((msgPrefix + ":offUndergroundModel"), { args: [] }, parentScene, false);
1937
+ };
1938
+ that.addFlag = function(options) {
1939
+ if (scene == null)
1940
+ return;
1941
+ scene.fire((msgPrefix + ":addFlag"), { args: [options] }, parentScene, false);
1942
+ };
1943
+ that.getPointInfo = function(options) {
1944
+ if (scene == null)
1945
+ return;
1946
+ scene.fire((msgPrefix + ":getPointInfo"), { args: [options] }, parentScene, false);
1947
+ };
1895
1948
 
1896
1949
  that.init();
1897
1950
  };
@@ -3791,6 +3791,70 @@ var EGovaMap = function (containerID, callback, mapConfig, mapType, mapParam, co
3791
3791
  globeMap.controlCamera(options);
3792
3792
  }
3793
3793
  };
3794
+ that.zoomIn = function() {
3795
+ if (scene == null)
3796
+ return;
3797
+ if (globeMap != null) {
3798
+ globeMap.zoomIn();
3799
+ }
3800
+ };
3801
+ that.zoomOut = function() {
3802
+ if (scene == null)
3803
+ return;
3804
+ if (globeMap != null) {
3805
+ globeMap.zoomOut();
3806
+ }
3807
+ };
3808
+
3809
+ that.measureDistance = function() {
3810
+ if (scene == null)
3811
+ return;
3812
+ if (globeMap != null) {
3813
+ globeMap.measureDistance();
3814
+ }
3815
+ };
3816
+ that.measureArea = function() {
3817
+ if (scene == null)
3818
+ return;
3819
+ if (globeMap != null) {
3820
+ globeMap.measureArea();
3821
+ }
3822
+ };
3823
+ that.measureHeight = function() {
3824
+ if (scene == null)
3825
+ return;
3826
+ if (globeMap != null) {
3827
+ globeMap.measureHeight();
3828
+ }
3829
+ };
3830
+ that.onUndergroundModel = function(alpha, distance) {
3831
+ if (scene == null)
3832
+ return;
3833
+ if (globeMap != null) {
3834
+ globeMap.onUndergroundModel(alpha, distance);
3835
+ }
3836
+ };
3837
+ that.offUndergroundModel = function() {
3838
+ if (scene == null)
3839
+ return;
3840
+ if (globeMap != null) {
3841
+ globeMap.offUndergroundModel();
3842
+ }
3843
+ };
3844
+ that.addFlag = function(options) {
3845
+ if (scene == null)
3846
+ return;
3847
+ if (globeMap != null) {
3848
+ globeMap.addFlag(options);
3849
+ }
3850
+ };
3851
+ that.getPointInfo = function(options) {
3852
+ if (scene == null)
3853
+ return;
3854
+ if (globeMap != null) {
3855
+ globeMap.getPointInfo(options);
3856
+ }
3857
+ };
3794
3858
 
3795
3859
  that.initMap(containerID, callback, mapType, mapConfig);
3796
3860
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "egovamap",
3
- "version": "0.15.18",
3
+ "version": "0.15.19",
4
4
  "description": "eUrbanGIS SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {