maplibre-gl-js
maplibre-gl-js copied to clipboard
Change marker-visibility logic from coordinate comparison to depth-buffer check
In marker.ts the visibility check of a marker is done via:
- get the screen-coordinate of the marker anchor
- get the lnglat-coordinate in terrain for the marker screen-pixel
- check if marker-lnglat & screen-lnglat are equal
- if yes show, else hide the marker
this implementation is from a state before i implemented the depth-framebuffer. So this needs to be changed to the depth-buffer check as well. In my opinion a minor-task.
There's another question here related getBounds - in case of pitch > 60 this might return an area that is way too big, wouldn't it?
Maybe the marker logic can use this method to check for visibility, I.e. If the marker is within the map bounds, if this function is relatively accurate it can be very useful.
Assigned S bounty. Link to parent Bounty: https://github.com/maplibre/maplibre/issues/189
@HarelM I'm interested in this too! Seems very related to https://github.com/maplibre/maplibre-gl-js/issues/2870, I'm hoping the switch can solve that issue.
Yes, all these marker bugs are related to some extent, I believe. Assigning to you.
https://opencollective.com/maplibre/expenses/176000