@capacitor/google-maps
Google maps on Capacitor
Install
npm install @capacitor/google-maps
npx cap sync
API Keys
To use the Google Maps SDK on any platform, API keys associated with an account with billing enabled are required. These can be obtained from the Google Cloud Console. This is required for all three platforms, Android, iOS, and Javascript. Additional information about obtaining these API keys can be found in the Google Maps documentation for each platform.
iOS
The Google Maps SDK supports the use of showing the users current location via enableCurrentLocation(bool). To use this, Apple requires privacy descriptions to be specified in Info.plist:
NSLocationWhenInUseUsageDescription(Privacy - Location When In Use Usage Description)
Read about Configuring Info.plist in the iOS Guide for more information on setting iOS permissions in Xcode.
Typescript Configuration
Your project will also need have skipLibCheck set to true in tsconfig.json.
Migrating from older versions
The main Google Maps SDK now supports running on simulators on Apple Silicon Macs, but make sure you have the latest version of Google-Maps-iOS-Utils installed.
If you added the previous workaround for getting the unreleased version, you can delete it now by removing this line from ios/App/Podfile:
pod 'Google-Maps-iOS-Utils', :git => 'https://github.com/googlemaps/google-maps-ios-utils.git', :commit => '637954e5bcb2a879c11a6f2cead153a6bad5339f'
Then run pod update Google-Maps-iOS-Utils from the ios/App/ folder:
cd ios/App
pod update Google-Maps-iOS-Utils