fix: anchor geocoder pin icon at bottom tip (#2401)#3320
Open
pierreeurope wants to merge 1 commit intokeplergl:masterfrom
Open
fix: anchor geocoder pin icon at bottom tip (#2401)#3320pierreeurope wants to merge 1 commit intokeplergl:masterfrom
pierreeurope wants to merge 1 commit intokeplergl:masterfrom
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
flatterIconPositionsinsrc/layers/src/icon-layer/icon-layer.tsto 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.