maplibre-gl-js icon indicating copy to clipboard operation
maplibre-gl-js copied to clipboard

Change marker-visibility logic from coordinate comparison to depth-buffer check

Open prozessor13 opened this issue 3 years ago • 1 comments

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.

prozessor13 avatar Mar 30 '22 13:03 prozessor13

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.

HarelM avatar Apr 07 '22 18:04 HarelM

Assigned S bounty. Link to parent Bounty: https://github.com/maplibre/maplibre/issues/189

HarelM avatar Mar 04 '23 19:03 HarelM

@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.

SnailBones avatar Dec 01 '23 18:12 SnailBones

Yes, all these marker bugs are related to some extent, I believe. Assigning to you.

HarelM avatar Dec 01 '23 18:12 HarelM

https://opencollective.com/maplibre/expenses/176000

SnailBones avatar Dec 06 '23 20:12 SnailBones