Integrate Google Maps provider: update map components to use Google Maps, add API key configuration in app.json, and ensure consistent map rendering across screens.

This commit is contained in:
bobbert committed 2026-04-09 09:01:08 +01:00
1 parent 4a5cc716db
commit 07f2e1c03d
4 files changed
+15

No files matched your search

+11
View File
@@ -16,6 +16,9 @@
"supportsTablet": true, "supportsTablet": true,
"infoPlist": { "infoPlist": {
"NSLocationWhenInUseUsageDescription": "This app needs your location for the treasure hunt." "NSLocationWhenInUseUsageDescription": "This app needs your location for the treasure hunt."
},
"config": {
"googleMapsApiKey": "AIzaSyA-G0tSzzcM5z6HyI23s8dzKDLCOrekhbw"
} }
}, },
"android": { "android": {
@@ -41,6 +44,14 @@
"eas": { "eas": {
"projectId": "c65a2849-f05d-48ef-9e36-950caa214a7d" "projectId": "c65a2849-f05d-48ef-9e36-950caa214a7d"
} }
},
"plugins": [
[
"react-native-maps",
{
"googleMapsApiKey": "AIzaSyA-G0tSzzcM5z6HyI23s8dzKDLCOrekhbw"
} }
]
]
} }
} }
+1
View File
@@ -18,6 +18,7 @@ const PlayerMapView = ({userLocation, visibleCaches, heading, claimDistance}) =>
return ( return (
<MapView <MapView
style={{flex: 1}} style={{flex: 1}}
provider="google"
initialRegion={{...userLocation, latitudeDelta: 0.01, longitudeDelta: 0.01}} initialRegion={{...userLocation, latitudeDelta: 0.01, longitudeDelta: 0.01}}
scrollEnabled={true} scrollEnabled={true}
zoomEnabled={true} zoomEnabled={true}
@@ -82,6 +82,7 @@ const ExpandedMapScreen = ({route}) => {
<View style={styles.mapWrap}> <View style={styles.mapWrap}>
<MapView <MapView
style={{flex: 1}} style={{flex: 1}}
provider="google"
initialRegion={region} initialRegion={region}
showsUserLocation showsUserLocation
> >
+2
View File
@@ -342,6 +342,7 @@ const MapScreen = ({navigation}) => {
<View style={styles.mapWrap}> <View style={styles.mapWrap}>
<MapView <MapView
style={{flex: 1}} style={{flex: 1}}
provider="google"
initialRegion={newCoord ? {...newCoord, latitudeDelta: 0.01, longitudeDelta: 0.01} : mapRegion} initialRegion={newCoord ? {...newCoord, latitudeDelta: 0.01, longitudeDelta: 0.01} : mapRegion}
scrollEnabled={true} scrollEnabled={true}
zoomEnabled={true} zoomEnabled={true}
@@ -443,6 +444,7 @@ const MapScreen = ({navigation}) => {
<View style={styles.mapContainer}> <View style={styles.mapContainer}>
<MapView <MapView
style={{flex: 1}} style={{flex: 1}}
provider="google"
initialRegion={mapRegion} initialRegion={mapRegion}
scrollEnabled={true} scrollEnabled={true}
zoomEnabled={true} zoomEnabled={true}