also looking at this
feat(maps): add key-free native Android maps and shared map controls
#363
28 files
+1857
-481
| @@ -154,7 +154,7 @@ next route. | ||
| 154 | 154 | | `Image` | `UIImageView` | `ImageView` | |
| 155 | 155 | | `ImageBackground` | `CraftNativeImageBackgroundView` | `CraftNativeImageBackgroundView` | |
| 156 | 156 | | `Video` | `CraftNativeVideoView` (`AVPlayerViewController`) | `CraftNativeVideoView` (`VideoView`) | |
| 157 | | `Map` | `CraftNativeMapView` (`MKMapView`) | `CraftNativeMapView` (`GoogleMap`) | | |
| 157 | | `Map` | `CraftNativeMapView` (`MKMapView`) | `CraftNativeMapView` (native MapLibre or Google Maps) | | |
| 158 | 158 | | `MapPolyline`, `MapMarker` | overlays inside `CraftNativeMapView` | overlays inside `CraftNativeMapView` | |
| 159 | 159 | | `Svg` | `CraftNativeSvgView` | `CraftNativeSvgView` | |
| 160 | 160 | | `G`, `SvgText` | drawn inside `CraftNativeSvgView` | drawn inside `CraftNativeSvgView` | |
| @@ -228,12 +228,21 @@ or `fitToBounds`, which recenters only when its overlay geometry changes. Explic | ||
| 228 | 228 | authored camera bounds on both hosts; only `fitToBounds` adds framing padding. A marker's `onPress` or |
| 229 | 229 | `onMarkerPress` receives `nativeEvent.id`; a marker's own handler wins, and the map-level handler is |
| 230 | 230 | used as a fallback when the marker has no non-empty handler. |
| 231 | It is backed by MapKit on iOS and the Google Maps SDK on | |
| 232 | Android; the Android template adds that dependency only for screens that opt | |
| 233 | into the native map host. The shared `mapType` values are `standard`, | |
| 231 | It is backed by MapKit on iOS and the configured native provider on Android. | |
| 232 | Set the Craft Android config's `mapProvider` to `maplibre` for a key-free native | |
| 233 | GL view; `google` preserves the existing Google Maps host. Only the selected | |
| 234 | provider's SDK is included in the generated Android project. These STX map | |
| 235 | components do not use the DOM-based `@craft-native/ts-maps` adapter. | |
| 236 | The shared `mapType` values are `standard`, | |
| 234 | 237 | `satellite`, and `hybrid`; Android's terrain-only style is intentionally not |
| 235 | part of the cross-platform contract. Tile styling, clustering, directions, and | |
| 236 | offline tiles remain outside this contract. Set `showsUserLocation` to opt into the | |
| 238 | part of the cross-platform contract. `tileOverlay` accepts an HTTPS raster URL | |
| 239 | template and its visible provider attribution. `edgePadding` reserves logical | |
| 240 | points around a fitted route for floating controls. `pitchEnabled` controls | |
| 241 | tilt gestures; `cameraPitch` and `cameraHeading` set the camera explicitly. | |
| 242 | Markers accept `pinColor` for trailheads and inspected profile positions, or | |
| 243 | `bearing` for a contrasting route-direction sign. Clustering, turn-by-turn | |
| 244 | directions, and offline tile downloads remain outside this view contract. | |
| 245 | Set `showsUserLocation` to opt into the | |
| 237 | 246 | platform location dot; the host only enables it when the app's existing |
| 238 | 247 | location permission is already granted, and never prompts from a renderer |
| 239 | 248 | pass. Android also forwards `MapView` start/stop lifecycle callbacks as map |