Upgrading from 1.x
React Native
react-native 0.87.0 and react-native-nitro-modules 0.37.2 or newer are required.
Props
initialProps is now mapOptions on GoogleMapsView and panoramaOptions
on GoogleMapsStreetView. The types RNInitialProps and
RNStreetViewInitialProps are now RNMapOptions and RNPanoramaOptions.
The type RNKMLayer is now RNKmlLayer. onMyLocationButtonPress is
called without arguments, the pressed argument was always true.
Methods
animateToBounds takes the padding as RNMapPadding, like
setCameraToCoordinates. Android now treats it as logical units instead of
pixels, and iOS now applies durationMs.
On Android, setCameraToCoordinates adds its padding to mapPadding like iOS
does, instead of replacing it while the camera moves.
Location updates
Location updates used to run for every view. They are off by default now.
Set locationConfig={{ enabled: true }} if you use the location callbacks
without myLocationEnabled.
Android reports an unknown bearing and speed as -1 instead of 0.
iOS
The native dependencies are Swift packages now and SVGKit is no longer used.
Install the pods as frameworks, see
iOS Setup, and remove the svgkit patch
from your Podfile. The script no longer ships with the package and
pod install fails on the missing require:
require_relative '../node_modules/react-native-google-maps-plus/scripts/svgkit_patch'
apply_svgkit_patch(installer)
Expo: the config plugin sets ios.useFrameworks and removes the patch it
generated before.
Android
android-maps-utils 7.x needs Kotlin 2.3.0 or newer in the app, see
Android Setup. Expo: set kotlinVersion
through expo-build-properties, see Expo Setup.
SVG rendering
iconSvg and infoWindowIconSvg are rendered by lunasvg instead of
androidsvg and SVGKit. An SVG can look different than before, check your
markers:
dominant-baselineis applied. Manualyoffsets that compensated for it shift the text now.<image>withoutwidthandheightis drawn at the size of the image. Set both to scale it.- Raster images in
<image>are not resampled smoothly. Provide them in device resolution.
See SVG markers and Limitations.