feat(mapview): add staticMode prop for static maps in lists#85
Open
lodev09 wants to merge 5 commits into
Open
Conversation
drawMapRect: runs on MapKit's background render queues; snapshot polyline/distances/colors so main-thread updates can't cause out-of-bounds reads or use-after-free of the color cache
- reset static content on staticKey change (prevents stale/poisoned snapshot cache with in-place list recycling) - re-arm snapshot swap on zero-size capture instead of giving up - bound snapshot cache by memory; include camera in cache key - reset recycled wrapper placeholder styling - web: disable POI clicks, keyboard, and press handlers in staticMode
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
Adds a
staticModeprop toMapViewfor rendering non-interactive static maps, optimized for list views where mounting many live maps is expensive.GoogleMapOptions.liteMode), rendering a static bitmap instead of a live GL surface. Lite mode toolbar disabled.mapViewDidFinishRenderingMap:/mapViewSnapshotReady:), the live map is swapped with a snapshot image and torn down, releasing Metal/GL resources per instance. Swap is deferred if the view is off-window; map stays live if rendering never completes (e.g. offline).gestureHandling: 'none'.staticModeis creation-time only. On iOS, camera commands and prop updates are no-ops after the snapshot swap.Example: new
StaticMapsScreen(shared) renders a FlatList of pressable place cards with static maps + markers, with an Apple/Google provider toggle. Wired into bare (StaticMapsroute) and expo (/static-maps), reachable via a "Static Maps" button in the control sheet.Type of Change
Test Plan
yarn typecheck,yarn test,yarn lint, ktlint, objclint passScreenshots / Videos
N/A
Checklist
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.