GoogleMapController class

Controller that drives the native map view via a MethodChannel.

Constructors

GoogleMapController.web(WebMapHost host)

Properties

hashCode int
The hash code for this object.
no setterinherited
onMapLoaded Future<void>
no setter
onMarkerTap Stream<String>
Stream of marker tap events (emits the marker id).
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
viewId int
The platform view id associated with this map instance.
final

Methods

addMarker(MarkerOptions options) Future<void>
Adds a marker with options. Re-adding with same id replaces existing.
addPolyline(PolylineOptions options) Future<void>
Adds a polyline with options. Re-adding with same id replaces existing.
addPolylineFromEncoded(String id, String encoded, {Color color = const Color(0xFF1B5E20), double width = 6}) Future<void>
Adds a polyline by decoding an encoded polyline string.
addTileOverlay(String id, String urlTemplate, {int tileSize = 256, double opacity = 1.0, double zIndex = 0}) Future<void>
Adds a tile overlay from a URL template. Template may contain {z},{x},{y}.
animateCamera(LatLng target, {double? zoom, double? tilt, double? bearing, int? durationMs}) Future<void>
Smoothly animates the camera to target with optional zoom, tilt, bearing and durationMs.
animateToBounds(LatLng northeast, LatLng southwest, {double padding = 50}) Future<void>
Animates the camera to fit northeast and southwest with padding.
clearHeatmap() Future<void>
Removes any active heatmap overlay.
clearMarkers() Future<void>
Removes all markers.
clearPolylines() Future<void>
Removes all polylines.
clearTileOverlays() Future<void>
dispose() Future<void>
Releases native resources for this map instance.
handleWebMapLoaded() → void
handleWebMarkerTap(String markerId) → void
moveCamera(LatLng target, {double? zoom, double? tilt, double? bearing}) Future<void>
Moves the camera to target and optionally sets zoom, tilt and bearing.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeMarker(String id) Future<void>
Removes a marker by id.
removePolyline(String id) Future<void>
Removes a polyline by id.
removeTileOverlay(String id) Future<void>
setClusteringEnabled(bool enabled) Future<void>
Enables/disables clustering (Android/iOS). Should be enabled before adding many markers.
setHeatmap(List<LatLng> points, {int? radius, double? opacity}) Future<void>
Heatmap overlay: sets/updates the heatmap points. Empty list clears.
setIndoorEnabled(bool enabled) Future<void>
Enables or disables indoor maps (iOS/Android).
setIndoorLevelPickerEnabled(bool enabled) Future<void>
Android UI: toggles indoor level picker UI control.
setMapColor(Color color, {bool dark = false}) Future<void>
Applies a single-color style tint. If dark is true, uses darker contrasts.
setMapId(String mapId) Future<void>
Cloud styling: set Map ID (iOS supported at runtime; Android requires at creation and may be ignored).
setMapStyle(String? mapStyleJson) Future<void>
Applies a raw Google Maps JSON style.
setMarkerIconBytes(String id, Uint8List bytes, {double? anchorU, double? anchorV}) Future<void>
Updates the marker icon from raw PNG/JPEG bytes on native platforms. On web, this is currently a no-op.
setMyLocationEnabled(bool enabled) Future<void>
Enables/disables the native my-location layer (requires permissions on Android).
setPadding(MapPadding padding) Future<void>
Sets map padding to avoid overlaying UI elements.
setTrafficEnabled(bool enabled) Future<void>
Enables/disables traffic overlay.
startMarkerBounce(String id, {int durationMs = 700, double height = 20, int repeat = 0}) Future<void>
Starts a bounce animation on a marker. Useful to indicate an active state (e.g. searching for a driver).
startMarkerPulse(String id, {Color color = const Color(0x551976D2), double maxRadiusMeters = 120, int durationMs = 1200, int repeat = 0}) Future<void>
Starts a pulsing halo around the given marker with configurable color. This mimics the search/radar effect shown in ride-hailing apps.
stopMarkerBounce(String id) Future<void>
Stops any active bounce animation on the given marker id.
stopMarkerPulse(String id) Future<void>
Stops the pulsing halo around the marker, if any.
takeSnapshot() Future<Uint8List?>
Captures a PNG snapshot of the current map viewport.
toString() String
A string representation of this object.
inherited
updateMarker(String id, {LatLng? position, double? rotation}) Future<void>
Updates a marker by id. You may change position and/or rotation.
updatePolylinePoints(String id, List<LatLng> points) Future<void>
Updates the points of an existing polyline by id without recreating it.

Operators

operator ==(Object other) bool
The equality operator.
inherited