You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose an enhancement to the iOS SDK’s coordinate-to-screen-point conversion. Currently, the point(for:) function returns (-1, -1) for off-screen coordinates due to the final .fit(to: size) call:
In my use case —with a constant map pitch of 0 and coordinates close to the screen— I need access to the raw pixel values even if the point is off-screen. I suggest either:
Exposing map.pixelForCoordinate directly, or
Adding an alternative function (e.g., unsafePixelForCoordinate) that omits the .fit() transformation, along with clear documentation warning about its potential pitfalls.
Why
This feature is valuable for developing custom overlays, annotations, and animations that require off-screen coordinate calculations. While Mapbox Kotlin SDK developers might use reflection to access hidden methods, this approach is neither desirable nor possible in Swift.
The text was updated successfully, but these errors were encountered:
Ltei
changed the title
point(for coordinate) when coordinate is out of screen
Enable Off-Screen Coordinate Pixel Calculation (Bypass .fit() Transformation)
Feb 21, 2025
New Feature
I propose an enhancement to the iOS SDK’s coordinate-to-screen-point conversion. Currently, the
point(for:)
function returns (-1, -1) for off-screen coordinates due to the final.fit(to: size)
call:In my use case —with a constant map pitch of 0 and coordinates close to the screen— I need access to the raw pixel values even if the point is off-screen. I suggest either:
Why
This feature is valuable for developing custom overlays, annotations, and animations that require off-screen coordinate calculations. While Mapbox Kotlin SDK developers might use reflection to access hidden methods, this approach is neither desirable nor possible in Swift.
The text was updated successfully, but these errors were encountered: