Interface: RNGoogleMapsPlusViewMethods
Imperative Google Maps methods. Direct calls into native Google Maps SDK.
Extends
HybridViewMethods
Methods
animateToBounds()
animateToBounds(
bounds,
padding?,
durationMs?,
lockBounds?
): void;
Animates the camera to fit the given bounds.
iOS: adds an explicit animation phase for parity. Android: uses native timing.
Parameters
| Parameter | Type | Description |
|---|---|---|
bounds | RNLatLngBounds | Target bounds the camera should fit. See RNLatLngBounds. |
padding? | RNMapPadding | Padding around the fitted area. See RNMapPadding. |
durationMs? | number | Animation duration in milliseconds. |
lockBounds? | boolean | Restricts the camera to these bounds after animating. |
Returns
void
Default Value
3000
Default Value
false
clearMarkerIconCache()
clearMarkerIconCache(): void;
Clears the rendered marker icon cache.
Already-rendered markers keep their current icon and are NOT re-rendered. Renders that are already running continue and repopulate the emptied cache on completion. The cache only affects future renders: the next time a marker's icon is requested with a style hash that is no longer cached, it is rendered from source instead of served from cache. Use to reclaim memory.
Returns
void
getLocationPermission()
getLocationPermission(): RNLocationPermissionResult;
Returns the current location permission without prompting.
Returns
The permission result per platform. See RNLocationPermissionResult.
hideMarkerInfoWindow()
hideMarkerInfoWindow(id): void;
Hides the info window for a marker.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Marker identifier. |
Returns
void
isGooglePlayServicesAvailable()
isGooglePlayServicesAvailable(): boolean;
Checks Google Play Services availability.
iOS: always returns false.
Android: performs a real system check.
Returns false for outdated, disabled or updating Play Services.
The map view is still created, so the Maps SDK can show its own error UI.
Returns
boolean
true if Google Play Services are available, otherwise false.
openLocationSettings()
openLocationSettings(): void;
Opens the OS location settings.
iOS: opens the app settings. Android: opens system location settings.
Returns
void
requestLocationPermission()
requestLocationPermission(): Promise<RNLocationPermissionResult>;
Requests runtime location permission.
Returns
Promise<RNLocationPermissionResult>
The permission result per platform. See RNLocationPermissionResult.
setCamera()
setCamera(
camera,
animated?,
durationMs?
): void;
Sets the camera.
iOS: adds an explicit animation phase for parity. Android: uses native timing.
Parameters
| Parameter | Type | Description |
|---|---|---|
camera | RNCameraUpdate | Target camera update. See RNCameraUpdate. |
animated? | boolean | Whether to animate. |
durationMs? | number | Animation duration in milliseconds. |
Returns
void
Default Value
false
Default Value
3000
setCameraBounds()
setCameraBounds(bounds?): void;
Restricts the camera target bounds.
Pass undefined to clear the restriction.
Parameters
| Parameter | Type | Description |
|---|---|---|
bounds? | RNLatLngBounds | Bounds to restrict the camera target to. See RNLatLngBounds. |
Returns
void
setCameraToCoordinates()
setCameraToCoordinates(
coordinates,
padding?,
animated?,
durationMs?
): void;
Fits the camera to the given coordinates.
iOS: adds an explicit animation phase for parity. Android: uses native timing.
Parameters
| Parameter | Type | Description |
|---|---|---|
coordinates | RNLatLng[] | Coordinates the camera should fit. |
padding? | RNMapPadding | Padding around the fitted area. See RNMapPadding. |
animated? | boolean | Whether to animate. |
durationMs? | number | Animation duration in milliseconds. |
Returns
void
Default Value
false
Default Value
3000
showLocationDialog()
showLocationDialog(): void;
Shows a native system dialog prompting the user to enable location services.
Returns
void
showMarkerInfoWindow()
showMarkerInfoWindow(id): void;
Shows the info window for a marker.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Marker identifier. |
Returns
void
snapshot()
snapshot(options): Promise<string | undefined>;
Captures a snapshot of the current map frame.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | RNSnapshotOptions | Snapshot output configuration. See RNSnapshotOptions. |
Returns
Promise<string | undefined>
Base64 string or file URI, depending on RNSnapshotOptions.resultType.