Commit 841c0ccd authored by dagal's avatar dagal
Browse files

Change color of context menu stop

parent 2fca8a55
......@@ -40,7 +40,8 @@ let app = new Vue({
end: null
},
stops: [],
stopMarkers: {}
stopMarkers: {},
contextStop: null
},
methods: {
selectStop(s, isEndStop) {
......@@ -130,6 +131,19 @@ let stopLayer = L.geoJSON(null, {
}
}).addTo(map);
map.on("contextmenu.show", (e) => {
if (e.sourceTarget && e.sourceTarget.setStyle) {
app.contextStop = e.sourceTarget.feature;
e.sourceTarget.setStyle({color: "#f00"})
}
});
map.on("contextmenu.hide", (e) => {
if (app.contextStop) {
app.stopMarkers[app.contextStop.properties.id].setStyle({color: "#3388ff"});
//app.contextStop = null;
}
});
getty.jsonGet("/stops").then(function (fc) {
stopLayer.addData(fc);
......
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