CacheStart map shows marker for startstation again

This commit is contained in:
Katharina Will 2019-06-06 12:53:42 +02:00
parent 96d3a3836d
commit 5626c52537
2 changed files with 11 additions and 4 deletions

View File

@ -9,7 +9,7 @@
<vl-geom-point :coordinates="[lon, lat]"></vl-geom-point>
<vl-style-box>
<vl-style-icon src="./statics/map-marker.svg" :scale="2.0" :anchor="[0.5, 1]"></vl-style-icon>
<vl-style-icon src="./statics/map-marker_red.svg" :scale="2.0" :anchor="[0.5, 1]"></vl-style-icon>
</vl-style-box>
</template>
</vl-feature>

View File

@ -57,7 +57,7 @@ Vue.use(VueLayers);
stationen: [],
},
station: {},
markercolor: "red",
markercolor: "grey",
cameraActive: false,
result: null,
zoom: 15,
@ -121,8 +121,15 @@ Vue.use(VueLayers);
},
getMarkerURL(station) {
console.log(station);
return `./statics/map-marker_${this.markercolor}.svg`
return `./statics/map-marker_${this.setMarkercolor(station)}.svg`
},
setMarkercolor(station){
if(this.station === cache.stationen.find(station => station.id === Number(this.$route.params.id))) {
this.markercolor = "red";
} else if (this.station) {
this.markercolor = "grey";
}
return this.markercolor
},
updateResult(event) {