11111111
Showing
4 changed files
with
57 additions
and
50 deletions
... | @@ -73,15 +73,14 @@ export default class flood { | ... | @@ -73,15 +73,14 @@ export default class flood { |
73 | 116.44515353439972, 39.90683243165845, 10, | 73 | 116.44515353439972, 39.90683243165845, 10, |
74 | 116.4437677267605, 39.9069642145195, 10 | 74 | 116.4437677267605, 39.9069642145195, 10 |
75 | ]); | 75 | ]); |
76 | let geometry = new Cesium.PolygonGeometry({ | ||
77 | polygonHierarchy : new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(this.positions2d)), | ||
78 | extrudedHeight: targetHeight, | ||
79 | height: waterHeight, | ||
80 | vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT | ||
81 | }); | ||
76 | this.river = new Cesium.Primitive({ | 82 | this.river = new Cesium.Primitive({ |
77 | geometryInstances : new Cesium.GeometryInstance({ | 83 | geometryInstances : new Cesium.GeometryInstance({geometry}), |
78 | geometry :new Cesium.PolygonGeometry({ | ||
79 | polygonHierarchy : new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(this.positions2d)), | ||
80 | extrudedHeight: targetHeight, | ||
81 | height: waterHeight, | ||
82 | vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT | ||
83 | }) | ||
84 | }), | ||
85 | appearance : new Cesium.EllipsoidSurfaceAppearance({ | 84 | appearance : new Cesium.EllipsoidSurfaceAppearance({ |
86 | aboveGround : true, | 85 | aboveGround : true, |
87 | material: new Cesium.Material({ | 86 | material: new Cesium.Material({ | ... | ... |
1 | <template> | 1 | <template> |
2 | <div> | 2 | <div> |
3 | |||
4 | <div id="arcgisMap"></div> | 3 | <div id="arcgisMap"></div> |
5 | |||
6 | </div> | 4 | </div> |
7 | </template> | 5 | </template> |
8 | <script> | 6 | <script> |
... | @@ -12,42 +10,10 @@ | ... | @@ -12,42 +10,10 @@ |
12 | return {} | 10 | return {} |
13 | }, | 11 | }, |
14 | mounted() { | 12 | mounted() { |
15 | loadModules([ | 13 | |
16 | "esri/Map", | ||
17 | "esri/views/MapView", | ||
18 | "esri/layers/WebTileLayer", | ||
19 | "esri/geometry/Extent", | ||
20 | "dojo/domReady!" | ||
21 | ]).then(([Map, MapView, WebTileLayer, Extent]) => { | ||
22 | this.$parent.mapView = new MapView({ | ||
23 | container: "arcgisMap", | ||
24 | map: new Map({ | ||
25 | basemap: { | ||
26 | baseLayers: [ | ||
27 | new WebTileLayer({ | ||
28 | urlTemplate: "http://mt{subDomain}.google.cn/vt/lyrs=s&hl=zh-CN&gl=CN&x={col}&y={row}&z={level}&s=Gali", | ||
29 | subDomains: ["0", "1", "2"] | ||
30 | }), | ||
31 | new WebTileLayer({ | ||
32 | urlTemplate: "http://mt{subDomain}.google.cn/vt/imgtp=png32&lyrs=h@207000000&hl=zh-CN&gl=cn&x={col}&y={row}&z={level}&s=Galil", | ||
33 | subDomains: ["0", "1", "2"] | ||
34 | }) | ||
35 | ] | ||
36 | } | ||
37 | }), | ||
38 | extent: new Extent({ | ||
39 | xmin: 413417, | ||
40 | ymin: 3715140, | ||
41 | xmax: 665512, | ||
42 | ymax: 3902165, | ||
43 | spatialReference: 4545 | ||
44 | }), | ||
45 | zoom: 5 | ||
46 | }); | ||
47 | }); | ||
48 | }, | 14 | }, |
49 | methods: { | 15 | methods: { |
50 | 16 | ||
51 | } | 17 | } |
52 | } | 18 | } |
53 | </script> | 19 | </script> | ... | ... |
... | @@ -42,7 +42,7 @@ | ... | @@ -42,7 +42,7 @@ |
42 | </div> | 42 | </div> |
43 | <div class="func-input"> | 43 | <div class="func-input"> |
44 | <span>当前水位</span> | 44 | <span>当前水位</span> |
45 | <span style="margin-left: 36px;">1263.7米</span> | 45 | <span style="margin-left: 36px;">{{swsd}}米</span> |
46 | </div> | 46 | </div> |
47 | <div class="func-btn"> | 47 | <div class="func-btn"> |
48 | <div class="btn-wrapper add-bg" @click="startAnalysis"> | 48 | <div class="btn-wrapper add-bg" @click="startAnalysis"> | ... | ... |
1 | <template> | 1 | <template> |
2 | <div class="home"> | 2 | <div class="home" v-loading.fullscreen.lock="isFullscreenLoading"> |
3 | <div class="top"> | 3 | <div class="top"> |
4 | <TopTitle></TopTitle> | 4 | <TopTitle></TopTitle> |
5 | </div> | 5 | </div> |
... | @@ -93,7 +93,8 @@ | ... | @@ -93,7 +93,8 @@ |
93 | 93 | ||
94 | <!-- <threeMap ref="threeMap"></threeMap> | 94 | <!-- <threeMap ref="threeMap"></threeMap> |
95 | <arcgisMap ref="arcgisMap"></arcgisMap> --> | 95 | <arcgisMap ref="arcgisMap"></arcgisMap> --> |
96 | <component :is="map"></component> <!-- 动态组件--> | 96 | <component :is="map" ref="maps"></component> <!-- 动态组件--> |
97 | <div id="arcgisMap" ref="arcgisMap"></div> | ||
97 | 98 | ||
98 | </div> | 99 | </div> |
99 | </template> | 100 | </template> |
... | @@ -178,8 +179,8 @@ | ... | @@ -178,8 +179,8 @@ |
178 | 'area', 'marker', 'rollerShutter', 'splitScreen', 'toNorth', | 179 | 'area', 'marker', 'rollerShutter', 'splitScreen', 'toNorth', |
179 | 'topSee', 'roundSee', 'horizon', 'allSee', 'ymAnslysis', | 180 | 'topSee', 'roundSee', 'horizon', 'allSee', 'ymAnslysis', |
180 | 'tjxAnslysis', 'yyAnslysis', 'visualField', 'kgAnalusis'], | 181 | 'tjxAnslysis', 'yyAnslysis', 'visualField', 'kgAnalusis'], |
181 | |||
182 | addProjectMsg: false, // 建设项目信息表 | 182 | addProjectMsg: false, // 建设项目信息表 |
183 | isFullscreenLoading: false, // 全屏loading | ||
183 | } | 184 | } |
184 | }, | 185 | }, |
185 | mounted() { | 186 | mounted() { |
... | @@ -190,10 +191,51 @@ | ... | @@ -190,10 +191,51 @@ |
190 | this.commons.log(val) | 191 | this.commons.log(val) |
191 | }, | 192 | }, |
192 | is2D(flag) { | 193 | is2D(flag) { |
193 | this.map = flag ? 'arcgisMap' : 'threeMap'; | 194 | this.map = flag ? '' : 'threeMap'; |
195 | this.isFullscreenLoading = true; | ||
196 | loadModules([ | ||
197 | "esri/Map", | ||
198 | "esri/Basemap", | ||
199 | "esri/views/MapView", | ||
200 | "esri/layers/TileLayer", | ||
201 | "esri/layers/WebTileLayer", | ||
202 | "esri/geometry/Extent", | ||
203 | "dojo/domReady!" | ||
204 | ]).then(([Map, Basemap, MapView, TileLayer, WebTileLayer, Extent]) => { | ||
205 | if(!this.mapView) { | ||
206 | this.mapView = new MapView({ | ||
207 | map: new Map({ | ||
208 | basemap: new Basemap({ | ||
209 | baseLayers: [ | ||
210 | new WebTileLayer({ | ||
211 | urlTemplate: "http://mt{subDomain}.google.cn/vt/lyrs=s&hl=zh-CN&gl=CN&x={col}&y={row}&z={level}&s=Gali", | ||
212 | subDomains: ["0", "1", "2"] | ||
213 | }), | ||
214 | new WebTileLayer({ | ||
215 | urlTemplate: "http://mt{subDomain}.google.cn/vt/imgtp=png32&lyrs=h@207000000&hl=zh-CN&gl=cn&x={col}&y={row}&z={level}&s=Galil", | ||
216 | subDomains: ["0", "1", "2"] | ||
217 | }) | ||
218 | ] | ||
219 | }) | ||
220 | }), | ||
221 | container: "arcgisMap", | ||
222 | center: [117.73289858455101, 36.255126757404966], | ||
223 | zoom: 9, | ||
224 | }); | ||
225 | this.mapView.when(() => { | ||
226 | this.isFullscreenLoading = false; | ||
227 | }, function(error){ | ||
228 | console.log("The view's resources failed to load: ", error); | ||
229 | }); | ||
230 | return; | ||
231 | } | ||
232 | this.isFullscreenLoading = false; | ||
233 | this.mapView.destroy(); | ||
234 | this.mapView = undefined; | ||
235 | }); | ||
194 | }, | 236 | }, |
195 | isCamera(flag) { | 237 | isCamera(flag) { |
196 | this.commons.log(flag) | 238 | // this.commons.log(flag) |
197 | }, | 239 | }, |
198 | isLayer(flag) { | 240 | isLayer(flag) { |
199 | this.commons.log(flag) | 241 | this.commons.log(flag) | ... | ... |
-
Please register or sign in to post a comment