-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Misplaced popup when panning the map #3036
Comments
By default, We have proposed but not implemented a more automatic solution in #2071 |
I cannot find any solution on the issue you linked. Also i've found that this issue applies also to events.. in my case i need to get the coordinates on the click event, and by clicking on a world copy the event return values out of the lat/lng range. So the only workaround for me is to set maxBounds on the map to prevent panning on world copies. |
@WiS3 as a workaround, you could offset your popup like so (assuming a scenario where you're clicking on a marker to show a popup in the same place): const offset = Math.round((event.lngLat.lng - feature.geometry.coordinates[0]) / 360) * 360 |
I have some On click popups attached to geojson points.
I followed the documentation and the implementation is the same, and it's working fine..
But there is an issue:
When i zoom out the map at around 0 i can see the whole earth, if i pan the map i can see the same points at the same Earth coordinates. But the popup does not show up on the clicked point, it show up on the point in the other side (the first one rendered).
I hope you understand the issue, english is not my native and couldn't explain better.
Steps to Trigger Behavior
Expected Behavior
The popup should be positioned on the clicked point
Actual Behavior
The popup doesn't appear on the clicked point, but in the point on the other side.
The text was updated successfully, but these errors were encountered: