React Native react-native-maps Mapview does not show up
You forgot to add styles
to the MapView
:
<MapView style={styles.map} initialRegion={{ latitude: 37.78825, longitude: -122.4324, latitudeDelta: 0.0922, longitudeDelta: 0.0421, }}/>
Don't forget to define your styles:
const styles = StyleSheet.create({ map: { ...StyleSheet.absoluteFillObject, },});
Because for the mapView to work, you need to set the style of the MapView to an absolute position with top, left, right and bottom values set. As stated in the repo
Go to the Google Cloud Platform Console. https://cloud.google.com/console/google/maps-apis/overview
Select your project with dropdown in top navigation bar.
Click on Menu and go to "APIs & Services" > "Library"
Activate "Maps SDK for Android" and "Maps SDK for iOS".
Then create new API key and add it to your project in
AndroidManifest.xml
inside<application>
tag:
<meta-data android:name="com.google.android.geo.API_KEY" android:value="YOUR_ANDROID_KEY"/>