20191218
Showing
3 changed files
with
19 additions
and
25 deletions
1 | /* | 1 | /* |
2 | * @Author: jiangbotao | 2 | * @Author: jiangbotao |
3 | * @Date: 2019-12-12 17:39:25 | 3 | * @Date: 2019-12-12 17:39:25 |
4 | * @LastEditors: jiangbotao | 4 | * @LastEditors : jiangbotao |
5 | * @LastEditTime: 2019-12-13 01:27:49 | 5 | * @LastEditTime : 2019-12-18 22:30:01 |
6 | * @FilePath: \supermapvue\config\index.js | 6 | * @FilePath: \supermapvue\config\index.js |
7 | */ | 7 | */ |
8 | 'use strict' | 8 | 'use strict' |
... | @@ -18,11 +18,11 @@ module.exports = { | ... | @@ -18,11 +18,11 @@ module.exports = { |
18 | assetsSubDirectory: 'static', | 18 | assetsSubDirectory: 'static', |
19 | assetsPublicPath: '/', | 19 | assetsPublicPath: '/', |
20 | proxyTable: { | 20 | proxyTable: { |
21 | // '/api':{ | 21 | // '/zj':{ |
22 | // target: 'http://support.supermap.com.cn:8090', //源地址 | 22 | // target: 'http://www.zjditu.cn', //源地址 |
23 | // changeOrigin: true, //改变源 | 23 | // changeOrigin: true, //改变源 |
24 | // pathRewrite: { | 24 | // pathRewrite: { |
25 | // '^/api': 'http://support.supermap.com.cn:8090' //路径重写 | 25 | // '^/zj': 'http://127.0.0.1:7000' //路径重写 |
26 | // } | 26 | // } |
27 | // } | 27 | // } |
28 | }, | 28 | }, | ... | ... |
... | @@ -24,15 +24,15 @@ export default { | ... | @@ -24,15 +24,15 @@ export default { |
24 | } | 24 | } |
25 | }, | 25 | }, |
26 | mounted(){ | 26 | mounted(){ |
27 | $.ajax({ | 27 | // $.ajax({ |
28 | type: "GET", | 28 | // type: "GET", |
29 | url: "http://www.zjditu.cn/vtiles/styles/tdt/streets.json", | 29 | // url: "/api/vtiles/styles/tdt/streets.json", |
30 | type: 'get', | 30 | // type: 'get', |
31 | dataType: 'json', // 请求方式为jsonp | 31 | // dataType: 'json', // 请求方式为jsonp |
32 | crossDomain: true, | 32 | // crossDomain: true, |
33 | success: function(data){ | 33 | // success: function(data){ |
34 | console.log(data); | 34 | // console.log(data); |
35 | // var mapboxgl_style = 'http://www.zjditu.cn/vtiles/styles/tdt/dark.json'; | 35 | var mapboxgl_style = 'zj/vtiles/styles/tdt/dark.json'; |
36 | var map = new mapboxgl.Map({ | 36 | var map = new mapboxgl.Map({ |
37 | container: 'map', | 37 | container: 'map', |
38 | zoom: 12, | 38 | zoom: 12, |
... | @@ -41,13 +41,7 @@ export default { | ... | @@ -41,13 +41,7 @@ export default { |
41 | localIdeographFontFamily: "'黑体','san-serif'", | 41 | localIdeographFontFamily: "'黑体','san-serif'", |
42 | pitch: 50, | 42 | pitch: 50, |
43 | bearing: -10, | 43 | bearing: -10, |
44 | style: { | 44 | style: mapboxgl_style, |
45 | "version": data.version, | ||
46 | "sources": data.sources, | ||
47 | "sprite": data.sprite, | ||
48 | "glyphs": data.glyphs, | ||
49 | "layers": data.layers | ||
50 | }, | ||
51 | shading: 'realistic', | 45 | shading: 'realistic', |
52 | light: { | 46 | light: { |
53 | main: { | 47 | main: { |
... | @@ -66,8 +60,8 @@ export default { | ... | @@ -66,8 +60,8 @@ export default { |
66 | zlevel: 1 | 60 | zlevel: 1 |
67 | }); | 61 | }); |
68 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | 62 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); |
69 | } | 63 | // } |
70 | }); | 64 | // }); |
71 | } | 65 | } |
72 | } | 66 | } |
73 | </script> | 67 | </script> | ... | ... |
1 | <!-- | 1 | <!-- |
2 | * @Author: jiangbotao | 2 | * @Author: jiangbotao |
3 | * @Date: 2019-12-13 23:53:57 | 3 | * @Date: 2019-12-13 23:53:57 |
4 | * @LastEditors: jiangbotao | 4 | * @LastEditors : jiangbotao |
5 | * @LastEditTime: 2019-12-18 01:35:19 | 5 | * @LastEditTime : 2019-12-18 22:32:19 |
6 | * @FilePath: \supermapvue\src\components\menu\MyMenu.vue | 6 | * @FilePath: \supermapvue\src\components\menu\MyMenu.vue |
7 | --> | 7 | --> |
8 | <template> | 8 | <template> | ... | ... |
-
Please register or sign in to post a comment