-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use shadow transform for all pointer events #2329
base: master
Are you sure you want to change the base?
Conversation
I also see this problem and tried this pull request against 7.2.0-beta.1 (using maplibre). It seems to work better with mouse events. However, markers (and 3d overlay layers as well) still jump around erratically. I think this makes react-map-gl currently unusable when having terrain and markers. Which is a pity since there is this nice plugin react-three-map. Using maplibre 4.0.1 standalone (without react-map-gl), none of the problems occur: movement in heavy terrain is stable, markers and 3d overlay layers as well. It's possibly a hard-to-find, small fix in the transform sync (and maybe maplibre behaves differently than mapbox). Any idea? |
Hi Kai I agree, the issue makes this library unusable with terrain and markers/clicking. I'll have another look at this issue myself. I'm also wondering it |
I've been looking at this again, and I'm very sure what's happening is that after terrain source data is loaded, the mapbox transformation info changes to include this, and react-map-gl isn't updating it's shadow copy. I've tried adding the following into the this does run multiple times as mapbox does keep loading more terrain data, but it does seem to fix most the problems. However, I noticed that camera jumps up and down when after moving over areas with terrain. I tracked that down to There's also various that seem to switch out the transform ( |
Thank you for looking into this. The handling of terrain has been rather frustrating and, as you can see, still problematic after several hacks into the internals of Mapbox. I have a write up here about why all these are needed. In the near future I'm going to split out the wrapper for MapLibre since they now have a callback to support the reactive use case. So at least we don't have to think too much about compatibility. |
@Pessimistress has published an early alpha of this new wrapper at https://github.com/visgl/react-maplibre |
Mouse events seem to be returning locations without elevation. This handled for _queryRenderedFeatures, but other pointer events return the wrong location.
#2248