20191218
Showing
1 changed file
with
9 additions
and
2 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> |
| ... | @@ -24,16 +24,23 @@ export default { | ... | @@ -24,16 +24,23 @@ export default { |
| 24 | } | 24 | } |
| 25 | }, | 25 | }, |
| 26 | mounted(){ | 26 | mounted(){ |
| 27 | $.ajax({ | ||
| 28 | type: "GET", | ||
| 29 | url: "http://www.zjditu.cn/vtiles/styles/tdt/streets.json", | ||
| 30 | success: function(data){ | ||
| 31 | console.log(data); | ||
| 27 | var map = new mapboxgl.Map({ | 32 | var map = new mapboxgl.Map({ |
| 28 | container: 'map', | 33 | container: 'map', |
| 29 | zoom: 12, | 34 | zoom: 12, |
| 30 | center: [120.15, 30.25], | 35 | center: [120.15, 30.25], |
| 31 | renderWorldCopies: false, | 36 | renderWorldCopies: false, |
| 32 | localIdeographFontFamily: "'黑体','san-serif'", | 37 | localIdeographFontFamily: "'黑体','san-serif'", |
| 33 | style: 'http://www.zjditu.cn/vtiles/styles/tdt/streets.json' | 38 | style: data |
| 34 | }); | 39 | }); |
| 35 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | 40 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); |
| 36 | } | 41 | } |
| 42 | }); | ||
| 43 | } | ||
| 37 | } | 44 | } |
| 38 | </script> | 45 | </script> |
| 39 | 46 | ... | ... |
-
Please register or sign in to post a comment