Installation
Install @lugg/maps and configure your Google Maps API keys.
Install the package
npm install @lugg/mapsApple Maps works out of the box on iOS. Google Maps requires an API key on every platform. Create keys in the Google Cloud Console with the Maps SDK for iOS, Maps SDK for Android, and Maps JavaScript API enabled.
Configure API keys
Add the config plugin to your app.json:
{
"expo": {
"plugins": [
[
"@lugg/maps",
{
"iosGoogleMapsApiKey": "YOUR_IOS_API_KEY",
"androidGoogleMapsApiKey": "YOUR_ANDROID_API_KEY"
}
]
]
}
}Then rebuild your native project:
npx expo prebuild --cleanApple Maps only
If you only use Apple Maps on iOS, set iosGoogleMapsEnabled to false to exclude the Google Maps SDK:
[
"@lugg/maps",
{
"iosGoogleMapsEnabled": false,
"androidGoogleMapsApiKey": "YOUR_ANDROID_API_KEY"
}
]The plugin ignores iosGoogleMapsApiKey and removes the Google Maps initialization from AppDelegate.swift.
After changing this option, run npx expo prebuild --platform ios and rebuild your app.
To enable Google Maps again, set iosGoogleMapsEnabled to true and provide iosGoogleMapsApiKey.
With the SDK excluded, a MapView requesting provider="google" falls back to Apple Maps and logs a warning.
This library uses the New Architecture (Fabric). Make sure it is enabled in your project. It is on by default in React Native 0.76+ and Expo SDK 52+.