openLocationInExternalApp

fun openLocationInExternalApp(latLng: LatLng, zoom: Float, context: Context, label: String? = null): Boolean(source)

Opens a location in an external map application with automatic fallback to browser.

Attempts to open the location using the geo: URI scheme, which is supported by most map applications (Google Maps, OsmAnd, Maps.me, HERE WeGo, Waze, etc.). If no map app is installed, falls back to opening OpenStreetMap.org in the device's browser.

The geo: URI format follows RFC 5870 and Android's common intents specification.

Return

true if intent was successfully launched, false if an error occurred

Parameters

latLng

The geographic coordinates to display

zoom

The zoom level (2.0 to 19.0)

context

Android context for launching intents

label

Optional label/title for the location (shown in some apps as pin title)

See also