Skip to content

fix: anchor geocoder pin icon at bottom tip (#2401)#3320

Open
pierreeurope wants to merge 1 commit intokeplergl:masterfrom
pierreeurope:fix/geocoder-pin-anchor-2401
Open

fix: anchor geocoder pin icon at bottom tip (#2401)#3320
pierreeurope wants to merge 1 commit intokeplergl:masterfrom
pierreeurope:fix/geocoder-pin-anchor-2401

Conversation

@pierreeurope
Copy link
Copy Markdown
Contributor

Summary

Fixes #2401

The geocoder search pin (and similar pin-like icons like 'place' and 'pin') had its anchor point at the center of the icon instead of the bottom tip. This caused the pin to visually appear offset from the actual geographic location it was highlighting.

Changes

Modified flatterIconPositions in src/layers/src/icon-layer/icon-layer.ts to shift the geometry of pin-like icons so that the bottom tip is at the origin (y=0). This ensures the pin tip points at the actual location on the map.

Only affects icons with IDs 'place' and 'pin' — all other icons remain centered as before.

Before/After

Before: The center of the pin icon is placed at the geographic coordinate, so the tip appears below the actual location.

After: The bottom tip of the pin icon is placed at the geographic coordinate, correctly indicating the location.

The geocoder search pin (and similar pin-like icons) had its anchor
point at the center of the icon instead of the bottom tip. This caused
the pin to appear offset from the actual geographic location.

Shift the geometry of pin-like icons (place, pin) so that the bottom
tip is at the origin (y=0), ensuring the pin tip points at the actual
location on the map.

Signed-off-by: pierreeurope <pierre.europe@pm.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Geocoder pin should place location at the bottom

1 participant