20191218
Showing
8 changed files
with
67 additions
and
27 deletions
1 | <!-- | 1 | <!-- |
2 | * @Author: jiangbotao | 2 | * @Author: jiangbotao |
3 | * @Date: 2019-12-09 23:17:48 | 3 | * @Date: 2019-12-09 23:17:48 |
4 | * @LastEditors: jiangbotao | 4 | * @LastEditors : jiangbotao |
5 | * @LastEditTime: 2019-12-16 00:56:05 | 5 | * @LastEditTime : 2019-12-18 19:27:37 |
6 | * @FilePath: \mymapbox\src\components\Map3857.vue | 6 | * @FilePath: \mymapbox\src\components\Map3857.vue |
7 | --> | 7 | --> |
8 | <template> | 8 | <template> |
... | @@ -12,10 +12,7 @@ | ... | @@ -12,10 +12,7 @@ |
12 | </template> | 12 | </template> |
13 | 13 | ||
14 | <script> | 14 | <script> |
15 | import Vue from 'vue' | 15 | import { notification } from 'ant-design-vue'; |
16 | import { message } from'ant-design-vue'; | ||
17 | Vue.use(message) | ||
18 | |||
19 | import mapboxgl from 'mapbox-gl'; | 16 | import mapboxgl from 'mapbox-gl'; |
20 | import { Logo, MeasureService } from '@supermap/iclient-mapboxgl'; | 17 | import { Logo, MeasureService } from '@supermap/iclient-mapboxgl'; |
21 | 18 | ||
... | @@ -73,14 +70,18 @@ export default { | ... | @@ -73,14 +70,18 @@ export default { |
73 | new MeasureService(url).measureDistance(param, function (serviceResult) { | 70 | new MeasureService(url).measureDistance(param, function (serviceResult) { |
74 | var distance = serviceResult.result.distance; | 71 | var distance = serviceResult.result.distance; |
75 | var unit = serviceResult.result.unit; | 72 | var unit = serviceResult.result.unit; |
76 | message.info('当前长度: '+ distance+" "+unit); | 73 | notification.warning({ |
74 | message: '当前长度: '+ distance+" "+unit | ||
75 | }); | ||
77 | }); | 76 | }); |
78 | }else{ | 77 | }else{ |
79 | new MeasureService(url).measureArea(param, function (serviceResult) { | 78 | new MeasureService(url).measureArea(param, function (serviceResult) { |
80 | var area = serviceResult.result.area; | 79 | var area = serviceResult.result.area; |
81 | var unit = serviceResult.result.unit; | 80 | var unit = serviceResult.result.unit; |
82 | var rounded_area = Math.round(area * 100) / 100; | 81 | var rounded_area = Math.round(area * 100) / 100; |
83 | message.info('当前面积: '+ rounded_area+" 平方"+unit); | 82 | notification.warning({ |
83 | message: '当前面积: '+ rounded_area+" 平方"+unit | ||
84 | }); | ||
84 | }); | 85 | }); |
85 | } | 86 | } |
86 | } | 87 | } | ... | ... |
1 | <!-- | 1 | <!-- |
2 | * @Author: jiangbotao | 2 | * @Author: jiangbotao |
3 | * @Date: 2019-12-09 23:17:48 | 3 | * @Date: 2019-12-09 23:17:48 |
4 | * @LastEditors: jiangbotao | 4 | * @LastEditors : jiangbotao |
5 | * @LastEditTime: 2019-12-16 01:29:01 | 5 | * @LastEditTime : 2019-12-18 19:29:18 |
6 | * @FilePath: \mymapbox\src\components\Map3857.vue | 6 | * @FilePath: \mymapbox\src\components\Map3857.vue |
7 | --> | 7 | --> |
8 | <template> | 8 | <template> |
9 | <div > | 9 | <div > |
10 | <div id="map"></div> | 10 | <div id="map"></div> |
11 | <a-card title="业务图层操作" :bordered="false" style="width: 320px"> | 11 | <div id="btnGroup"> |
12 | <p> | 12 | <a-button-group size="large"> |
13 | <a-button v-on:click="addLayer">加载图层</a-button> | 13 | <a-button type="primary" v-on:click="addLayer">加载图层</a-button> |
14 | <a-button v-on:click="clearLayer">隐藏图层</a-button> | 14 | <a-button type="primary" v-on:click="clearLayer">隐藏图层</a-button> |
15 | <a-button v-on:click="showLayer">展示图层</a-button> | 15 | <a-button type="primary" v-on:click="showLayer">展示图层</a-button> |
16 | </p> | 16 | </a-button-group> |
17 | </a-card> | 17 | </div> |
18 | </div> | 18 | </div> |
19 | </template> | 19 | </template> |
20 | 20 | ||
... | @@ -141,10 +141,7 @@ export default { | ... | @@ -141,10 +141,7 @@ export default { |
141 | width: 100%; | 141 | width: 100%; |
142 | background-color: white | 142 | background-color: white |
143 | } | 143 | } |
144 | .ant-card { | 144 | #btnGroup { |
145 | width: 320px; | ||
146 | height: 120px; | ||
147 | background-color: #e6f7ff; | ||
148 | right: 5px; | 145 | right: 5px; |
149 | position: absolute; | 146 | position: absolute; |
150 | top: 5px; | 147 | top: 5px; | ... | ... |
1 | <!-- | 1 | <!-- |
2 | * @Author: jiangbotao | 2 | * @Author: jiangbotao |
3 | * @Date: 2019-12-09 23:17:48 | 3 | * @Date: 2019-12-09 23:17:48 |
4 | * @LastEditors: jiangbotao | 4 | * @LastEditors : jiangbotao |
5 | * @LastEditTime: 2019-12-15 12:36:14 | 5 | * @LastEditTime : 2019-12-18 19:39:20 |
6 | * @FilePath: \mymapbox\src\components\Map3857.vue | 6 | * @FilePath: \mymapbox\src\components\Map3857.vue |
7 | --> | 7 | --> |
8 | <template> | 8 | <template> |
... | @@ -36,6 +36,14 @@ export default { | ... | @@ -36,6 +36,14 @@ export default { |
36 | "type": "raster", | 36 | "type": "raster", |
37 | "tiles": [host + '/iserver/services/map-china400/rest/maps/China/zxyTileImage.png?z={z}&x={x}&y={y}'], | 37 | "tiles": [host + '/iserver/services/map-china400/rest/maps/China/zxyTileImage.png?z={z}&x={x}&y={y}'], |
38 | "tileSize": 256 | 38 | "tileSize": 256 |
39 | }, | ||
40 | 'china_boundary': { | ||
41 | "type": "geojson", | ||
42 | "data": "./static/china.json" | ||
43 | }, | ||
44 | 'wz_boundary': { | ||
45 | "type": "geojson", | ||
46 | "data": "./static/330300_full.json" | ||
39 | } | 47 | } |
40 | }, | 48 | }, |
41 | "layers": [{ | 49 | "layers": [{ |
... | @@ -44,10 +52,45 @@ export default { | ... | @@ -44,10 +52,45 @@ export default { |
44 | "source": "raster-tiles", | 52 | "source": "raster-tiles", |
45 | "minzoom": 0, | 53 | "minzoom": 0, |
46 | "maxzoom": 22 | 54 | "maxzoom": 22 |
55 | },{ | ||
56 | "id": "cn_boundary", | ||
57 | "type": "fill", | ||
58 | "source": "china_boundary", | ||
59 | 'paint': { | ||
60 | 'fill-color': '#081a45', | ||
61 | 'fill-outline-color': 'rgba(200, 100, 240, 1)', | ||
62 | 'fill-opacity': 0.9 | ||
63 | }, | ||
64 | "minzoom": 7, | ||
65 | "maxzoom": 22 | ||
66 | },{ | ||
67 | "id": "wz_boundary", | ||
68 | "type": "fill", | ||
69 | "source": "wz_boundary", | ||
70 | 'paint': { | ||
71 | 'fill-color': '#1e3e77', | ||
72 | 'fill-outline-color': 'rgba(200, 100, 240, 1)', | ||
73 | 'fill-opacity': 0.2 | ||
74 | }, | ||
75 | "minzoom": 7, | ||
76 | "maxzoom": 22 | ||
77 | },{ | ||
78 | 'id': 'wz_boundary_line', | ||
79 | 'type': 'line', | ||
80 | "source": "wz_boundary", | ||
81 | 'layout': { | ||
82 | 'line-cap': 'round', | ||
83 | 'line-join': 'round' | ||
84 | }, | ||
85 | 'paint': { | ||
86 | 'line-color': '#3e9ad3', | ||
87 | 'line-dasharray': [0.2, 2], | ||
88 | 'line-width': 2 | ||
89 | } | ||
47 | }] | 90 | }] |
48 | }, | 91 | }, |
49 | center: [110.143, 30.236], // starting position | 92 | center: [120.70211, 27.67169], // starting position |
50 | zoom: 3 // starting zoom | 93 | zoom: 8 // starting zoom |
51 | }); | 94 | }); |
52 | map.addControl(new Logo(), 'bottom-right'); | 95 | map.addControl(new Logo(), 'bottom-right'); |
53 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | 96 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ... | ... |
... | @@ -6,7 +6,7 @@ | ... | @@ -6,7 +6,7 @@ |
6 | * @FilePath: \supermapvue\src\main.js | 6 | * @FilePath: \supermapvue\src\main.js |
7 | */ | 7 | */ |
8 | import Vue from 'vue' | 8 | import Vue from 'vue' |
9 | import { Layout, Menu, Icon, Card, Button } from 'ant-design-vue' | 9 | import { Layout, Menu, Icon, Button } from 'ant-design-vue' |
10 | import App from './App' | 10 | import App from './App' |
11 | import router from './router' | 11 | import router from './router' |
12 | // import 'ant-design-vue/dist/antd.css' | 12 | // import 'ant-design-vue/dist/antd.css' |
... | @@ -17,7 +17,6 @@ Vue.config.productionTip = false | ... | @@ -17,7 +17,6 @@ Vue.config.productionTip = false |
17 | Vue.use(Layout) | 17 | Vue.use(Layout) |
18 | Vue.use(Menu) | 18 | Vue.use(Menu) |
19 | Vue.use(Icon) | 19 | Vue.use(Icon) |
20 | Vue.use(Card) | ||
21 | Vue.use(Button) | 20 | Vue.use(Button) |
22 | 21 | ||
23 | /* eslint-disable no-new */ | 22 | /* eslint-disable no-new */ | ... | ... |
static/100000_full.json
0 → 100644
This diff could not be displayed because it is too large.
static/330000_full.json
0 → 100644
This diff could not be displayed because it is too large.
static/330300_full.json
0 → 100644
This diff could not be displayed because it is too large.
static/china.json
0 → 100644
This diff is collapsed.
Click to expand it.
-
Please register or sign in to post a comment