行政区导航
Showing
1 changed file
with
75 additions
and
1 deletions
... | @@ -98,6 +98,8 @@ export default { | ... | @@ -98,6 +98,8 @@ export default { |
98 | zIndex: 1 | 98 | zIndex: 1 |
99 | } | 99 | } |
100 | ], | 100 | ], |
101 | // https://browser.events.data.msn.cn/OneCollector/1.0?cors=true&content-type=application/x-json-stream&client-id=NO_AUTH&client-version=1DS-Web-JS-3.2.8&apikey=0ded60c75e44443aa3484c42c1c43fe8-9fc57d3f-fdac-4bcf-b927-75eafe60192e-7279&upload-time=1721963639720&ext.intweb.msfpc=GUID%3D58b4a27ccded4df0ae2279c0d4670f38%26HASH%3D58b4%26LV%3D202407%26V%3D4%26LU%3D1721616447966&time-delta-to-apply-millis=use-collector-delta&w=0&anoncknm=app_anon&NoResponseBody=true | ||
102 | |||
101 | zoom: 12, | 103 | zoom: 12, |
102 | minZoom: 4, | 104 | minZoom: 4, |
103 | maxZoom: 20, | 105 | maxZoom: 20, |
... | @@ -124,7 +126,8 @@ export default { | ... | @@ -124,7 +126,8 @@ export default { |
124 | secondFeatures: [], | 126 | secondFeatures: [], |
125 | thirdFeatures: [], | 127 | thirdFeatures: [], |
126 | map: null, | 128 | map: null, |
127 | geoJsonLayer: null | 129 | geoJsonLayer: null, |
130 | echartsLayer: null | ||
128 | } | 131 | } |
129 | }, | 132 | }, |
130 | mounted() { | 133 | mounted() { |
... | @@ -181,11 +184,82 @@ export default { | ... | @@ -181,11 +184,82 @@ export default { |
181 | thirdDistrictNavigate(districtCode, feature) { | 184 | thirdDistrictNavigate(districtCode, feature) { |
182 | if (districtCode) { | 185 | if (districtCode) { |
183 | this.geoJsonLayer.clear() | 186 | this.geoJsonLayer.clear() |
187 | // eslint-disable-next-line no-debugger | ||
184 | this.geoJsonLayer.load({ | 188 | this.geoJsonLayer.load({ |
185 | data: feature, | 189 | data: feature, |
186 | flyTo: true | 190 | flyTo: true |
187 | }) | 191 | }) |
192 | this.showEchartsLayer(feature.properties.center, feature.properties.centroid) | ||
193 | } | ||
194 | }, | ||
195 | showEchartsLayer(center, centroid) { | ||
196 | if (this.echartsLayer) { | ||
197 | this.map.removeLayer(this.echartsLayer) | ||
198 | delete this.echartsLayer | ||
199 | } | ||
200 | const options = { | ||
201 | name: '饼状图测试', | ||
202 | tooltip: { | ||
203 | trigger: 'item', | ||
204 | formatter: function (param) { | ||
205 | return param.seriesName + '<br/>' + param.name + '<br/>长度' + param.value + 'km<br/>占比' + param.percent.toFixed(0) + '%' | ||
206 | } | ||
207 | }, | ||
208 | series: [ | ||
209 | { | ||
210 | name: '1', | ||
211 | type: 'pie', | ||
212 | radius: '7%', | ||
213 | animationDuration: 0, | ||
214 | coordinateSystem: 'mars2dMap', | ||
215 | center: center, | ||
216 | label: { | ||
217 | show: false | ||
218 | }, | ||
219 | labelLine: { | ||
220 | show: false | ||
221 | }, | ||
222 | data: [ | ||
223 | {value: 1, name: '县道'}, | ||
224 | {value: 3, name: '国道'}, | ||
225 | {value: 4, name: '高速'}, | ||
226 | {value: 5, name: '铁路'} | ||
227 | ] | ||
228 | }, | ||
229 | { | ||
230 | name: 'Access From', | ||
231 | type: 'pie', | ||
232 | radius: ['7%', '2%'], | ||
233 | avoidLabelOverlap: false, | ||
234 | coordinateSystem: 'mars2dMap', | ||
235 | center: centroid, | ||
236 | label: { | ||
237 | show: false, | ||
238 | position: 'center' | ||
239 | }, | ||
240 | emphasis: { | ||
241 | label: { | ||
242 | show: true, | ||
243 | fontSize: 8, | ||
244 | fontWeight: 'bold' | ||
245 | } | ||
246 | }, | ||
247 | labelLine: { | ||
248 | show: false | ||
249 | }, | ||
250 | data: [ | ||
251 | {value: 1048, name: 'Search Engine'}, | ||
252 | {value: 735, name: 'Direct'}, | ||
253 | {value: 580, name: 'Email'}, | ||
254 | {value: 484, name: 'Union Ads'}, | ||
255 | {value: 300, name: 'Video Ads'} | ||
256 | ] | ||
188 | } | 257 | } |
258 | ] | ||
259 | }; | ||
260 | // 创建Echarts图层 | ||
261 | this.echartsLayer = new i2d.Layer.EchartsLayer(options) | ||
262 | this.map.addLayer(this.echartsLayer, true) | ||
189 | } | 263 | } |
190 | } | 264 | } |
191 | } | 265 | } | ... | ... |
-
Please register or sign in to post a comment