Commit 99b44087 authored by 范加坤's avatar 范加坤

底图qiepian

parent 0cd7699c
...@@ -82,13 +82,19 @@ export default { ...@@ -82,13 +82,19 @@ export default {
addProvinceLayer() { addProvinceLayer() {
this.$api.data.getProvinceData().then(res => { this.$api.data.getProvinceData().then(res => {
this.map.addSource('province', { this.map.addSource('province', {
type: 'geojson', // type: 'geojson',
data: res.data // data: res.data
tiles: [
'http://39.104.87.15/api/tileset/agnps_sjwj/{z}/{x}/{y}.vector.pbf'
],
type: 'vector'
// "http://39.104.87.15/api/tileset/agnps_sjwj/{z}/{x}/{y}.vector.pbf"
}) })
this.map.addLayer({ this.map.addLayer({
id: 'province', id: 'province',
source: 'province', source: 'province',
type: 'fill', type: 'fill',
'source-layer': 'province',
layout: {}, layout: {},
paint: { paint: {
'fill-outline-color': '#fff', 'fill-outline-color': '#fff',
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
:value="leftObj.zj_capacity" :value="leftObj.zj_capacity"
></PartWrap> ></PartWrap>
</div> </div>
<Lengend class="legend-part" :colors="colors" :range="colorLabel"/> <Lengend class="legend-part" :colors="colors" :range="colorLabel" />
<div class="right-part"> <div class="right-part">
<PartWrap class="bottom-part-echart" :title="'年末累计(处)'"> <PartWrap class="bottom-part-echart" :title="'年末累计(处)'">
<div style="width: 13vw; height: 38vh"> <div style="width: 13vw; height: 38vh">
...@@ -156,11 +156,11 @@ export default { ...@@ -156,11 +156,11 @@ export default {
map: '', map: '',
// legendRange:[], // legendRange:[],
colors: [ colors: [
'rgb(75,250,2)', 'rgb(67, 134, 78)',
'blue', 'rgb(178, 222, 145)',
'rgb(229,246,0)', 'rgb(223, 238, 175)',
'rgb(252,114,0)', 'rgb(245, 255, 163)',
'rgb(238,76,0)', 'rgb(240, 145, 98)',
'rgb(245,1,0)' 'rgb(245,1,0)'
], ],
colorLabel: [], colorLabel: [],
...@@ -505,17 +505,10 @@ export default { ...@@ -505,17 +505,10 @@ export default {
this.colorLabel = range this.colorLabel = range
let a = [ let a = [
'match', 'match',
['get', 'province_c'] ['get', 'code']
// 1,
// 'rgb(0,255,81)',
// 2,
// '#F9E32B',
// 3,
// '#FB3941',
// 'rgb(0,255,81)'
] ]
data.forEach(item => { data.forEach(item => {
a.push(Number(item.pcode)) a.push(item.pcode)
a.push(this.getColorOfProvince(Number(item[this.statusValue1.key]))) a.push(this.getColorOfProvince(Number(item[this.statusValue1.key])))
}) })
console.log(a) console.log(a)
...@@ -759,7 +752,7 @@ export default { ...@@ -759,7 +752,7 @@ export default {
flex: 1; flex: 1;
} }
} }
.legend-part{ .legend-part {
position: absolute; position: absolute;
z-index: 11; z-index: 11;
left: 300px; left: 300px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment