Browse Source

修改污染源样式

jiexi1_1
YF-yuan 3 years ago
parent
commit
b15d624214
1 changed files with 11 additions and 7 deletions
  1. +11
    -7
      src/views/Home.vue

+ 11
- 7
src/views/Home.vue View File

<ul id="landmark" v-if="isPlace"> <ul id="landmark" v-if="isPlace">
<li class="landItem" v-for="(item, index) in landuseList" :key="index"> <li class="landItem" v-for="(item, index) in landuseList" :key="index">
<span class="landName">{{ item.lc }}</span> <span class="landName">{{ item.lc }}</span>
<span class="landcolor" :style="{ background: item.color }"></span>
<span class="landcolor" :style="{background: item.color}"></span>
<!-- <span class="landcolor" :style="{border: '2px solid' +item.color}"></span> -->
</li> </li>
</ul> </ul>




let styleFunction = this.landColor.map((item) => { let styleFunction = this.landColor.map((item) => {
let style = new Style({ let style = new Style({
stroke: new Stroke({
color: item[1],
width: 3
}),
// stroke: new Stroke({
// color: item[1],
// width: 3
// }),
// fill: new Fill({
// color: 'rgba(0,0,0,0)'
// })
fill: new Fill({ fill: new Fill({
color: 'rgba(0,0,0,0)'
color: item[1]
}) })
}); });
return [item[0], style]; return [item[0], style];


this.place = new VectorLayer({ this.place = new VectorLayer({
source: vector, source: vector,
// opacity: 0.5,
opacity: 0.6,
style: (feature) => { style: (feature) => {
let lc = feature.getProperties().lc; let lc = feature.getProperties().lc;
return styleFunction.get(lc); return styleFunction.get(lc);

Loading…
Cancel
Save