egovamap 0.15.18 → 0.15.21

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实景结合
@@ -618,7 +631,7 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
618
631
  that.locateFeatureByIDs(layerID, layerKeyFieldName, cellID, bClearMap, gridCellStyle.style, gridCellStyle.hStyle, zoom);
619
632
  }
620
633
  /* 标识位置 */
621
- that.markMap = function(projectTypeID, eventTypeID, actPropertyID, displayStyleID, layerID, clickCallback, cellIndexName,point) {
634
+ that.markMap = function(projectTypeID, eventTypeID, actPropertyID, displayStyleID, layerID, clickCallback, cellIndexName,point,symbolUrl) {
622
635
  if (scene == null)
623
636
  return;
624
637
 
@@ -637,8 +650,8 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
637
650
  });
638
651
  }
639
652
  scene.fire(msgPrefix + ":markMap", {
640
- args : [ projectTypeID, eventTypeID, actPropertyID, displayStyleID, layerID, cellIndexName,point]
641
- }, parentScene, false);
653
+ args : [ projectTypeID, eventTypeID, actPropertyID, displayStyleID, layerID, cellIndexName,point, symbolUrl]
654
+ }, parentScene, false);
642
655
  }
643
656
  /* 案件定位 */
644
657
  that.eventLocate = that.recLocate = function(eventID, defaultMapRange) {
@@ -928,7 +928,7 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig, co
928
928
  that.callMap('locateFeatureByIDs', layerID, layerKeyFieldName, cellID, bClearMap, gridCellStyle.style, gridCellStyle.hStyle, zoom);
929
929
  }
930
930
  /* 标识位置 */
931
- that.markMap = function (projectTypeID, eventTypeID, actPropertyID, displayStyleID, layerID, clickCallback, cellIndexName, point, option, symbolUrl) {
931
+ that.markMap = function (projectTypeID, eventTypeID, actPropertyID, displayStyleID, layerID, clickCallback, cellIndexName, point, symbolUrl) {
932
932
  if (scene == null)
933
933
  return;
934
934
 
@@ -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,7 +1900,171 @@ var EGovaGlobeMap = function ($container, pScene, prefix, mapConfig, context, ca
1892
1900
  return;
1893
1901
  scene.fire((msgPrefix + ":controlCamera"), { args: [options] }, parentScene, false);
1894
1902
  };
1895
-
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
+ };
1948
+ //添加聚类图层
1949
+ that.addClusterLayerCIM = function(dataInfo, option) {
1950
+ if (scene == null)
1951
+ return;
1952
+ scene.fire((msgPrefix + ":addClusterLayer"), { args: [dataInfo, option] }, parentScene, false);
1953
+ };
1954
+ //可视域分析
1955
+ that.startViewer = function(options) {
1956
+ if (scene == null)
1957
+ return;
1958
+ scene.fire((msgPrefix + ":startViewer"), { args: [options] }, parentScene, false);
1959
+ };
1960
+ that.removeViewer = function() {
1961
+ if (scene == null)
1962
+ return;
1963
+ scene.fire((msgPrefix + ":removeViewer"), { args: [] }, parentScene, false);
1964
+ };
1965
+ that.setViewerOptions = function(options) {
1966
+ if (scene == null)
1967
+ return;
1968
+ scene.fire((msgPrefix + ":setViewerOptions"), { args: [options] }, parentScene, false);
1969
+ };
1970
+ that.showSkyLine = function(options) {
1971
+ if (scene == null)
1972
+ return;
1973
+ scene.fire((msgPrefix + ":showSkyLine"), { args: [options] }, parentScene, false);
1974
+ };
1975
+ that.clearSkyLine = function() {
1976
+ if (scene == null)
1977
+ return;
1978
+ scene.fire((msgPrefix + ":clearSkyLine"), { args: [] }, parentScene, false);
1979
+ };
1980
+ that.setLineOptions = function(options) {
1981
+ if (scene == null)
1982
+ return;
1983
+ scene.fire((msgPrefix + ":setLineOptions"), { args: [options] }, parentScene, false);
1984
+ };
1985
+ that.bufferAnalysis = function(options,clear,update) {
1986
+ if (scene == null)
1987
+ return;
1988
+ scene.fire((msgPrefix + ":bufferAnalysis"), { args: [options,clear,update] }, parentScene, false);
1989
+ };
1990
+ that.clearBufferAnalysis = function(options) {
1991
+ if (scene == null)
1992
+ return;
1993
+ scene.fire((msgPrefix + ":clearBufferAnalysis"), { args: [] }, parentScene, false);
1994
+ };
1995
+ that.addModelClickEvent = function(callback) {
1996
+ if (scene == null)
1997
+ return;
1998
+ scene.fire((msgPrefix + ":addModelClickEvent"), { args: [callback] }, parentScene, false);
1999
+ };
2000
+ that.removeModelClickEvent = function() {
2001
+ if (scene == null)
2002
+ return;
2003
+ scene.fire((msgPrefix + ":removeModelClickEvent"), { args: [] }, parentScene, false);
2004
+ };
2005
+ that.getBIMTree = function(option, callback) {
2006
+ if (scene == null)
2007
+ return;
2008
+ scene.fire((msgPrefix + ":getBIMTree"), { args: [option, callback] }, parentScene, false);
2009
+ };
2010
+ that.setBIMTree = function(option) {
2011
+ if (scene == null)
2012
+ return;
2013
+ scene.fire((msgPrefix + ":setBIMTree"), { args: [option] }, parentScene, false);
2014
+ };
2015
+ that.clearBimSelect = function() {
2016
+ if (scene == null)
2017
+ return;
2018
+ scene.fire((msgPrefix + ":clearBimSelect"), { args: [] }, parentScene, false);
2019
+ };
2020
+ that.visibilityAnalysis = function(type) {
2021
+ if (scene == null)
2022
+ return;
2023
+ scene.fire((msgPrefix + ":visibilityAnalysis"), { args: [type] }, parentScene, false);
2024
+ };
2025
+ that.clearVisibilityAnalysis = function() {
2026
+ if (scene == null)
2027
+ return;
2028
+ scene.fire((msgPrefix + ":clearVisibilityAnalysis"), { args: [] }, parentScene, false);
2029
+ };
2030
+ that.addCIMTerrain = function(options) {
2031
+ if (scene == null)
2032
+ return;
2033
+ scene.fire((msgPrefix + ":addCIMTerrain"), { args: [options] }, parentScene, false);
2034
+ };
2035
+ that.flytoPosition = function(lon, lat, height) {
2036
+ if (scene == null)
2037
+ return;
2038
+ scene.fire((msgPrefix + ":flytoPosition"), { args: [lon, lat, height] }, parentScene, false);
2039
+ };
2040
+ //开启日照分析
2041
+ that.openSunshineAnalysis = function() {
2042
+ if (scene == null)
2043
+ return;
2044
+ scene.fire((msgPrefix + ":openSunshineAnalysis"), { args: [] }, parentScene, false);
2045
+ };
2046
+ that.sunshineAnalysis = function(date) {
2047
+ if (scene == null)
2048
+ return;
2049
+ scene.fire((msgPrefix + ":sunshineAnalysis"), { args: [date] }, parentScene, false);
2050
+ };
2051
+ that.closeSunshineAnalysis = function() {
2052
+ if (scene == null)
2053
+ return;
2054
+ scene.fire((msgPrefix + ":closeSunshineAnalysis"), { args: [] }, parentScene, false);
2055
+ };
2056
+ //设置天气
2057
+ that.setViewConfig = function(type, options) {
2058
+ if (scene == null)
2059
+ return;
2060
+ scene.fire((msgPrefix + ":setViewConfig"), { args: [type, options] }, parentScene, false);
2061
+ };
2062
+ //管网高亮显示
2063
+ that.searchAndShowPipe = function(url, options, color, clear) {
2064
+ if (scene == null)
2065
+ return;
2066
+ scene.fire((msgPrefix + ":searchAndShowPipe"), { args: [url, options, color, clear] }, parentScene, false);
2067
+ };
1896
2068
  that.init();
1897
2069
  };
