1
votes

I am creating a MapBox project with a geoJson vector layer. I have been using the following example as my guide.

https://www.mapbox.com/blog/neighborhood-mapping-with-dynamic-vector-data-layers/

When I hover over any geoJson feature the stroke is changed to 2 pixels. However the stroke gets clipped by the neighboring features sometimes. I believe this has something to do with how the different features are stacked. So if I hover on a feature which is stacked near the bottom the neighboring features are covering that stroke.

Here is an example... http://www.vandam.com/chpc/inconsistent_stroke.jpg

Is their a way to set the stroke to be inside of the polygon or a way to bring a feature to the top of the stack when hovering?

Thanks for any help!

1

1 Answers

1
votes

By adding the function

layer.bringtoFront();

after setting the hover styling your polygons will come to front.