11111111
Showing
1 changed file
with
60 additions
and
0 deletions
src/components/arcgisMap.vue
0 → 100644
1 | <template> | ||
2 | <div> | ||
3 | |||
4 | <div id="arcgisMap"></div> | ||
5 | |||
6 | </div> | ||
7 | </template> | ||
8 | <script> | ||
9 | import { loadModules } from "esri-loader"; | ||
10 | export default { | ||
11 | data() { | ||
12 | return {} | ||
13 | }, | ||
14 | mounted() { | ||
15 | loadModules([ | ||
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 | }, | ||
49 | methods: { | ||
50 | |||
51 | } | ||
52 | } | ||
53 | </script> | ||
54 | |||
55 | <style> | ||
56 | #arcgisMap { | ||
57 | width: 100%; | ||
58 | height: 100%; | ||
59 | } | ||
60 | </style> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or sign in to post a comment