MethodChannelGoogleMapsFlutter class
An implementation of GoogleMapsFlutterPlatform that uses MethodChannel to communicate with the native code.
The google_maps_flutter
plugin code itself never talks to the native code directly. It delegates
all those calls to an instance of a class that extends the GoogleMapsFlutterPlatform.
The architecture above allows for platforms that communicate differently with the native side (like web) to have a common interface to extend.
This is the instance that runs when the native side talks to your Flutter app through MethodChannels, like the Android and iOS platforms.
- Inheritance
-
- Object
- PlatformInterface
- GoogleMapsFlutterPlatform
- MethodChannelGoogleMapsFlutter
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- useAndroidViewSurface ↔ bool
-
Set GoogleMapsFlutterPlatform to use AndroidViewSurface to build the Google Maps widget.
getter/setter pair
Methods
-
animateCamera(
CameraUpdate cameraUpdate, {required int mapId}) → Future< void> -
Starts an animated change of the map camera position.
override
-
buildView(
int creationId, PlatformViewCreatedCallback onPlatformViewCreated, {required CameraPosition initialCameraPosition, Set< Marker> markers = const <Marker>{}, Set<Polygon> polygons = const <Polygon>{}, Set<Polyline> polylines = const <Polyline>{}, Set<Circle> circles = const <Circle>{}, Set<TileOverlay> tileOverlays = const <TileOverlay>{}, Set<ClusterManager> clusterManagers = const <ClusterManager>{}, Set<Factory< ? gestureRecognizers, Map<OneSequenceGestureRecognizer> >String, dynamic> mapOptions = const <String, dynamic>{}}) → Widget -
Returns a widget displaying the map view.
override
-
buildViewWithConfiguration(
int creationId, PlatformViewCreatedCallback onPlatformViewCreated, {required MapWidgetConfiguration widgetConfiguration, MapConfiguration mapConfiguration = const MapConfiguration(), MapObjects mapObjects = const MapObjects()}) → Widget -
Returns a widget displaying the map view.
override
-
buildViewWithTextDirection(
int creationId, PlatformViewCreatedCallback onPlatformViewCreated, {required CameraPosition initialCameraPosition, required TextDirection textDirection, Set< Marker> markers = const <Marker>{}, Set<Polygon> polygons = const <Polygon>{}, Set<Polyline> polylines = const <Polyline>{}, Set<Circle> circles = const <Circle>{}, Set<TileOverlay> tileOverlays = const <TileOverlay>{}, Set<ClusterManager> clusterManagers = const <ClusterManager>{}, Set<Factory< ? gestureRecognizers, Map<OneSequenceGestureRecognizer> >String, dynamic> mapOptions = const <String, dynamic>{}}) → Widget -
Returns a widget displaying the map view.
override
-
channel(
int mapId) → MethodChannel - Accesses the MethodChannel associated to the passed mapId.
-
clearTileCache(
TileOverlayId tileOverlayId, {required int mapId}) → Future< void> -
Clears the tile cache so that all tiles will be requested again from the
TileProvider.
override
-
dispose(
{required int mapId}) → void -
Dispose of whatever resources the
mapId
is holding on to.override -
enableDebugInspection(
) → void -
Populates
GoogleMapsFlutterInspectorPlatform.instance
to allow inspecting the platform map state.inherited -
ensureChannelInitialized(
int mapId) → MethodChannel -
Returns the channel for
mapId
, creating it if it doesn't already exist. -
getLatLng(
ScreenCoordinate screenCoordinate, {required int mapId}) → Future< LatLng> -
Returns LatLng corresponding to the ScreenCoordinate in the current map view.
override
-
getScreenCoordinate(
LatLng latLng, {required int mapId}) → Future< ScreenCoordinate> -
Return ScreenCoordinate of the LatLng in the current map view.
override
-
getStyleError(
{required int mapId}) → Future< String?> -
If the last attempt to set the style via MapConfiguration.style failed,
returns the error information, otherwise returns null.
inherited
-
getVisibleRegion(
{required int mapId}) → Future< LatLngBounds> -
Return the region that is visible in a map.
override
-
getZoomLevel(
{required int mapId}) → Future< double> -
Returns the current zoom level of the map.
override
-
hideMarkerInfoWindow(
MarkerId markerId, {required int mapId}) → Future< void> -
Programmatically hide the Info Window for a Marker.
override
-
init(
int mapId) → Future< void> -
/// Initializes the platform interface with
id
.override -
isMarkerInfoWindowShown(
MarkerId markerId, {required int mapId}) → Future< bool> -
Returns
true
when the InfoWindow is showing,false
otherwise.override -
moveCamera(
CameraUpdate cameraUpdate, {required int mapId}) → Future< void> -
Changes the map camera position.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onCameraIdle(
{required int mapId}) → Stream< CameraIdleEvent> -
The Camera is now idle.
override
-
onCameraMove(
{required int mapId}) → Stream< CameraMoveEvent> -
The Camera finished moving to a new CameraPosition.
override
-
onCameraMoveStarted(
{required int mapId}) → Stream< CameraMoveStartedEvent> -
The Camera started moving.
override
-
onCircleTap(
{required int mapId}) → Stream< CircleTapEvent> -
A Circle has been tapped.
override
-
onClusterTap(
{required int mapId}) → Stream< ClusterTapEvent> -
A marker icon managed by ClusterManager has been tapped.
override
-
onInfoWindowTap(
{required int mapId}) → Stream< InfoWindowTapEvent> -
An InfoWindow has been tapped.
override
-
onLongPress(
{required int mapId}) → Stream< MapLongPressEvent> -
A Map has been long-pressed at a certain LatLng.
override
-
onMarkerDrag(
{required int mapId}) → Stream< MarkerDragEvent> -
A Marker has been dragged to a different LatLng position.
override
-
onMarkerDragEnd(
{required int mapId}) → Stream< MarkerDragEndEvent> -
A Marker has been dragged to a different LatLng position.
override
-
onMarkerDragStart(
{required int mapId}) → Stream< MarkerDragStartEvent> -
A Marker has been dragged to a different LatLng position.
override
-
onMarkerTap(
{required int mapId}) → Stream< MarkerTapEvent> -
A Marker has been tapped.
override
-
onPolygonTap(
{required int mapId}) → Stream< PolygonTapEvent> -
A Polygon has been tapped.
override
-
onPolylineTap(
{required int mapId}) → Stream< PolylineTapEvent> -
A Polyline has been tapped.
override
-
onTap(
{required int mapId}) → Stream< MapTapEvent> -
A Map has been tapped at a certain LatLng.
override
-
setMapStyle(
String? mapStyle, {required int mapId}) → Future< void> -
Sets the styling of the base map.
override
-
showMarkerInfoWindow(
MarkerId markerId, {required int mapId}) → Future< void> -
Programmatically show the Info Window for a Marker.
override
-
takeSnapshot(
{required int mapId}) → Future< Uint8List?> -
Returns the image bytes of the map.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
updateCircles(
CircleUpdates circleUpdates, {required int mapId}) → Future< void> -
Updates circle configuration.
override
-
updateClusterManagers(
ClusterManagerUpdates clusterManagerUpdates, {required int mapId}) → Future< void> -
Updates cluster manager configuration.
override
-
updateHeatmaps(
HeatmapUpdates heatmapUpdates, {required int mapId}) → Future< void> -
Updates heatmap configuration.
override
-
updateMapConfiguration(
MapConfiguration configuration, {required int mapId}) → Future< void> -
Updates configuration options of the map user interface.
inherited
-
updateMapOptions(
Map< String, dynamic> optionsUpdate, {required int mapId}) → Future<void> -
Updates configuration options of the map user interface.
override
-
updateMarkers(
MarkerUpdates markerUpdates, {required int mapId}) → Future< void> -
Updates marker configuration.
override
-
updatePolygons(
PolygonUpdates polygonUpdates, {required int mapId}) → Future< void> -
Updates polygon configuration.
override
-
updatePolylines(
PolylineUpdates polylineUpdates, {required int mapId}) → Future< void> -
Updates polyline configuration.
override
-
updateTileOverlays(
{required Set< TileOverlay> newTileOverlays, required int mapId}) → Future<void> -
Updates tile overlay configuration.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited