Skip to main content

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​

ParameterTypeDescription
boundsRNLatLngBoundsTarget bounds the camera should fit. See RNLatLngBounds.
padding?RNMapPaddingPadding around the fitted area. See RNMapPadding.
durationMs?numberAnimation duration in milliseconds.
lockBounds?booleanRestricts 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​

RNLocationPermissionResult

The permission result per platform. See RNLocationPermissionResult.


hideMarkerInfoWindow()​

hideMarkerInfoWindow(id): void;

Hides the info window for a marker.

Parameters​

ParameterTypeDescription
idstringMarker 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​

ParameterTypeDescription
cameraRNCameraUpdateTarget camera update. See RNCameraUpdate.
animated?booleanWhether to animate.
durationMs?numberAnimation 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​

ParameterTypeDescription
bounds?RNLatLngBoundsBounds 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​

ParameterTypeDescription
coordinatesRNLatLng[]Coordinates the camera should fit.
padding?RNMapPaddingPadding around the fitted area. See RNMapPadding.
animated?booleanWhether to animate.
durationMs?numberAnimation 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​

ParameterTypeDescription
idstringMarker identifier.

Returns​

void


snapshot()​

snapshot(options): Promise<string | undefined>;

Captures a snapshot of the current map frame.

Parameters​

ParameterTypeDescription
optionsRNSnapshotOptionsSnapshot output configuration. See RNSnapshotOptions.

Returns​

Promise<string | undefined>

Base64 string or file URI, depending on RNSnapshotOptions.resultType.