egovamap 0.15.16 → 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.
- package/egovamap/egovagis.js +45 -17
- package/egovamap/egovaglobe.js +86 -0
- package/egovamap/egovamap.js +108 -1
- package/package.json +1 -1
package/egovamap/egovagis.js
CHANGED
|
@@ -142,6 +142,14 @@ 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
|
+
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
|
+
}
|
|
152
|
+
}
|
|
145
153
|
});
|
|
146
154
|
try {
|
|
147
155
|
//如果启用了实景功能需要注册实景监听
|
|
@@ -183,6 +191,14 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
|
|
|
183
191
|
}
|
|
184
192
|
}
|
|
185
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
|
+
}
|
|
186
202
|
});
|
|
187
203
|
try {
|
|
188
204
|
//如果启用了实景功能需要注册实景监听,msgPrefix+'old',为了兼容以前的GIS实景结合
|
|
@@ -562,24 +578,24 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
|
|
|
562
578
|
scene.fire((msgPrefix + ":showPatrolCurrentPosition"), { args: args }, parentScene, false);
|
|
563
579
|
}
|
|
564
580
|
/* 获取缓冲区 */
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
var args = Array.prototype.slice.call(arguments);
|
|
570
|
-
if (arguments[arguments.length - 1] instanceof Function) {
|
|
571
|
-
getBufferCallback = arguments[arguments.length - 1];
|
|
572
|
-
args = args.slice(0, args.length - 1);
|
|
573
|
-
}
|
|
581
|
+
that.getBuffer = function (layerID, x, y, radius,getBufferCallback) {
|
|
582
|
+
if (scene == null)
|
|
583
|
+
return;
|
|
574
584
|
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
585
|
+
var args = Array.prototype.slice.call(arguments);
|
|
586
|
+
if (arguments[arguments.length - 1] instanceof Function) {
|
|
587
|
+
getBufferCallback = arguments[arguments.length - 1];
|
|
588
|
+
args = args.slice(0, args.length - 1);
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
if (getBufferCallback) {
|
|
592
|
+
that.removeEventBind("getBufferCallback");
|
|
593
|
+
that.bindEvent("getBufferCallback", function (evt) {
|
|
594
|
+
getBufferCallback(evt.args);
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
scene.fire((msgPrefix + ":getBuffer"), {args: args}, parentScene, true);
|
|
598
|
+
}
|
|
583
599
|
/* 获取多点的缓冲区 */
|
|
584
600
|
that.getMultiPointBuffer = function(points, radius){
|
|
585
601
|
if (scene == null)
|
|
@@ -587,6 +603,18 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
|
|
|
587
603
|
scene.fire((msgPrefix + ":getMultiPointBuffer"), {args: args}, parentScene, true);
|
|
588
604
|
|
|
589
605
|
}
|
|
606
|
+
/**
|
|
607
|
+
* 设置指定图层的样式
|
|
608
|
+
* @param id 元素的id
|
|
609
|
+
* @param tag 图层的标签
|
|
610
|
+
* @param style 图层样式
|
|
611
|
+
* @returns
|
|
612
|
+
*/
|
|
613
|
+
that.setGraphicStyle = function(id, tag, style){
|
|
614
|
+
if (scene == null)
|
|
615
|
+
return;
|
|
616
|
+
scene.fire((msgPrefix + ":setGraphicStyle"), {args: args}, parentScene, true);
|
|
617
|
+
}
|
|
590
618
|
/* 显示监督员责任网格 */
|
|
591
619
|
that.showPatrolDutygridCells = function(infoJson, zoom, clickCallback) {
|
|
592
620
|
if (scene == null)
|
package/egovamap/egovaglobe.js
CHANGED
|
@@ -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
|
+
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
|
+
}
|
|
133
141
|
}
|
|
134
142
|
}
|
|
135
143
|
//callback && callback();
|
|
@@ -241,6 +249,14 @@ var EGovaGlobeMap = function ($container, pScene, prefix, mapConfig, context, ca
|
|
|
241
249
|
}
|
|
242
250
|
}
|
|
243
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
|
+
}
|
|
244
260
|
}
|
|
245
261
|
checkGlobeServerURL(context.globeServerURL || context.gisServerURL, function(serverURL) {
|
|
246
262
|
context.globeServerURL = serverURL;
|
|
@@ -1859,6 +1875,76 @@ var EGovaGlobeMap = function ($container, pScene, prefix, mapConfig, context, ca
|
|
|
1859
1875
|
return;
|
|
1860
1876
|
scene.fire((msgPrefix + ":getMapConfig"), {args: [key, callback]}, parentScene, false);
|
|
1861
1877
|
};
|
|
1878
|
+
that.addCIMMap = function(options) {
|
|
1879
|
+
if (scene == null)
|
|
1880
|
+
return;
|
|
1881
|
+
scene.fire((msgPrefix + ":addCIMMap"), { args: [options] }, parentScene, false);
|
|
1882
|
+
};
|
|
1883
|
+
that.addCIMModel = function(options) {
|
|
1884
|
+
if (scene == null)
|
|
1885
|
+
return;
|
|
1886
|
+
scene.fire((msgPrefix + ":addCIMModel"), { args: [options] }, parentScene, false);
|
|
1887
|
+
};
|
|
1888
|
+
that.setLayerVisible = function(options) {
|
|
1889
|
+
if (scene == null)
|
|
1890
|
+
return;
|
|
1891
|
+
scene.fire((msgPrefix + ":setLayerVisible"), { args: [options] }, parentScene, false);
|
|
1892
|
+
};
|
|
1893
|
+
that.flyToLayer = function(options) {
|
|
1894
|
+
if (scene == null)
|
|
1895
|
+
return;
|
|
1896
|
+
scene.fire((msgPrefix + ":flyToLayer"), { args: [options] }, parentScene, false);
|
|
1897
|
+
};
|
|
1898
|
+
that.controlCamera = function(options) {
|
|
1899
|
+
if (scene == null)
|
|
1900
|
+
return;
|
|
1901
|
+
scene.fire((msgPrefix + ":controlCamera"), { args: [options] }, parentScene, false);
|
|
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
|
+
};
|
|
1862
1948
|
|
|
1863
1949
|
that.init();
|
|
1864
1950
|
};
|
package/egovamap/egovamap.js
CHANGED
|
@@ -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,107 @@ 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
|
+
};
|
|
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
|
+
};
|
|
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
|
+
};
|
|
3750
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
|
+
};
|
|
3751
3858
|
|
|
3752
3859
|
that.initMap(containerID, callback, mapType, mapConfig);
|
|
3753
3860
|
|