Closed brendanvinson closed 7 years ago
Clarification - the top visible layer is interactive and thus displays the proper data - the layers underneath are ignored even if the top visible layer does not have a geometry in that location.
I'm going to guess that you're using the canvas renderer.
The problem is that you can't click through a canvas, only the top most canvas will get mouse events.
You can see http://www.vinylfox.com/forwarding-mouse-events-through-layers/ for a hack around this, but this is not fixable in VectorGrid.
I'm using the SVG renderer, not canvas. I'm also getting a "connection timed out" trying to load that page.
@brendanvinson ok, I think you want this fix: https://github.com/Leaflet/Leaflet.VectorGrid/pull/75 - I don't think it's in a released version, though, which might be why you're still seeing the issue.
That looks promising, any idea when it will be released since it's in master? Failing that I guess I could clone the repo and then bundle everything in master manually and use that.
@perliedman Curious why there are no tags for releases on this project. I can scroll through the package releases and tag them if that was an oversight.
@ddproxy We haven't paid much attention to release tags in this repo, so feel free to do that. See also https://github.com/hypermodules/gh-release , might make things easier.
@IvanSanchez thanks! Looking at gh-release, it seems to be primarily for current release cycles not identifying historical. Something to look into for the future, however.
You should be able to git blame
the package.json file, see which commits did the version bump, then git checkout {commit}
, then gh-release
. Not sure if it's the best way to do past releases.
I cloned the repo and did a local build on master and can confirm that this issue is fixed. Thanks!
Can you tell me how you got it to work? I am using master branches and it still it fails to poss the mouse to lower layers. The workaround/hack I am using is
Array.from(vectorific.getElementsByTagName('svg')).forEach((a)=>{a.style.pointerEvents = 'none'})
Array.from(vectorific.getElementsByTagName('path')).forEach((a)=>{a.style.pointerEvents = 'auto'})
Doesn't work here either. I'm using the canvas rendering. Multiple layers sit on top of each other preventing the ones on the bottom to receive clicks.
@victorbucutea see this comment regarding multiple canvas layers: https://github.com/Leaflet/Leaflet.VectorGrid/issues/88#issuecomment-284350575
We're loading multiple pbf layers as properties of the same map with
{ interactive: true }
set on both. Unfortunately, it seems like the only the one that's added last to the map becomes interactive. Our Leaflet version is 1.0.3.