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-geom-point :coordinates="[lon, lat]"></vl-geom-point>
<vl-style-box> <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> </vl-style-box>
</template> </template>
</vl-feature> </vl-feature>

View File

@ -57,7 +57,7 @@ Vue.use(VueLayers);
stationen: [], stationen: [],
}, },
station: {}, station: {},
markercolor: "red", markercolor: "grey",
cameraActive: false, cameraActive: false,
result: null, result: null,
zoom: 15, zoom: 15,
@ -121,8 +121,15 @@ Vue.use(VueLayers);
}, },
getMarkerURL(station) { getMarkerURL(station) {
console.log(station); return `./statics/map-marker_${this.setMarkercolor(station)}.svg`
return `./statics/map-marker_${this.markercolor}.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) { updateResult(event) {