1898
2070
 
@@ -1822,7 +1822,7 @@ var EGovaMap = function (containerID, callback, mapConfig, mapType, mapParam, co
1822
1822
  }
1823
1823
 
1824
1824
  /* 标识位置 */
1825
- that.markMap = function (projectTypeID, eventTypeID, actPropertyID, displayStyleID, layerID, clickCallback, cellIndexName, point) {
1825
+ that.markMap = function (projectTypeID, eventTypeID, actPropertyID, displayStyleID, layerID, clickCallback, cellIndexName, point, symbolUrl) {
1826
1826
  if (scene == null)
1827
1827
  return;
1828
1828
  if (gisMap != null && gisMap.gisVisible) {
@@ -3791,7 +3791,237 @@ 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
+ };
3794
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
+ };
3858
+ /* 聚类 */
3859
+ that.addClusterLayerCIM = function(dataInfo, option) {
3860
+ if (scene == null)
3861
+ return;
3862
+
3863
+ if (globeMap != null) {
3864
+ globeMap.addClusterLayerCIM(dataInfo, option);
3865
+ }
3866
+ };
3867
+ //可视域分析
3868
+ that.startViewer = function(options) {
3869
+ if (scene == null)
3870
+ return;
3871
+ if (globeMap != null) {
3872
+ globeMap.startViewer(options);
3873
+ }
3874
+ };
3875
+ that.removeViewer = function() {
3876
+ if (scene == null)
3877
+ return;
3878
+ if (globeMap != null) {
3879
+ globeMap.removeViewer();
3880
+ }
3881
+ };
3882
+ that.setViewerOptions = function(options) {
3883
+ if (scene == null)
3884
+ return;
3885
+ if (globeMap != null) {
3886
+ globeMap.setViewerOptions(options);
3887
+ }
3888
+ };
3889
+ that.showSkyLine = function(options) {
3890
+ if (scene == null)
3891
+ return;
3892
+ if (globeMap != null) {
3893
+ globeMap.showSkyLine(options);
3894
+ }
3895
+ };
3896
+ that.clearSkyLine = function() {
3897
+ if (scene == null)
3898
+ return;
3899
+ if (globeMap != null) {
3900
+ globeMap.clearSkyLine();
3901
+ }
3902
+ };
3903
+ that.setLineOptions = function(options) {
3904
+ if (scene == null)
3905
+ return;
3906
+ if (globeMap != null) {
3907
+ globeMap.setLineOptions(options);
3908
+ }
3909
+ };
3910
+ that.bufferAnalysis = function(options,clear,update) {
3911
+ if (scene == null)
3912
+ return;
3913
+ if (globeMap != null) {
3914
+ globeMap.bufferAnalysis(options,clear,update);
3915
+ }
3916
+ };
3917
+ that.clearBufferAnalysis = function() {
3918
+ if (scene == null)
3919
+ return;
3920
+ if (globeMap != null) {
3921
+ globeMap.clearBufferAnalysis();
3922
+ }
3923
+ };
3924
+ that.addModelClickEvent = function(callback) {
3925
+ if (scene == null)
3926
+ return;
3927
+ if (globeMap != null) {
3928
+ globeMap.addModelClickEvent(callback);
3929
+ }
3930
+ };
3931
+ that.removeModelClickEvent = function() {
3932
+ if (scene == null)
3933
+ return;
3934
+ if (globeMap != null) {
3935
+ globeMap.removeModelClickEvent();
3936
+ }
3937
+ };
3938
+ that.getBIMTree = function(options, callback) {
3939
+ if (scene == null)
3940
+ return;
3941
+ if (globeMap != null) {
3942
+ globeMap.getBIMTree(options, callback);
3943
+ }
3944
+ };
3945
+ that.setBIMTree = function(options) {
3946
+ if (scene == null)
3947
+ return;
3948
+ if (globeMap != null) {
3949
+ globeMap.setBIMTree(options);
3950
+ }
3951
+ };
3952
+ that.clearBimSelect = function() {
3953
+ if (scene == null)
3954
+ return;
3955
+ if (globeMap != null) {
3956
+ globeMap.clearBimSelect();
3957
+ }
3958
+ };
3959
+ that.visibilityAnalysis = function(type) {
3960
+ if (scene == null)
3961
+ return;
3962
+ if (globeMap != null) {
3963
+ globeMap.visibilityAnalysis(type);
3964
+ }
3965
+ };
3966
+ that.clearVisibilityAnalysis = function() {
3967
+ if (scene == null)
3968
+ return;
3969
+ if (globeMap != null) {
3970
+ globeMap.clearVisibilityAnalysis();
3971
+ }
3972
+ };
3973
+ that.addCIMTerrain = function(options) {
3974
+ if (scene == null)
3975
+ return;
3976
+ if (globeMap != null) {
3977
+ globeMap.addCIMTerrain(options);
3978
+ }
3979
+ }
3980
+ that.flytoPosition = function(lon, lat, height) {
3981
+ if (scene == null)
3982
+ return;
3983
+ if (globeMap != null) {
3984
+ globeMap.flytoPosition(lon, lat, height);
3985
+ }
3986
+ };
3987
+ //开启日照分析
3988
+ that.openSunshineAnalysis = function() {
3989
+ if (scene == null)
3990
+ return;
3991
+ if (globeMap != null) {
3992
+ globeMap.openSunshineAnalysis();
3993
+ }
3994
+ };
3995
+ that.sunshineAnalysis = function(date) {
3996
+ if (scene == null)
3997
+ return;
3998
+ if (globeMap != null) {
3999
+ globeMap.sunshineAnalysis(date);
4000
+ }
4001
+ };
4002
+ that.closeSunshineAnalysis = function() {
4003
+ if (scene == null)
4004
+ return;
4005
+ if (globeMap != null) {
4006
+ globeMap.closeSunshineAnalysis();
4007
+ }
4008
+ };
4009
+ //设置天气
4010
+ that.setViewConfig = function(type, options) {
4011
+ if (scene == null)
4012
+ return;
4013
+ if (globeMap != null) {
4014
+ globeMap.setViewConfig(type, options);
4015
+ }
4016
+ };
4017
+ //管网高亮显示
4018
+ that.searchAndShowPipe = function(url, options, color, clear) {
4019
+ if (scene == null)
4020
+ return;
4021
+ if (globeMap != null) {
4022
+ globeMap.searchAndShowPipe(url, options, color, clear);
4023
+ }
4024
+ };
3795
4025
  that.initMap(containerID, callback, mapType, mapConfig);
3796
4026
 
3797
4027
  // EGovaBI(globeMap).bind(this)();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "egovamap",
3
- "version": "0.15.18",
3
+ "version": "0.15.21",
4
4
  "description": "eUrbanGIS SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {