I have:
var lines = volLines[name];
where name is the name for a group of polylines, each 'lines' has a marker with "name" displayed where i do this:
.addTo(mymap).on('click', changeMapLineColour);
When I click on a marker that is associated for the group of polylines the lines all change colour. The problem I have is there are many other groups of polylines so sometimes the lines that I have change the colour of are under other groups of polylines so I cannot see all the lines. How do I bring the lines associated with "name" to the front when the lines overlap?
function changeMapLineColour()
{ //other stuff in here, just given basics for this problem.
lines[i].setStyle({
color: "white",
weight: 4
})
}
I found this but I am unsure of how to use it and where to put in cshtml?
actions: {
bringToFront(e) {
e.target.bringToFront();
}
}
{{polyline-layer ... onAdd=(action "bringToFront")}}
Or is there a better way?
Thank you!
created a layer (from an array of lines) like this to then be able to bringToFront()
var layer = lines[i].setStyle({
color: "white",
weight: 4
})
layer.bringToFront();
woohoo!