@kq_npm/client3d_webgl_vue 0.7.4-beta → 0.7.5-beta
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/index.js +146 -17
- package/package.json +1 -1
- package/scenceview/index.js +116 -7
- package/shadowanalysis/index.js +2 -2
- package/viewshedanalysis/index.js +28 -8
package/index.js
CHANGED
|
@@ -936,7 +936,7 @@ class DrawManager {
|
|
|
936
936
|
});
|
|
937
937
|
}
|
|
938
938
|
|
|
939
|
-
callFun && callFun();
|
|
939
|
+
callFun && callFun(that._viewer);
|
|
940
940
|
});
|
|
941
941
|
} //删除指定绘图分组的所有图形
|
|
942
942
|
|
|
@@ -2537,7 +2537,8 @@ class ScenceViewViewModel extends (mitt_default()) {
|
|
|
2537
2537
|
_createBaseLayer(layerConfig) {
|
|
2538
2538
|
let layer = null;
|
|
2539
2539
|
let index = 1;
|
|
2540
|
-
let layerType = layerConfig.serverType
|
|
2540
|
+
let layerType = layerConfig.serverType;
|
|
2541
|
+
if (layerType) layerType = layerType.toLowerCase();
|
|
2541
2542
|
|
|
2542
2543
|
switch (layerType) {
|
|
2543
2544
|
case "kqserver":
|
|
@@ -2662,6 +2663,102 @@ class ScenceViewViewModel extends (mitt_default()) {
|
|
|
2662
2663
|
});
|
|
2663
2664
|
}
|
|
2664
2665
|
}
|
|
2666
|
+
} //创建在线底图
|
|
2667
|
+
|
|
2668
|
+
|
|
2669
|
+
_createOnlineLayer(layerConfig) {
|
|
2670
|
+
let layer = null;
|
|
2671
|
+
let layerType = layerConfig.renderType;
|
|
2672
|
+
if (layerType) layerType = layerType.toLowerCase();
|
|
2673
|
+
|
|
2674
|
+
switch (layerType) {
|
|
2675
|
+
case "kqserver":
|
|
2676
|
+
layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.Kq3dKQGISMapServerImageryProviderExt({
|
|
2677
|
+
url: layerConfig.url,
|
|
2678
|
+
ua_token: layerConfig.accessToken
|
|
2679
|
+
}));
|
|
2680
|
+
break;
|
|
2681
|
+
|
|
2682
|
+
case "wmts":
|
|
2683
|
+
let options = {
|
|
2684
|
+
url: layerConfig.url,
|
|
2685
|
+
layer: layerConfig.id,
|
|
2686
|
+
tileMatrixSetID: layerConfig.tilematrixSet || "default028mm",
|
|
2687
|
+
tileMatrixLabels: layerConfig.tileMatrixLabels,
|
|
2688
|
+
style: layerConfig.style || "default",
|
|
2689
|
+
format: layerConfig.format || "image/png",
|
|
2690
|
+
minimumLevel: layerConfig.minZoom,
|
|
2691
|
+
maximumLevel: layerConfig.maxZoom,
|
|
2692
|
+
subdomains: layerConfig.subdomains,
|
|
2693
|
+
tilingScheme: layerConfig.epsg === "4326" ? new Cesium.GeographicTilingScheme() : new Cesium.WebMercatorTilingScheme()
|
|
2694
|
+
};
|
|
2695
|
+
layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.WebMapTileServiceImageryProvider(options));
|
|
2696
|
+
break;
|
|
2697
|
+
|
|
2698
|
+
case "wms":
|
|
2699
|
+
layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.WebMapServiceImageryProvider({
|
|
2700
|
+
url: layerConfig.url,
|
|
2701
|
+
layers: layerConfig.id,
|
|
2702
|
+
parameters: {
|
|
2703
|
+
transparent: "true",
|
|
2704
|
+
format: "image/png"
|
|
2705
|
+
}
|
|
2706
|
+
}));
|
|
2707
|
+
break;
|
|
2708
|
+
|
|
2709
|
+
case "tianditu":
|
|
2710
|
+
layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.Kq3dTiandituImageryProvider({
|
|
2711
|
+
mapStyle: layerConfig.layerType + "_c"
|
|
2712
|
+
}));
|
|
2713
|
+
break;
|
|
2714
|
+
|
|
2715
|
+
case "baidu":
|
|
2716
|
+
layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.Kq3dBaiduMapsImageryProvider({
|
|
2717
|
+
mapStyle: layerConfig.layerType
|
|
2718
|
+
}));
|
|
2719
|
+
break;
|
|
2720
|
+
|
|
2721
|
+
case "gaode":
|
|
2722
|
+
layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.Kq3dAMapsImageryProvider({
|
|
2723
|
+
mapStyle: layerConfig.layerType
|
|
2724
|
+
}));
|
|
2725
|
+
break;
|
|
2726
|
+
|
|
2727
|
+
case "tencent":
|
|
2728
|
+
layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.Kq3dQQMapsImageryProvider({
|
|
2729
|
+
mapStyle: layerConfig.layerType
|
|
2730
|
+
}));
|
|
2731
|
+
break;
|
|
2732
|
+
|
|
2733
|
+
case "bing":
|
|
2734
|
+
layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.BingMapsImageryProvider({
|
|
2735
|
+
url: layerConfig.url || "https://dev.virtualearth.net",
|
|
2736
|
+
key: layerConfig.key || "AmXdbd8UeUJtaRSn7yVwyXgQlBBUqliLbHpgn2c76DfuHwAXfRrgS5qwfHU6Rhm8",
|
|
2737
|
+
mapStyle: layerConfig.layerType
|
|
2738
|
+
}));
|
|
2739
|
+
break;
|
|
2740
|
+
|
|
2741
|
+
case "arcgisonline":
|
|
2742
|
+
layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.Kq3dArcGISMapServerImageryProvider({
|
|
2743
|
+
url: layerConfig.url
|
|
2744
|
+
}));
|
|
2745
|
+
break;
|
|
2746
|
+
|
|
2747
|
+
case "mapbox":
|
|
2748
|
+
layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.MapboxImageryProvider({
|
|
2749
|
+
mapId: "mapbox." + layerConfig.layerType,
|
|
2750
|
+
accessToken: layerConfig.key || "pk.eyJ1IjoiZXhhbXBsZXMiLCJhIjoiY2p1dHRybDR5MGJuZjQzcGhrZ2doeGgwNyJ9.a-vxW4UaxOoUMWUTGnEArw"
|
|
2751
|
+
}));
|
|
2752
|
+
break;
|
|
2753
|
+
|
|
2754
|
+
case "osm":
|
|
2755
|
+
layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.createOpenStreetMapImageryProvider({
|
|
2756
|
+
url: layerConfig.url
|
|
2757
|
+
}));
|
|
2758
|
+
break;
|
|
2759
|
+
}
|
|
2760
|
+
|
|
2761
|
+
return layer;
|
|
2665
2762
|
}
|
|
2666
2763
|
/**
|
|
2667
2764
|
* 操作在线底图,添加显示隐藏图层
|
|
@@ -2678,12 +2775,18 @@ class ScenceViewViewModel extends (mitt_default()) {
|
|
|
2678
2775
|
});
|
|
2679
2776
|
|
|
2680
2777
|
if (!layer) {
|
|
2681
|
-
layer = this.
|
|
2778
|
+
layer = this._createOnlineLayer(layerConfig);
|
|
2682
2779
|
layer.name = guid;
|
|
2683
2780
|
layer.target = "online";
|
|
2684
2781
|
}
|
|
2685
2782
|
|
|
2686
|
-
if (layer)
|
|
2783
|
+
if (layer) {
|
|
2784
|
+
if (visible) {
|
|
2785
|
+
layer.show = visible;
|
|
2786
|
+
} else {
|
|
2787
|
+
this._viewer.imageryLayers.remove(layer);
|
|
2788
|
+
}
|
|
2789
|
+
}
|
|
2687
2790
|
}
|
|
2688
2791
|
/**
|
|
2689
2792
|
* 移除所有在线底图在地图中的显示
|
|
@@ -2691,12 +2794,18 @@ class ScenceViewViewModel extends (mitt_default()) {
|
|
|
2691
2794
|
|
|
2692
2795
|
|
|
2693
2796
|
removeAllOnlineBaseLayer() {
|
|
2694
|
-
let imageryLayers = this._viewer.imageryLayers
|
|
2695
|
-
|
|
2797
|
+
let imageryLayers = this._viewer.imageryLayers;
|
|
2798
|
+
let removeLayers = [];
|
|
2799
|
+
|
|
2800
|
+
imageryLayers._layers.forEach(layer => {
|
|
2696
2801
|
if (layer.target === "online") {
|
|
2697
|
-
|
|
2802
|
+
removeLayers.push(layer);
|
|
2698
2803
|
}
|
|
2699
2804
|
});
|
|
2805
|
+
|
|
2806
|
+
removeLayers.forEach(layer => {
|
|
2807
|
+
imageryLayers.remove(layer);
|
|
2808
|
+
});
|
|
2700
2809
|
} //获取三维视角
|
|
2701
2810
|
|
|
2702
2811
|
|
|
@@ -6746,26 +6855,39 @@ SightlineAnalysis.install = (Vue, opts) => {
|
|
|
6746
6855
|
//可视域分析逻辑类
|
|
6747
6856
|
class ViewshedAnalysisViewModel {
|
|
6748
6857
|
//可视域分析三维对象
|
|
6858
|
+
//三维场景对象
|
|
6859
|
+
//可视域分析存储参数对象
|
|
6749
6860
|
constructor(scenceView, options) {
|
|
6750
6861
|
_defineProperty(this, "_viewshedAnalysis", null);
|
|
6751
6862
|
|
|
6752
|
-
|
|
6753
|
-
scene.globe.depthTestAgainstTerrain = true;
|
|
6863
|
+
_defineProperty(this, "_scene", null);
|
|
6754
6864
|
|
|
6755
|
-
|
|
6756
|
-
|
|
6865
|
+
_defineProperty(this, "_options", null);
|
|
6866
|
+
|
|
6867
|
+
this._scene = scenceView._viewer.scene;
|
|
6868
|
+
this._scene.globe.depthTestAgainstTerrain = true;
|
|
6869
|
+
this._options = options;
|
|
6870
|
+
|
|
6871
|
+
if (this._options.visibleColor) {
|
|
6872
|
+
this._options.visibleColor = Cesium.Color.fromCssColorString(this._options.visibleColor);
|
|
6757
6873
|
}
|
|
6758
6874
|
|
|
6759
|
-
if (
|
|
6760
|
-
|
|
6875
|
+
if (this._options.visibleColor) {
|
|
6876
|
+
this._options.invisibleColor = Cesium.Color.fromCssColorString(this._options.invisibleColor);
|
|
6761
6877
|
}
|
|
6762
6878
|
|
|
6763
|
-
this._viewshedAnalysis = new Cesium.Kq3dViewshedInteractive(
|
|
6879
|
+
this._viewshedAnalysis = new Cesium.Kq3dViewshedInteractive(this._scene, this._options);
|
|
6764
6880
|
} //开始分析
|
|
6765
6881
|
|
|
6766
6882
|
|
|
6767
6883
|
start() {
|
|
6768
|
-
|
|
6884
|
+
if (this._viewshedAnalysis) {
|
|
6885
|
+
this._viewshedAnalysis.start();
|
|
6886
|
+
} else {
|
|
6887
|
+
this._viewshedAnalysis = new Cesium.Kq3dViewshedInteractive(this._scene, this._options);
|
|
6888
|
+
|
|
6889
|
+
this._viewshedAnalysis.start();
|
|
6890
|
+
} // if (!this._viewshedAnalysis.isRunning()) {
|
|
6769
6891
|
// // 绘制完成后,需要释放绘制事件
|
|
6770
6892
|
// }
|
|
6771
6893
|
|
|
@@ -6774,6 +6896,8 @@ class ViewshedAnalysisViewModel {
|
|
|
6774
6896
|
|
|
6775
6897
|
clear() {
|
|
6776
6898
|
this._viewshedAnalysis && this._viewshedAnalysis.pause();
|
|
6899
|
+
this._viewshedAnalysis && this._viewshedAnalysis.destroy();
|
|
6900
|
+
this._viewshedAnalysis = null;
|
|
6777
6901
|
} //销毁
|
|
6778
6902
|
|
|
6779
6903
|
|
|
@@ -6785,26 +6909,31 @@ class ViewshedAnalysisViewModel {
|
|
|
6785
6909
|
|
|
6786
6910
|
|
|
6787
6911
|
setOffsetHeight(offsetHeight) {
|
|
6912
|
+
this._options.offsetHeight = offsetHeight;
|
|
6788
6913
|
this._viewshedAnalysis.attachedViewshed.offsetHeight = Number(offsetHeight);
|
|
6789
6914
|
} //设置水平角
|
|
6790
6915
|
|
|
6791
6916
|
|
|
6792
6917
|
setFovH(fovH) {
|
|
6918
|
+
this._options.fovH = fovH;
|
|
6793
6919
|
this._viewshedAnalysis.attachedViewshed.fovH = Number(fovH);
|
|
6794
6920
|
} //设置竖直角
|
|
6795
6921
|
|
|
6796
6922
|
|
|
6797
6923
|
setFovV(fovV) {
|
|
6924
|
+
this._options.fovV = fovV;
|
|
6798
6925
|
this._viewshedAnalysis.attachedViewshed.fovV = Number(fovV);
|
|
6799
6926
|
} //设置可视颜色
|
|
6800
6927
|
|
|
6801
6928
|
|
|
6802
6929
|
setVisibleColor(visibleColor) {
|
|
6930
|
+
this._options.visibleColor = visibleColor;
|
|
6803
6931
|
this._viewshedAnalysis.attachedViewshed.visibleColor = Cesium.Color.fromCssColorString(visibleColor);
|
|
6804
6932
|
} //设置不可视颜色
|
|
6805
6933
|
|
|
6806
6934
|
|
|
6807
6935
|
setInvisibleColor(invisibleColor) {
|
|
6936
|
+
this._options.invisibleColor = invisibleColor;
|
|
6808
6937
|
this._viewshedAnalysis.attachedViewshed.invisibleColor = Cesium.Color.fromCssColorString(invisibleColor);
|
|
6809
6938
|
} //设置网格线颜色
|
|
6810
6939
|
|
|
@@ -7464,8 +7593,8 @@ class ShadowAnalysisViewModel {
|
|
|
7464
7593
|
destroy() {
|
|
7465
7594
|
this.clear(); //移除监听事件
|
|
7466
7595
|
|
|
7467
|
-
this._drawFinishedEventListener && this._drawFinishedEventListener();
|
|
7468
|
-
this._drawFinishedEventListener = null;
|
|
7596
|
+
this._globaOptions._drawFinishedEventListener && this._globaOptions._drawFinishedEventListener();
|
|
7597
|
+
this._globaOptions._drawFinishedEventListener = null;
|
|
7469
7598
|
}
|
|
7470
7599
|
|
|
7471
7600
|
}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@kq_npm/client3d_webgl_vue","description":"KQGIS Client3D for Vue.js","version":"0.7.
|
|
1
|
+
{"name":"@kq_npm/client3d_webgl_vue","description":"KQGIS Client3D for Vue.js","version":"0.7.5-beta","homepage":"","keywords":["KQGIS","webGL","Vue"],"browserslist":["> 1%","last 2 versions","not dead","not ie 11"],"author":"KQWEB GROUP","license":"Apache-2.0","dependencies":{"colorcolor":"^1.1.1","echarts":"^5.3.3","js-cookie":"^3.0.1","omit.js":"^2.0.2","save":"^2.5.0","tinycolor2":"^1.4.2","vue-i18n":"^9.2.0-beta.36","xlsx":"^0.18.5","@turf/turf":"^6.5.0","css-vars-ponyfill":"^2.4.8","xe-utils":"^3.5.4"}}
|
package/scenceview/index.js
CHANGED
|
@@ -483,7 +483,7 @@ class DrawManager {
|
|
|
483
483
|
});
|
|
484
484
|
}
|
|
485
485
|
|
|
486
|
-
callFun && callFun();
|
|
486
|
+
callFun && callFun(that._viewer);
|
|
487
487
|
});
|
|
488
488
|
} //删除指定绘图分组的所有图形
|
|
489
489
|
|
|
@@ -2084,7 +2084,8 @@ class ScenceViewViewModel extends (mitt_default()) {
|
|
|
2084
2084
|
_createBaseLayer(layerConfig) {
|
|
2085
2085
|
let layer = null;
|
|
2086
2086
|
let index = 1;
|
|
2087
|
-
let layerType = layerConfig.serverType
|
|
2087
|
+
let layerType = layerConfig.serverType;
|
|
2088
|
+
if (layerType) layerType = layerType.toLowerCase();
|
|
2088
2089
|
|
|
2089
2090
|
switch (layerType) {
|
|
2090
2091
|
case "kqserver":
|
|
@@ -2209,6 +2210,102 @@ class ScenceViewViewModel extends (mitt_default()) {
|
|
|
2209
2210
|
});
|
|
2210
2211
|
}
|
|
2211
2212
|
}
|
|
2213
|
+
} //创建在线底图
|
|
2214
|
+
|
|
2215
|
+
|
|
2216
|
+
_createOnlineLayer(layerConfig) {
|
|
2217
|
+
let layer = null;
|
|
2218
|
+
let layerType = layerConfig.renderType;
|
|
2219
|
+
if (layerType) layerType = layerType.toLowerCase();
|
|
2220
|
+
|
|
2221
|
+
switch (layerType) {
|
|
2222
|
+
case "kqserver":
|
|
2223
|
+
layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.Kq3dKQGISMapServerImageryProviderExt({
|
|
2224
|
+
url: layerConfig.url,
|
|
2225
|
+
ua_token: layerConfig.accessToken
|
|
2226
|
+
}));
|
|
2227
|
+
break;
|
|
2228
|
+
|
|
2229
|
+
case "wmts":
|
|
2230
|
+
let options = {
|
|
2231
|
+
url: layerConfig.url,
|
|
2232
|
+
layer: layerConfig.id,
|
|
2233
|
+
tileMatrixSetID: layerConfig.tilematrixSet || "default028mm",
|
|
2234
|
+
tileMatrixLabels: layerConfig.tileMatrixLabels,
|
|
2235
|
+
style: layerConfig.style || "default",
|
|
2236
|
+
format: layerConfig.format || "image/png",
|
|
2237
|
+
minimumLevel: layerConfig.minZoom,
|
|
2238
|
+
maximumLevel: layerConfig.maxZoom,
|
|
2239
|
+
subdomains: layerConfig.subdomains,
|
|
2240
|
+
tilingScheme: layerConfig.epsg === "4326" ? new Cesium.GeographicTilingScheme() : new Cesium.WebMercatorTilingScheme()
|
|
2241
|
+
};
|
|
2242
|
+
layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.WebMapTileServiceImageryProvider(options));
|
|
2243
|
+
break;
|
|
2244
|
+
|
|
2245
|
+
case "wms":
|
|
2246
|
+
layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.WebMapServiceImageryProvider({
|
|
2247
|
+
url: layerConfig.url,
|
|
2248
|
+
layers: layerConfig.id,
|
|
2249
|
+
parameters: {
|
|
2250
|
+
transparent: "true",
|
|
2251
|
+
format: "image/png"
|
|
2252
|
+
}
|
|
2253
|
+
}));
|
|
2254
|
+
break;
|
|
2255
|
+
|
|
2256
|
+
case "tianditu":
|
|
2257
|
+
layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.Kq3dTiandituImageryProvider({
|
|
2258
|
+
mapStyle: layerConfig.layerType + "_c"
|
|
2259
|
+
}));
|
|
2260
|
+
break;
|
|
2261
|
+
|
|
2262
|
+
case "baidu":
|
|
2263
|
+
layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.Kq3dBaiduMapsImageryProvider({
|
|
2264
|
+
mapStyle: layerConfig.layerType
|
|
2265
|
+
}));
|
|
2266
|
+
break;
|
|
2267
|
+
|
|
2268
|
+
case "gaode":
|
|
2269
|
+
layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.Kq3dAMapsImageryProvider({
|
|
2270
|
+
mapStyle: layerConfig.layerType
|
|
2271
|
+
}));
|
|
2272
|
+
break;
|
|
2273
|
+
|
|
2274
|
+
case "tencent":
|
|
2275
|
+
layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.Kq3dQQMapsImageryProvider({
|
|
2276
|
+
mapStyle: layerConfig.layerType
|
|
2277
|
+
}));
|
|
2278
|
+
break;
|
|
2279
|
+
|
|
2280
|
+
case "bing":
|
|
2281
|
+
layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.BingMapsImageryProvider({
|
|
2282
|
+
url: layerConfig.url || "https://dev.virtualearth.net",
|
|
2283
|
+
key: layerConfig.key || "AmXdbd8UeUJtaRSn7yVwyXgQlBBUqliLbHpgn2c76DfuHwAXfRrgS5qwfHU6Rhm8",
|
|
2284
|
+
mapStyle: layerConfig.layerType
|
|
2285
|
+
}));
|
|
2286
|
+
break;
|
|
2287
|
+
|
|
2288
|
+
case "arcgisonline":
|
|
2289
|
+
layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.Kq3dArcGISMapServerImageryProvider({
|
|
2290
|
+
url: layerConfig.url
|
|
2291
|
+
}));
|
|
2292
|
+
break;
|
|
2293
|
+
|
|
2294
|
+
case "mapbox":
|
|
2295
|
+
layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.MapboxImageryProvider({
|
|
2296
|
+
mapId: "mapbox." + layerConfig.layerType,
|
|
2297
|
+
accessToken: layerConfig.key || "pk.eyJ1IjoiZXhhbXBsZXMiLCJhIjoiY2p1dHRybDR5MGJuZjQzcGhrZ2doeGgwNyJ9.a-vxW4UaxOoUMWUTGnEArw"
|
|
2298
|
+
}));
|
|
2299
|
+
break;
|
|
2300
|
+
|
|
2301
|
+
case "osm":
|
|
2302
|
+
layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.createOpenStreetMapImageryProvider({
|
|
2303
|
+
url: layerConfig.url
|
|
2304
|
+
}));
|
|
2305
|
+
break;
|
|
2306
|
+
}
|
|
2307
|
+
|
|
2308
|
+
return layer;
|
|
2212
2309
|
}
|
|
2213
2310
|
/**
|
|
2214
2311
|
* 操作在线底图,添加显示隐藏图层
|
|
@@ -2225,12 +2322,18 @@ class ScenceViewViewModel extends (mitt_default()) {
|
|
|
2225
2322
|
});
|
|
2226
2323
|
|
|
2227
2324
|
if (!layer) {
|
|
2228
|
-
layer = this.
|
|
2325
|
+
layer = this._createOnlineLayer(layerConfig);
|
|
2229
2326
|
layer.name = guid;
|
|
2230
2327
|
layer.target = "online";
|
|
2231
2328
|
}
|
|
2232
2329
|
|
|
2233
|
-
if (layer)
|
|
2330
|
+
if (layer) {
|
|
2331
|
+
if (visible) {
|
|
2332
|
+
layer.show = visible;
|
|
2333
|
+
} else {
|
|
2334
|
+
this._viewer.imageryLayers.remove(layer);
|
|
2335
|
+
}
|
|
2336
|
+
}
|
|
2234
2337
|
}
|
|
2235
2338
|
/**
|
|
2236
2339
|
* 移除所有在线底图在地图中的显示
|
|
@@ -2238,12 +2341,18 @@ class ScenceViewViewModel extends (mitt_default()) {
|
|
|
2238
2341
|
|
|
2239
2342
|
|
|
2240
2343
|
removeAllOnlineBaseLayer() {
|
|
2241
|
-
let imageryLayers = this._viewer.imageryLayers
|
|
2242
|
-
|
|
2344
|
+
let imageryLayers = this._viewer.imageryLayers;
|
|
2345
|
+
let removeLayers = [];
|
|
2346
|
+
|
|
2347
|
+
imageryLayers._layers.forEach(layer => {
|
|
2243
2348
|
if (layer.target === "online") {
|
|
2244
|
-
|
|
2349
|
+
removeLayers.push(layer);
|
|
2245
2350
|
}
|
|
2246
2351
|
});
|
|
2352
|
+
|
|
2353
|
+
removeLayers.forEach(layer => {
|
|
2354
|
+
imageryLayers.remove(layer);
|
|
2355
|
+
});
|
|
2247
2356
|
} //获取三维视角
|
|
2248
2357
|
|
|
2249
2358
|
|
package/shadowanalysis/index.js
CHANGED
|
@@ -294,8 +294,8 @@ class ShadowAnalysisViewModel {
|
|
|
294
294
|
destroy() {
|
|
295
295
|
this.clear(); //移除监听事件
|
|
296
296
|
|
|
297
|
-
this._drawFinishedEventListener && this._drawFinishedEventListener();
|
|
298
|
-
this._drawFinishedEventListener = null;
|
|
297
|
+
this._globaOptions._drawFinishedEventListener && this._globaOptions._drawFinishedEventListener();
|
|
298
|
+
this._globaOptions._drawFinishedEventListener = null;
|
|
299
299
|
}
|
|
300
300
|
|
|
301
301
|
}
|
|
@@ -79,26 +79,39 @@ function _defineProperty(obj, key, value) {
|
|
|
79
79
|
//可视域分析逻辑类
|
|
80
80
|
class ViewshedAnalysisViewModel {
|
|
81
81
|
//可视域分析三维对象
|
|
82
|
+
//三维场景对象
|
|
83
|
+
//可视域分析存储参数对象
|
|
82
84
|
constructor(scenceView, options) {
|
|
83
85
|
_defineProperty(this, "_viewshedAnalysis", null);
|
|
84
86
|
|
|
85
|
-
|
|
86
|
-
scene.globe.depthTestAgainstTerrain = true;
|
|
87
|
+
_defineProperty(this, "_scene", null);
|
|
87
88
|
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
_defineProperty(this, "_options", null);
|
|
90
|
+
|
|
91
|
+
this._scene = scenceView._viewer.scene;
|
|
92
|
+
this._scene.globe.depthTestAgainstTerrain = true;
|
|
93
|
+
this._options = options;
|
|
94
|
+
|
|
95
|
+
if (this._options.visibleColor) {
|
|
96
|
+
this._options.visibleColor = Cesium.Color.fromCssColorString(this._options.visibleColor);
|
|
90
97
|
}
|
|
91
98
|
|
|
92
|
-
if (
|
|
93
|
-
|
|
99
|
+
if (this._options.visibleColor) {
|
|
100
|
+
this._options.invisibleColor = Cesium.Color.fromCssColorString(this._options.invisibleColor);
|
|
94
101
|
}
|
|
95
102
|
|
|
96
|
-
this._viewshedAnalysis = new Cesium.Kq3dViewshedInteractive(
|
|
103
|
+
this._viewshedAnalysis = new Cesium.Kq3dViewshedInteractive(this._scene, this._options);
|
|
97
104
|
} //开始分析
|
|
98
105
|
|
|
99
106
|
|
|
100
107
|
start() {
|
|
101
|
-
|
|
108
|
+
if (this._viewshedAnalysis) {
|
|
109
|
+
this._viewshedAnalysis.start();
|
|
110
|
+
} else {
|
|
111
|
+
this._viewshedAnalysis = new Cesium.Kq3dViewshedInteractive(this._scene, this._options);
|
|
112
|
+
|
|
113
|
+
this._viewshedAnalysis.start();
|
|
114
|
+
} // if (!this._viewshedAnalysis.isRunning()) {
|
|
102
115
|
// // 绘制完成后,需要释放绘制事件
|
|
103
116
|
// }
|
|
104
117
|
|
|
@@ -107,6 +120,8 @@ class ViewshedAnalysisViewModel {
|
|
|
107
120
|
|
|
108
121
|
clear() {
|
|
109
122
|
this._viewshedAnalysis && this._viewshedAnalysis.pause();
|
|
123
|
+
this._viewshedAnalysis && this._viewshedAnalysis.destroy();
|
|
124
|
+
this._viewshedAnalysis = null;
|
|
110
125
|
} //销毁
|
|
111
126
|
|
|
112
127
|
|
|
@@ -118,26 +133,31 @@ class ViewshedAnalysisViewModel {
|
|
|
118
133
|
|
|
119
134
|
|
|
120
135
|
setOffsetHeight(offsetHeight) {
|
|
136
|
+
this._options.offsetHeight = offsetHeight;
|
|
121
137
|
this._viewshedAnalysis.attachedViewshed.offsetHeight = Number(offsetHeight);
|
|
122
138
|
} //设置水平角
|
|
123
139
|
|
|
124
140
|
|
|
125
141
|
setFovH(fovH) {
|
|
142
|
+
this._options.fovH = fovH;
|
|
126
143
|
this._viewshedAnalysis.attachedViewshed.fovH = Number(fovH);
|
|
127
144
|
} //设置竖直角
|
|
128
145
|
|
|
129
146
|
|
|
130
147
|
setFovV(fovV) {
|
|
148
|
+
this._options.fovV = fovV;
|
|
131
149
|
this._viewshedAnalysis.attachedViewshed.fovV = Number(fovV);
|
|
132
150
|
} //设置可视颜色
|
|
133
151
|
|
|
134
152
|
|
|
135
153
|
setVisibleColor(visibleColor) {
|
|
154
|
+
this._options.visibleColor = visibleColor;
|
|
136
155
|
this._viewshedAnalysis.attachedViewshed.visibleColor = Cesium.Color.fromCssColorString(visibleColor);
|
|
137
156
|
} //设置不可视颜色
|
|
138
157
|
|
|
139
158
|
|
|
140
159
|
setInvisibleColor(invisibleColor) {
|
|
160
|
+
this._options.invisibleColor = invisibleColor;
|
|
141
161
|
this._viewshedAnalysis.attachedViewshed.invisibleColor = Cesium.Color.fromCssColorString(invisibleColor);
|
|
142
162
|
} //设置网格线颜色
|
|
143
163
|
|