feat: support camera commands on static maps#87
Merged
Conversation
moveCamera and fitCoordinates now work in static mode. iOS re-renders the base map at the final camera (fitCoordinates derives zoom via a provider-specific inverse of the projection); Android re-centers through the static camera-target shift since lite mode misrenders padding. The iOS snapshot cache keys on the provider's actual camera so command-driven re-renders don't poison initial-camera entries. duration is ignored - static maps don't animate.
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
Static maps previously ignored
moveCameraandfitCoordinates(setEdgeInsetswas already supported via #86). Ref methods now work in static mode like on a live map, minus animation (durationis ignored).moveCameraandfitCoordinatesupdate the static camera and re-render the base map.fitCoordinatesfits the bounds into the viewport minus edge insets minus padding, with asymmetric padding shifting the visible center like edge insets. Zoom is derived per provider via a newzoomForMapPointsPerPoint:hook (Google: pixel-based web mercator; Apple: inverse ofLuggStaticFittedMapRect's span-based fit).moveCamera/fitCoordinatesgo through the static camera-target shift (lite mode misrenderssetPadding), updating the stored camera so latersetEdgeInsetsstays consistent. Mercator math is extracted into shared helpers.Type of Change
Test Plan
yarn tidy(typecheck, eslint, objclint, ktlint) passesmoveCameraandfitCoordinateson a static map in the example app on both platforms, including withedgeInsetsset and with fit paddingScreenshots / Videos
N/A
Checklist
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.