Leaflet.VectorGrid
Leaflet.VectorGrid copied to clipboard
Highlight feature and bring to front
Hi, I have one question regarding the highlighting of a feature. Currently I have the problem, that parts of a geometry are overlapped by other geometries. That means, that parts of the highlighted feature are not visible.
Is it possible to put the highlighted feature to the front, or just create a copy of the feature?
Do you have a composite layer, like, having a country border outside of the states border and published them as one vector tile layer? If so, I'm guessing this is a similar issue with #167. Tell me if that sounds promising. I have a yet-to-polish workaround codes for that matter.
Is this fixed? I am facing the same issue.
Is this fixed? I am facing the same issue. Well I posted a workaround in #167, not sure if that solves your problem. If you're asking for a fix in a latest version of VectorGrid, I don't think they fixed the problem so far.
I have a suggestion for a simple bugfix:
editing to the function setFeatureStyle
in https://github.com/Leaflet/Leaflet.VectorGrid/blob/master/src/Leaflet.VectorGrid.js by adding the line
feature.feature.bringToFront();
right after
this._updateStyles(feature.feature, tile, styleOptions);
should fix the problem.
UPDATE: I created a pull request Fix issue 185