also looking at this
feat(maps): add key-free native Android maps and shared map controls
#363
28 files
+1857
-481
| @@ -147,18 +147,28 @@ craft android build --native-bundle ../native-screen.js | ||
| 147 | 147 | Native mode maps STX `View`, `SafeAreaView`, `KeyboardAvoidingView`, `StatusBar`, |
| 148 | 148 | `RefreshControl`, `Text`, `Button`, `Link`, `Icon`, |
| 149 | 149 | `Pressable`, `TouchableOpacity`, `TouchableHighlight`, `Checkbox`, `TextInput`, `Picker`, `DatePicker`, `Modal`, `Switch`, `Slider`, `ActivityIndicator`, `Image`, `ImageBackground`, `Video`, `Svg`, `G`, `SvgText`, `ScrollView`, |
| 150 | `Map`, `SectionList`, and `FlatList` to Android views. `Map` uses the Google | |
| 151 | Maps SDK for trail polylines and marker taps; its overlays carry flat | |
| 150 | `Map`, `SectionList`, and `FlatList` to Android views. `Map` uses the configured | |
| 151 | native map provider for trail polylines and marker taps; its overlays carry flat | |
| 152 | 152 | latitude/longitude `geometry` arrays, `strokeWidth` is expressed in logical |
| 153 | 153 | points, and the camera supports controlled `region`, one-time `initialRegion`, |
| 154 | and `fitToBounds`. Set `mapsApiKey` in the Android config to emit the SDK manifest key; | |
| 154 | and `fitToBounds`. Select `mapProvider: 'maplibre'` for the key-free native | |
| 155 | MapLibre renderer. It uses native GL views and needs neither a Google map SDK | |
| 156 | dependency nor a Google map key. `mapProvider: 'google'` retains the existing | |
| 157 | Google Maps host and uses `mapsApiKey` for its SDK manifest key; Google remains | |
| 158 | the default for compatibility with existing projects. | |
| 159 | ||
| 155 | 160 | Coordinates must be JSON numbers (numeric strings are not coerced), are |
| 156 | 161 | range-checked at the native boundary, and invalid points or pole-crossing |
| 157 | 162 | regions are ignored. `fitToBounds` waits for the map viewport to |
| 158 | 163 | be measured before caching a successful camera fit, so an early map callback |
| 159 | 164 | does not lose the initial route framing. |
| 160 | without it, the native map remains an explicit opt-in integration that needs | |
| 161 | the app's own Maps credentials. `SectionList` uses the same | |
| 165 | The shared controls include `showsCompass`, `showsScale`, `pitchEnabled`, | |
| 166 | `cameraPitch`, `cameraHeading`, and floating-control `edgePadding`. Markers | |
| 167 | accept `pinColor` and route-direction `bearing`. The builder's | |
| 168 | `nativeMapProviders` export advertises the providers it actually implements, | |
| 169 | so a build orchestrator can refuse an unsupported explicit choice. | |
| 170 | ||
| 171 | `SectionList` uses the same | |
| 162 | 172 | native scroll host for ordinary `.stx` slot children; grouped section data |
| 163 | 173 | should use `FlatList` until the section-data protocol is available. The |
| 164 | 174 | generated host routes both list names through `CraftNativeScrollView` for this |