Leaflet.VectorGrid icon indicating copy to clipboard operation
Leaflet.VectorGrid copied to clipboard

Highlight feature and bring to front

Open RGregat opened this issue 6 years ago • 4 comments

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.

map-export

Is it possible to put the highlighted feature to the front, or just create a copy of the feature?

RGregat avatar Oct 19 '18 15:10 RGregat

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.

mngyng avatar Dec 14 '18 06:12 mngyng

Is this fixed? I am facing the same issue.

revatim avatar Jul 26 '19 11:07 revatim

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.

mngyng avatar Jul 29 '19 00:07 mngyng

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

Bioflori avatar Nov 30 '21 14:11 Bioflori