20191218
Showing
1 changed file
with
17 additions
and
10 deletions
... | @@ -2,7 +2,7 @@ | ... | @@ -2,7 +2,7 @@ |
2 | * @Author: jiangbotao | 2 | * @Author: jiangbotao |
3 | * @Date: 2019-12-18 00:23:47 | 3 | * @Date: 2019-12-18 00:23:47 |
4 | * @LastEditors: jiangbotao | 4 | * @LastEditors: jiangbotao |
5 | * @LastEditTime: 2019-12-18 01:38:13 | 5 | * @LastEditTime: 2019-12-18 01:43:58 |
6 | * @FilePath: \supermapvue\src\components\layers\Map_mapbox.vue | 6 | * @FilePath: \supermapvue\src\components\layers\Map_mapbox.vue |
7 | --> | 7 | --> |
8 | <template> | 8 | <template> |
... | @@ -23,16 +23,23 @@ export default { | ... | @@ -23,16 +23,23 @@ export default { |
23 | 23 | ||
24 | } | 24 | } |
25 | }, | 25 | }, |
26 | mounted(){ | 26 | mounted(){ |
27 | var map = new mapboxgl.Map({ | 27 | $.ajax({ |
28 | container: 'map', | 28 | type: "GET", |
29 | zoom: 12, | 29 | url: "http://www.zjditu.cn/vtiles/styles/tdt/streets.json", |
30 | center: [120.15, 30.25], | 30 | success: function(data){ |
31 | renderWorldCopies: false, | 31 | console.log(data); |
32 | localIdeographFontFamily: "'黑体','san-serif'", | 32 | var map = new mapboxgl.Map({ |
33 | style: 'http://www.zjditu.cn/vtiles/styles/tdt/streets.json' | 33 | container: 'map', |
34 | zoom: 12, | ||
35 | center: [120.15, 30.25], | ||
36 | renderWorldCopies: false, | ||
37 | localIdeographFontFamily: "'黑体','san-serif'", | ||
38 | style: data | ||
39 | }); | ||
40 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
41 | } | ||
34 | }); | 42 | }); |
35 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
36 | } | 43 | } |
37 | } | 44 | } |
38 | </script> | 45 | </script> | ... | ... |
-
Please register or sign in to post a comment