### PinConfig Examples Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/PinConfig-class.html Examples demonstrating how to use PinConfig to customize marker pins with different colors and glyphs. ```APIDOC ## Examples ```dart // Example 1: Changing default pin colors PinConfig( backgroundColor: Colors.blue, borderColor: Colors.white, glyph: CircleGlyph(color: Colors.blue) ) // Example 2: Customizing with text glyph PinConfig( backgroundColor: Colors.blue, glyph: TextGlyph(text: 'Pin', textColor: Colors.white) ) // Example 3: Customizing with a custom image glyph PinConfig( glyph: BitmapGlyph( bitmap: BitmapDescriptor.asset( ImageConfiguration(size: Size(12, 12)), 'assets/cat.png' ) ) ``` ``` -------------------------------- ### BytesMapBitmap Usage Examples Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/BytesMapBitmap-class.html Demonstrates creating BytesMapBitmap with different configurations. ```APIDOC ## Example 1: Basic Usage ```dart Uint8List byteData = imageBuffer.asUint8List(); double imagePixelRatio = 2.0; // Pixel density of the image. BytesMapBitmap bytesMapBitmap = BytesMapBitmap( byteData, imagePixelRatio: imagePixelRatio, ); ``` ## Example 2: Specifying Width ```dart Uint8List byteData = imageBuffer.asUint8List(); BytesMapBitmap bytesMapBitmap = BytesMapBitmap( byteData, width: 64, // Desired width in logical pixels. ); ``` ## Example 3: Using Device Pixel Ratio ```dart Uint8List byteData = imageBuffer.asUint8List(); BytesMapBitmap bytesMapBitmap = BytesMapBitmap( byteData, imagePixelRatio: MediaQuery.maybeDevicePixelRatioOf(context), ); ``` ``` -------------------------------- ### GroundOverlay.fromPosition Example Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/GroundOverlay/GroundOverlay.fromPosition.html Use this constructor to create a GroundOverlay at a specific latitude and longitude. Ensure you have the necessary context and image asset configured. ```dart GroundOverlay.fromPosition( groundOverlayId: const GroundOverlayId('overlay_id'), image: await AssetMapBitmap.create( createLocalImageConfiguration(context), 'assets/images/ground_overlay.png', bitmapScaling: MapBitmapScaling.none, ), position: LatLng(37.42, -122.08), width: 100, height: 100, zoomLevel: 14, ); ``` -------------------------------- ### onCameraMoveStarted Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/GoogleMap-class.html Called when the camera starts moving. ```APIDOC ## onCameraMoveStarted ### Description Called when the camera starts moving. ### Type VoidCallback? ### Access final ``` -------------------------------- ### GoogleMap Constructor Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/GoogleMap/GoogleMap.html Creates a widget displaying data from Google Maps services. The map's camera will start centered on initialCameraPosition. ```APIDOC ## GoogleMap Constructor Creates a widget displaying data from Google Maps services. The map's camera will start centered on `initialCameraPosition`. ### Parameters - **key** (Key?) - Optional - - **initialCameraPosition** (required CameraPosition) - Required - The initial position of the map's camera. - **style** (String?) - Optional - Custom map styling. - **onMapCreated** (MapCreatedCallback?) - Optional - Callback when the map is created. - **gestureRecognizers** (Set>) - Optional - Recognizers for gestures on the map. - **webGestureHandling** (WebGestureHandling?) - Optional - Gesture handling for web platforms. - **webCameraControlPosition** (WebCameraControlPosition?) - Optional - Camera control position for web platforms. - **webCameraControlEnabled** (bool) - Optional - Enables camera control on web platforms (default: true). - **compassEnabled** (bool) - Optional - Enables the compass (default: true). - **mapToolbarEnabled** (bool) - Optional - Enables the map toolbar (default: true). - **cameraTargetBounds** (CameraTargetBounds) - Optional - Bounds for the camera target (default: CameraTargetBounds.unbounded). - **mapType** (MapType) - Optional - The type of map tiles to display (default: MapType.normal). - **minMaxZoomPreference** (MinMaxZoomPreference) - Optional - Minimum and maximum zoom levels (default: MinMaxZoomPreference.unbounded). - **rotateGesturesEnabled** (bool) - Optional - Enables rotation gestures (default: true). - **scrollGesturesEnabled** (bool) - Optional - Enables scroll gestures (default: true). - **zoomControlsEnabled** (bool) - Optional - Enables zoom controls (default: true). - **zoomGesturesEnabled** (bool) - Optional - Enables zoom gestures (default: true). - **liteModeEnabled** (bool) - Optional - Enables lite mode (default: false). - **tiltGesturesEnabled** (bool) - Optional - Enables tilt gestures (default: true). - **fortyFiveDegreeImageryEnabled** (bool) - Optional - Enables 45-degree imagery (default: false). - **myLocationEnabled** (bool) - Optional - Enables the my-location layer (default: false). - **myLocationButtonEnabled** (bool) - Optional - Enables the my-location button (default: true). - **layoutDirection** (TextDirection?) - Optional - Layout direction for the map. - **padding** (EdgeInsets) - Optional - Padding around the map content (default: EdgeInsets.zero). - **indoorViewEnabled** (bool) - Optional - Enables indoor view (default: false). - **trafficEnabled** (bool) - Optional - Enables traffic layer (default: false). - **buildingsEnabled** (bool) - Optional - Enables buildings layer (default: true). - **markers** (Set) - Optional - Set of markers to display on the map (default: empty set). - **polygons** (Set) - Optional - Set of polygons to display on the map (default: empty set). - **polylines** (Set) - Optional - Set of polylines to display on the map (default: empty set). - **circles** (Set) - Optional - Set of circles to display on the map (default: empty set). - **clusterManagers** (Set) - Optional - Set of cluster managers (default: empty set). - **heatmaps** (Set) - Optional - Set of heatmaps (default: empty set). - **onCameraMoveStarted** (VoidCallback?) - Optional - Callback when camera movement starts. - **tileOverlays** (Set) - Optional - Set of tile overlays (default: empty set). - **groundOverlays** (Set) - Optional - Set of ground overlays (default: empty set). - **onCameraMove** (CameraPositionCallback?) - Optional - Callback when the camera is moving. - **onCameraIdle** (VoidCallback?) - Optional - Callback when camera movement has ended. - **onTap** (ArgumentCallback?) - Optional - Callback when the map is tapped. - **onLongPress** (ArgumentCallback?) - Optional - Callback when the map is long-pressed. - **markerType** (GoogleMapMarkerType) - Optional - Type of marker to use (default: GoogleMapMarkerType.marker). - **colorScheme** (MapColorScheme?) - Optional - Color scheme for the map. - **mapId** (String?) - Optional - Unique identifier for the map. - **cloudMapId** (String?) - Deprecated - Use `mapId` instead. ``` -------------------------------- ### onDragStart Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/Marker/onDragStart.html Signature reporting the new LatLng at the start of a drag event. ```APIDOC ## onDragStart Property ```dart ValueChanged? onDragStart; ``` ### Description Signature reporting the new LatLng at the start of a drag event. ### Type `ValueChanged?` ### Usage This property is used to define a callback function that will be executed when the user starts dragging a marker on the map. The callback receives the `LatLng` coordinates where the drag initiated. ``` -------------------------------- ### onCameraMoveStarted Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/GoogleMap/onCameraMoveStarted.html Callback that is called when the camera starts moving. This can be initiated by user gestures, non-gesture animations, or programmatic animations. ```APIDOC ## onCameraMoveStarted ### Description Callback that is called when the camera starts moving. This can be initiated by: 1. Non-gesture animation initiated in response to user actions (e.g., zoom buttons, my location button, marker clicks). 2. Programmatically initiated animation. 3. Camera motion initiated in response to user gestures on the map (e.g., pan, tilt, pinch to zoom, rotate). ### Type `VoidCallback?` ``` -------------------------------- ### HeatmapGradientColor Constructor Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/HeatmapGradientColor-class.html Creates a new HeatmapGradientColor object with the specified color and start point. ```APIDOC ## HeatmapGradientColor(Color color, double startPoint) ### Description Creates a new HeatmapGradientColor object. ### Parameters #### Path Parameters - **color** (Color) - Required - The color for this portion of the gradient. - **startPoint** (double) - Required - The start point of this color. ``` -------------------------------- ### GoogleMap Constructor Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/GoogleMap/GoogleMap.html Creates a widget displaying data from Google Maps services. The map's camera will start centered on `initialCameraPosition`. This constructor allows configuration of various map properties like style, gestures, and data layers. ```dart const GoogleMap({ super.key, required this.initialCameraPosition, this.style, this.onMapCreated, this.gestureRecognizers = const >{}, this.webGestureHandling, this.webCameraControlPosition, this.webCameraControlEnabled = true, this.compassEnabled = true, this.mapToolbarEnabled = true, this.cameraTargetBounds = CameraTargetBounds.unbounded, this.mapType = MapType.normal, this.minMaxZoomPreference = MinMaxZoomPreference.unbounded, this.rotateGesturesEnabled = true, this.scrollGesturesEnabled = true, this.zoomControlsEnabled = true, this.zoomGesturesEnabled = true, this.liteModeEnabled = false, this.tiltGesturesEnabled = true, this.fortyFiveDegreeImageryEnabled = false, this.myLocationEnabled = false, this.myLocationButtonEnabled = true, this.layoutDirection, this.padding = EdgeInsets.zero, this.indoorViewEnabled = false, this.trafficEnabled = false, this.buildingsEnabled = true, this.markers = const {}, this.polygons = const {}, this.polylines = const {}, this.circles = const {}, this.clusterManagers = const {}, this.heatmaps = const {}, this.onCameraMoveStarted, this.tileOverlays = const {}, this.groundOverlays = const {}, this.onCameraMove, this.onCameraIdle, this.onTap, this.onLongPress, this.markerType = GoogleMapMarkerType.marker, this.colorScheme, String? mapId, @Deprecated('cloudMapId is deprecated. Use mapId instead.') String? cloudMapId, }) : assert( mapId == null || cloudMapId == null, '''A value may be provided for either mapId or cloudMapId, or neither, but not for both.''', ), mapId = mapId ?? cloudMapId; ``` -------------------------------- ### Create AssetMapBitmap with Width and Auto Scaling Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/AssetMapBitmap/AssetMapBitmap.html Creates an AssetMapBitmap from an asset image, specifying a desired width and enabling automatic scaling. This example demonstrates creating a map bitmap without automatic asset resolving. ```dart AssetMapBitmap mapBitmap = AssetMapBitmap( 'assets/images/map_icon.png', bitmapScaling: MapBitmapScaling.auto, width: 40, // Desired width in logical pixels. ); ``` -------------------------------- ### onCameraMoveStarted Callback Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/GoogleMap/onCameraMoveStarted.html This property is a VoidCallback that gets invoked when the camera movement starts. It's useful for tracking when the map view begins to change, whether by user interaction or programmatic control. ```dart final VoidCallback? onCameraMoveStarted; ``` -------------------------------- ### startCap Property Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/Polyline/startCap.html The cap at the start vertex of the polyline. The default start cap is ButtCap. Note: Not supported on all platforms. ```APIDOC ## startCap ### Description The cap at the start vertex of the polyline. ### Default Value `ButtCap` ### Notes Not supported on all platforms. ### Implementation ```dart final Cap startCap; ``` ``` -------------------------------- ### init Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/GoogleMapController-class.html Initialize control of a GoogleMap with `id`. ```APIDOC ## init ### Description Initializes the controller for a GoogleMap instance with a given ID and initial camera position. ### Method `init(int id, CameraPosition initialCameraPosition, _GoogleMapState googleMapState)` ### Parameters - **id** (int) - Required - The unique identifier for the GoogleMap instance. - **initialCameraPosition** (CameraPosition) - Required - The initial position and zoom level of the map camera. - **googleMapState** (_GoogleMapState) - Required - The state object associated with the GoogleMap widget. ``` -------------------------------- ### GroundOverlay.fromBounds Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/GroundOverlay-class.html Creates a GroundOverlay fitted to the specified `bounds` with the provided `image`. This is the recommended method for precise placement. ```APIDOC ## GroundOverlay.fromBounds ### Description Creates a GroundOverlay fitted to the specified `bounds` with the provided `image`. ### Method Signature ```dart GroundOverlay.fromBounds({ required GroundOverlayId groundOverlayId, required MapBitmap image, required LatLngBounds bounds, Offset anchor = const Offset(0.5, 0.5), double bearing = 0.0, double transparency = 0.0, int zIndex = 0, bool visible = true, bool clickable = true, VoidCallback? onTap, }) ``` ### Parameters * **groundOverlayId** (GroundOverlayId) - Required - A unique identifier for the ground overlay. * **image** (MapBitmap) - Required - The image to be displayed as the ground overlay. Ensure `bitmapScaling` is set to `MapBitmapScaling.none`. * **bounds** (LatLngBounds) - Required - The geographical boundaries (southwest and northeast corners) where the image will be placed. * **anchor** (Offset) - Optional - The anchor's relative location within the overlay (default is center: 0.5, 0.5). * **bearing** (double) - Optional - The rotation of the image in degrees clockwise (default is 0.0). * **transparency** (double) - Optional - The transparency of the overlay, ranging from 0.0 (opaque) to 1.0 (transparent) (default is 0.0). * **zIndex** (int) - Optional - The stacking order of the overlay (default is 0). * **visible** (bool) - Optional - Whether the overlay is currently visible (default is true). * **clickable** (bool) - Optional - Whether the overlay is interactive and can be tapped (default is true). * **onTap** (VoidCallback?) - Optional - A callback function to be executed when the overlay is tapped. ``` -------------------------------- ### animateCamera Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/GoogleMapController/animateCamera.html Starts an animated change of the map camera position. The `duration` parameter specifies the duration of the animation. If null, the platform will decide the default value. The returned Future completes after the change has been started on the platform side. ```APIDOC ## animateCamera ### Description Starts an animated change of the map camera position. ### Parameters - **cameraUpdate** (CameraUpdate) - The desired camera update. - **duration** (Duration?) - Optional duration for the animation. If null, a default duration is used. ### Returns - Future - A future that completes when the animation has started on the platform side. ``` -------------------------------- ### get useAndroidViewSurface Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/AndroidGoogleMapsFlutter/useAndroidViewSurface.html Gets the current value of the useAndroidViewSurface property. This property determines if GoogleMap is rendered using an AndroidViewSurface. The default value is false. Note: This property is deprecated and replaced by the display mode settings in the google_maps_flutter_android package. ```APIDOC ## get useAndroidViewSurface ### Description Whether to render GoogleMap with a AndroidViewSurface to build the Google Maps widget. This implementation uses hybrid composition to render the Google Maps Widget on Android. This comes at the cost of some performance on Android versions below 10. See https://docs.flutter.dev/platform-integration/android/platform-views#performance for more information. ### Deprecated See https://pub.dev/packages/google_maps_flutter_android#display-mode ### Implementation ```dart @Deprecated( 'See https://pub.dev/packages/google_maps_flutter_android#display-mode', ) static bool get useAndroidViewSurface { final GoogleMapsFlutterPlatform platform = GoogleMapsFlutterPlatform.instance; if (platform is GoogleMapsFlutterAndroid) { return platform.useAndroidViewSurface; } return false; } ``` ``` -------------------------------- ### AssetMapBitmap Constructor Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/AssetMapBitmap/AssetMapBitmap.html Creates an AssetMapBitmap from an asset image. Use AssetMapBitmap.create for mipmapped assets. The `imagePixelRatio` parameter helps match the asset's resolution to the device's pixel ratio for sharpness. `bitmapScaling` controls how the image scales, with 'auto' for automatic scaling and 'none' to disable it. Optionally specify `width` and `height` to control the rendered image dimensions, which can affect aspect ratio. ```APIDOC ## AssetMapBitmap(String assetName, {MapBitmapScaling bitmapScaling = MapBitmapScaling.auto, double? imagePixelRatio, double? width, double? height}) ### Description Creates an AssetMapBitmap from an asset image. The `imagePixelRatio` parameter allows you to provide the correct pixel ratio of the asset image. If not provided, it defaults to 1.0. Setting `imagePixelRatio` to the device's pixel ratio renders the asset as sharply as possible. `bitmapScaling` controls the scaling behavior: `MapBitmapScaling.auto` automatically scales the image to match the device's pixel ratio or specified dimensions, while `MapBitmapScaling.none` disables automatic scaling. Optionally, `width` and `height` can be specified to control the dimensions of the rendered image. If both are provided, the image will have those dimensions, potentially distorting the aspect ratio. If only one is provided, the other dimension scales to maintain the aspect ratio. If `width` or `height` is provided, `imagePixelRatio` is ignored. ### Parameters #### Positional Parameters - **assetName** (String) - The name of the asset image. #### Named Parameters - **bitmapScaling** (MapBitmapScaling) - Controls the scaling behavior. Defaults to `MapBitmapScaling.auto`. - **imagePixelRatio** (double?) - The pixel ratio of the asset image. Defaults to the natural resolution of 1.0 if not provided. - **width** (double?) - The desired width of the rendered image in logical pixels. - **height** (double?) - The desired height of the rendered image in logical pixels. ### Example ```dart // Example using width and automatic scaling AssetMapBitmap mapBitmap = AssetMapBitmap( 'assets/images/map_icon.png', bitmapScaling: MapBitmapScaling.auto, width: 40, // Desired width in logical pixels. ); // Example for sharpest rendering using device pixel ratio AssetMapBitmap assetMapBitmap = AssetMapBitmap( 'assets/images/map_icon.png', imagePixelRatio: MediaQuery.maybeDevicePixelRatioOf(context), ); ``` ``` -------------------------------- ### animateCamera Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/GoogleMapController-class.html Starts an animated change of the map camera position. ```APIDOC ## animateCamera ### Description Starts an animated change of the map camera position. ### Method `animateCamera(CameraUpdate cameraUpdate, {Duration? duration})` ### Parameters - **cameraUpdate** (CameraUpdate) - Required - The desired camera position and zoom. - **duration** (Duration?) - Optional - The duration of the animation. ``` -------------------------------- ### init static method Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/GoogleMapController/init.html Initializes control of a GoogleMap with `id`. This method is mainly for internal use when instantiating a GoogleMapController passed in the GoogleMap.onMapCreated callback. ```APIDOC ## init static method Future init( int id, CameraPosition initialCameraPosition, _GoogleMapState googleMapState ) ### Description Initialize control of a GoogleMap with `id`. Mainly for internal use when instantiating a GoogleMapController passed in GoogleMap.onMapCreated callback. ### Parameters - **id** (int) - The unique identifier for the map. - **initialCameraPosition** (CameraPosition) - The initial position of the camera. - **googleMapState** (_GoogleMapState) - The state of the GoogleMap. ### Implementation ```dart static Future init( int id, CameraPosition initialCameraPosition, _GoogleMapState googleMapState, ) async { await GoogleMapsFlutterPlatform.instance.init(id); return GoogleMapController._(googleMapState, mapId: id); } ``` ``` -------------------------------- ### center Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/Circle/center.html Gets and sets the geographical location of the circle center. ```APIDOC ## center property LatLng center Geographical location of the circle center. ### Implementation ```dart final LatLng center; ``` ``` -------------------------------- ### isMarkerInfoWindowShown Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/GoogleMapController-class.html Returns `true` when the InfoWindow is showing, `false` otherwise. ```APIDOC ## isMarkerInfoWindowShown ### Description Checks if the information window for a specific marker is currently being displayed. ### Method `isMarkerInfoWindowShown(MarkerId markerId)` ### Parameters - **markerId** (MarkerId) - Required - The ID of the marker to check. ### Returns - **Future** - A future that completes with `true` if the Info Window is shown, and `false` otherwise. ``` -------------------------------- ### Marker Constructor Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/Marker/Marker.html Creates a set of marker configuration options with default values. ```APIDOC ## Marker Constructor ### Description Creates a set of marker configuration options. Default marker options are provided for properties such as opacity, anchor, tap handling, draggable state, icon, info window, position, rotation, visibility, and z-index. ### Parameters - **markerId** (MarkerId) - Required - Unique identifier for the marker. - **alpha** (double) - Optional - Opacity of the marker, ranging from 0.0 (transparent) to 1.0 (opaque). Defaults to 1.0. - **anchor** (Offset) - Optional - The anchor point of the marker relative to its position on the map. Defaults to the bottom center (0.5, 1.0). - **consumeTapEvents** (bool) - Optional - Whether the marker should consume tap events. Defaults to false. - **draggable** (bool) - Optional - Whether the marker can be dragged by the user. Defaults to false. - **flat** (bool) - Optional - Whether the marker is drawn against the screen, not the map. Defaults to false. - **icon** (BitmapDescriptor) - Optional - The icon to display for the marker. Defaults to `BitmapDescriptor.defaultMarker`. - **infoWindow** (InfoWindow) - Optional - Configuration for the info window that appears when the marker is tapped. Defaults to `InfoWindow.noText`. - **position** (LatLng) - Optional - The geographical location of the marker. Defaults to (0.0, 0.0). - **rotation** (double) - Optional - The rotation of the marker in degrees, with 0.0 being axis-aligned. Defaults to 0.0. - **visible** (bool) - Optional - Whether the marker is visible on the map. Defaults to true. - **zIndex** (double) - Optional - Deprecated. Use `zIndexInt` instead. Affects the drawing order of the marker. Defaults to 0.0. - **zIndexInt** (int) - Optional - Affects the drawing order of the marker. Defaults to 0. - **clusterManagerId** (ClusterManagerId?) - Optional - Identifier for the cluster manager this marker belongs to. - **onTap** (VoidCallback?) - Optional - Callback function invoked when the marker is tapped. - **onDrag** (ValueChanged?) - Optional - Callback function invoked when the marker is being dragged. - **onDragStart** (ValueChanged?) - Optional - Callback function invoked when the marker drag starts. - **onDragEnd** (ValueChanged?) - Optional - Callback function invoked when the marker drag ends. ### Assertions - `0.0 <= alpha <= 1.0` - Only one of `zIndex` and `zIndexInt` can be provided. ``` -------------------------------- ### newLatLng static method Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/CameraUpdate/newLatLng.html Creates a camera update to move the camera's target to a specific LatLng. ```APIDOC ## newLatLng static method ### Description Returns a camera update that moves the camera target to the specified geographical location. ### Method Signature `static CameraUpdate newLatLng(LatLng latLng)` ### Parameters #### Path Parameters - **latLng** (LatLng) - Required - The geographical location to move the camera to. ``` -------------------------------- ### AssetMapBitmap Constructor Implementation Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/AssetMapBitmap/AssetMapBitmap.html The core implementation of the AssetMapBitmap constructor, showing how parameters like assetName, bitmapScaling, imagePixelRatio, width, and height are processed. The imagePixelRatio defaults to a natural resolution of 1.0 if not provided. ```dart AssetMapBitmap( String assetName, { MapBitmapScaling bitmapScaling = MapBitmapScaling.auto, double? imagePixelRatio, double? width, double? height, }) : this._( assetName: assetName, bitmapScaling: bitmapScaling, imagePixelRatio: imagePixelRatio ?? _naturalPixelRatio, width: width, height: height, ); ``` -------------------------------- ### startPoint Property Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/HeatmapGradientColor/startPoint.html The start point of this color. It is a final double value. ```APIDOC ## startPoint Property ### Description The start point of this color. It is a final double value. ### Type double ### Implementation ```dart final double startPoint; ``` ``` -------------------------------- ### HeatmapGradientColor.new Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/HeatmapGradientColor/HeatmapGradientColor.html Creates a new HeatmapGradientColor object with the specified color and start point. ```APIDOC ## HeatmapGradientColor.new ### Description Creates a new HeatmapGradientColor object. ### Parameters #### Path Parameters - **color** (Color) - Required - The color for this gradient stop. - **startPoint** (double) - Required - The position of this gradient stop, between 0.0 and 1.0. ### Method ```dart const HeatmapGradientColor(this.color, this.startPoint); ``` ``` -------------------------------- ### showMarkerInfoWindow Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/GoogleMapController-class.html Programmatically show the Info Window for a Marker. ```APIDOC ## showMarkerInfoWindow ### Description Programmatically displays the information window associated with a specific marker. ### Method `showMarkerInfoWindow(MarkerId markerId)` ### Parameters - **markerId** (MarkerId) - Required - The ID of the marker whose Info Window should be shown. ``` -------------------------------- ### Create AssetMapBitmap with Custom Image Pixel Ratio Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/AssetMapBitmap-class.html To render the bitmap as sharply as possible, set the `imagePixelRatio` to the device's pixel ratio. This renders the asset at a pixel-to-pixel ratio on the screen, but may result in different logical marker sizes across devices with varying pixel densities. ```APIDOC ## AssetMapBitmap Constructor with ImagePixelRatio ### Description Creates an AssetMapBitmap with a specified image pixel ratio for sharp rendering. ### Method `AssetMapBitmap(String assetName, {MapBitmapScaling bitmapScaling = MapBitmapScaling.auto, double? imagePixelRatio, double? width, double? height})` ### Parameters #### Path Parameters - **assetName** (String) - Required - The name of the asset. #### Query Parameters - **imagePixelRatio** (double?) - Optional - The pixel ratio of the bitmap. Set to `MediaQuery.maybeDevicePixelRatioOf(context)` for device's pixel ratio. ### Request Example ```dart AssetMapBitmap assetMapBitmap = AssetMapBitmap( 'assets/images/map_icon.png', imagePixelRatio: MediaQuery.maybeDevicePixelRatioOf(context), ); ``` ``` -------------------------------- ### CapType Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/Cap/type.html The type of rendering used for the cap at a start or end vertex of a Polyline. ```APIDOC ## CapType ### Description The type of rendering used for the cap at a start or end vertex of a Polyline. ### Implementation ```dart final CapType type; ``` ``` -------------------------------- ### TileOverlay Constructor Implementation Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/TileOverlay/TileOverlay.html This is the implementation of the TileOverlay constructor. It initializes the overlay with its ID, fade-in animation, tile provider, transparency, z-index, visibility, and tile size. It also includes an assertion to ensure transparency is within the valid range of 0.0 to 1.0. ```dart const TileOverlay({ required this.tileOverlayId, this.fadeIn = true, this.tileProvider, this.transparency = 0.0, this.zIndex = 0, this.visible = true, this.tileSize = 256, }) : assert(transparency >= 0.0 && transparency <= 1.0); ``` -------------------------------- ### groundOverlays Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/GoogleMap-class.html Ground overlays to be initialized for the map. ```APIDOC ## groundOverlays ### Description Ground overlays to be initialized for the map. ### Type Set ### Access final ``` -------------------------------- ### Polyline Properties Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/Polyline-class.html Access various properties of the Polyline object to get information about its appearance and behavior. ```APIDOC ## Properties * **color** (Color) - The line segment color in ARGB format. The default value is black (0xff000000). * **consumeTapEvents** (bool) - True if the Polyline consumes tap events. * **endCap** (Cap) - The cap at the end vertex of the polyline. * **geodesic** (bool) - Indicates whether the segments of the polyline should be drawn as geodesics, as opposed to straight lines on the Mercator projection. * **hashCode** (int) - The hash code for this object. * **jointType** (JointType) - Joint type of the polyline line segments. * **mapsId** (PolylineId) - A identifier for this object. * **onTap** (VoidCallback?) - Callbacks to receive tap events for polyline placed on this map. * **patterns** (List) - The stroke pattern for the polyline. * **points** (List) - The vertices of the polyline to be drawn. * **polylineId** (PolylineId) - Uniquely identifies a Polyline. * **runtimeType** (Type) - A representation of the runtime type of the object. * **startCap** (Cap) - The cap at the start vertex of the polyline. * **visible** (bool) - True if the polyline is visible. * **width** (int) - The width of the polyline, used to define the width of the line segment to be drawn. * **zIndex** (int) - The z-index of the polyline, used to determine relative drawing order of map overlays. ``` -------------------------------- ### Get LatLng from ScreenCoordinate Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/GoogleMapController/getLatLng.html Converts a ScreenCoordinate to a LatLng. The screen coordinate is relative to the top-left of the map. ```dart Future getLatLng(ScreenCoordinate screenCoordinate) { _checkWidgetMountedOrThrow(); return GoogleMapsFlutterPlatform.instance.getLatLng( screenCoordinate, mapId: mapId, ); } ``` -------------------------------- ### Create AssetMapBitmap for Sharp Rendering Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/AssetMapBitmap/AssetMapBitmap.html Creates an AssetMapBitmap from an asset image, setting the imagePixelRatio to the device's pixel ratio for the sharpest possible rendering. This ensures the asset is rendered at a pixel-to-pixel ratio on the screen. ```dart AssetMapBitmap assetMapBitmap = AssetMapBitmap( 'assets/images/map_icon.png', imagePixelRatio: MediaQuery.maybeDevicePixelRatioOf(context), ); ``` -------------------------------- ### AssetMapBitmap.create Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/AssetMapBitmap/create.html Creates an AssetMapBitmap from an asset image. It dynamically resolves the correct asset version based on the device's pixel ratio, ensuring optimal resolution without manual configuration. This is the preferred method for creating instances of AssetMapBitmap due to its automatic asset resolution capabilities. ```APIDOC ## AssetMapBitmap.create ### Description Creates an AssetMapBitmap from an asset image with asset resolving and mipmapping enabled. This method dynamically resolves the correct asset version based on the device's pixel ratio, ensuring optimal resolution without manual configuration. It is the preferred method for creating instances of AssetMapBitmap due to its automatic asset resolution capabilities. `assetName` is the name of the asset. The asset is resolved in the context of the specified `bundle` and `package`. Optionally, `width` and `height` can be specified to control the dimensions of the rendered image: * If both `width` and `height` are non-null, the image will have the specified dimensions, which might distort the original aspect ratio, similar to BoxFit.fill. * If only one of `width` and `height` is non-null, then the output image will be scaled to the associated width or height, and the other dimension will take whatever value is needed to maintain the image's original aspect ratio. These cases are similar to BoxFit.fitWidth and BoxFit.fitHeight, respectively. `bitmapScaling` controls the scaling behavior: * MapBitmapScaling.auto automatically upscales and downscales the image to match the device's pixel ratio or the specified dimensions, maintaining consistency across devices. * MapBitmapScaling.none disables automatic scaling, which is useful when performance is a concern or if the asset is already scaled appropriately. Asset mipmap is resolved using the devices pixel ratio from the ImageConfiguration.devicePixelRatio parameter. To initialize the ImageConfiguration with the devices pixel ratio, use the createLocalImageConfiguration method. `imagePixelRatio` can be provided to override the resolved asset's pixel ratio. Specifying `imagePixelRatio` can be useful in scenarios where custom scaling is needed. `imagePixelRatio` is ignored if `width` or `height` is provided. Returns a Future that completes with an AssetMapBitmap instance. ### Method Signature ```dart static Future create( ImageConfiguration configuration, String assetName, { AssetBundle? bundle, String? package, double? width, double? height, double? imagePixelRatio, MapBitmapScaling bitmapScaling = MapBitmapScaling.auto, } ) ``` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **configuration** (ImageConfiguration) - Required - The configuration for the image, including device pixel ratio. * **assetName** (String) - Required - The name of the asset. * **bundle** (AssetBundle?) - Optional - The asset bundle to use. If null, the root bundle is used. * **package** (String?) - Optional - The name of the package containing the asset. * **width** (double?) - Optional - The desired width of the image in logical pixels. * **height** (double?) - Optional - The desired height of the image in logical pixels. * **imagePixelRatio** (double?) - Optional - The pixel ratio to use for the asset. If null, it's determined from the configuration. * **bitmapScaling** (MapBitmapScaling) - Optional - Controls the scaling behavior of the bitmap. Defaults to `MapBitmapScaling.auto`. ### Request Example ```dart Future _getAssetMapBitmap(BuildContext context) async { final ImageConfiguration imageConfiguration = createLocalImageConfiguration( context, ); AssetMapBitmap assetMapBitmap = await AssetMapBitmap.create( imageConfiguration, 'assets/images/map_icon.png', ); return assetMapBitmap; } ``` ### Response #### Success Response (200) - **AssetMapBitmap** - A Future that completes with an AssetMapBitmap instance. #### Response Example ```dart // Example of a returned AssetMapBitmap object (structure may vary) AssetMapBitmap({ 'assetName': 'assets/images/map_icon.png', 'imagePixelRatio': 2.0, 'bitmapScaling': MapBitmapScaling.auto, 'width': null, 'height': null, }) ``` ``` -------------------------------- ### Get useAndroidViewSurface Property Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/AndroidGoogleMapsFlutter/useAndroidViewSurface.html Retrieves the current value of the useAndroidViewSurface property. This is useful for checking the rendering mode before making changes. ```dart @Deprecated( 'See https://pub.dev/packages/google_maps_flutter_android#display-mode', ) static bool get useAndroidViewSurface { final GoogleMapsFlutterPlatform platform = GoogleMapsFlutterPlatform.instance; if (platform is GoogleMapsFlutterAndroid) { return platform.useAndroidViewSurface; } return false; } ``` -------------------------------- ### Marker Constructor Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/Marker-class.html Creates a set of marker configuration options. All properties are optional and have default values. ```APIDOC ## Marker Constructor Marker({ required MarkerId markerId, double alpha = 1.0, Offset anchor = const Offset(0.5, 1.0), bool consumeTapEvents = false, bool draggable = false, bool flat = false, BitmapDescriptor icon = BitmapDescriptor.defaultMarker, InfoWindow infoWindow = InfoWindow.noText, LatLng position = const LatLng(0.0, 0.0), double rotation = 0.0, bool visible = true, @Deprecated('Use zIndexInt instead. ') double zIndex = 0.0, int zIndexInt = 0, ClusterManagerId? clusterManagerId, VoidCallback? onTap, ValueChanged? onDrag, ValueChanged? onDragStart, ValueChanged? onDragEnd }) Creates a set of marker configuration options. ``` -------------------------------- ### GroundOverlay.fromPosition Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/GroundOverlay-class.html Creates a GroundOverlay positioned at a specific `position` with given `width` and `height` (or scaled by `zoomLevel`). ```APIDOC ## GroundOverlay.fromPosition ### Description Creates a GroundOverlay to given `position` with the given `image`. The size can be specified by `width` and `height`, or by `zoomLevel`. ### Method Signature ```dart GroundOverlay.fromPosition({ required GroundOverlayId groundOverlayId, required MapBitmap image, required LatLng position, double? width, double? height, Offset anchor = const Offset(0.5, 0.5), double bearing = 0.0, double transparency = 0.0, int zIndex = 0, bool visible = true, bool clickable = true, VoidCallback? onTap, double? zoomLevel, }) ``` ### Parameters * **groundOverlayId** (GroundOverlayId) - Required - A unique identifier for the ground overlay. * **image** (MapBitmap) - Required - The image to be displayed as the ground overlay. Ensure `bitmapScaling` is set to `MapBitmapScaling.none`. * **position** (LatLng) - Required - The geographical coordinates where the center of the image will be placed. * **width** (double?) - Optional - The desired width of the image in meters. If `height` is omitted, the aspect ratio is preserved. * **height** (double?) - Optional - The desired height of the image in meters. If `width` is omitted, the aspect ratio is preserved. * **anchor** (Offset) - Optional - The anchor's relative location within the overlay (default is center: 0.5, 0.5). When `position` is used, the overlay shifts so that this anchor aligns with the given `position`. * **bearing** (double) - Optional - The rotation of the image in degrees clockwise (default is 0.0). * **transparency** (double) - Optional - The transparency of the overlay, ranging from 0.0 (opaque) to 1.0 (transparent) (default is 0.0). * **zIndex** (int) - Optional - The stacking order of the overlay (default is 0). * **visible** (bool) - Optional - Whether the overlay is currently visible (default is true). * **clickable** (bool) - Optional - Whether the overlay is interactive and can be tapped (default is true). * **onTap** (VoidCallback?) - Optional - A callback function to be executed when the overlay is tapped. * **zoomLevel** (double?) - Optional - A zoom level at which the image should be displayed at its specified `width` and `height`. If `width` and `height` are not provided, this parameter scales the image to fit the map at the specified zoom level while preserving aspect ratio. ``` -------------------------------- ### Convert LatLngBounds to JSON Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/LatLngBounds/toJson.html Use this method to get a JSON-compatible representation of the LatLngBounds. This is useful when sending bounds data to a server or storing it. ```dart Object toJson() { return [southwest.toJson(), northeast.toJson()]; } ``` -------------------------------- ### InfoWindow.copyWith Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/InfoWindow-class.html Creates a new InfoWindow object with potentially updated values, based on the current instance. ```APIDOC ## copyWith ### Description Creates a new InfoWindow object whose values are the same as this instance, unless overwritten by the specified parameters. ### Parameters - **titleParam** (String?) - Overwrite the title. - **snippetParam** (String?) - Overwrite the snippet. - **anchorParam** (Offset?) - Overwrite the anchor. - **onTapParam** (VoidCallback?) - Overwrite the onTap callback. ### Returns - **InfoWindow** - A new InfoWindow instance with the specified or original values. ``` -------------------------------- ### GroundOverlay.fromBounds Factory Constructor Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/GroundOverlay/GroundOverlay.fromBounds.html Creates a GroundOverlay fitted to the specified `bounds` with the provided `image`. This constructor allows you to define the overlay's position, image, and other visual properties. ```APIDOC ## GroundOverlay.fromBounds factory constructor Creates a GroundOverlay fitted to the specified `bounds` with the provided `image`. ### Parameters - **groundOverlayId** (GroundOverlayId) - Required - A unique identifier for the ground overlay. - **image** (MapBitmap) - Required - The image to be displayed as the ground overlay. - **bounds** (LatLngBounds) - Required - The geographical boundaries (southwest and northeast corners) to which the ground overlay will be fitted. - **anchor** (Offset) - Optional - The anchor point of the ground overlay, specified as an offset from the overlay's center. Defaults to `const Offset(0.5, 0.5)` (center). - **bearing** (double) - Optional - The rotation of the ground overlay in degrees, where 0 is north. Defaults to `0.0`. - **transparency** (double) - Optional - The transparency level of the ground overlay, ranging from 0.0 (opaque) to 1.0 (fully transparent). Defaults to `0.0`. - **zIndex** (int) - Optional - The stacking order of the ground overlay. Higher values are drawn on top. Defaults to `0`. - **visible** (bool) - Optional - Whether the ground overlay is currently visible. Defaults to `true`. - **clickable** (bool) - Optional - Whether the ground overlay can be clicked. Defaults to `true`. - **onTap** (VoidCallback?) - Optional - A callback function that is invoked when the ground overlay is tapped. ### Example ```dart GroundOverlay.fromBounds( groundOverlayId: const GroundOverlayId('overlay_id'), image: await AssetMapBitmap.create( createLocalImageConfiguration(context), 'assets/images/ground_overlay.png', bitmapScaling: MapBitmapScaling.none, ), bounds: LatLngBounds( southwest: LatLng(37.42, -122.08), northeast: LatLng(37.43, -122.09), ), ); ``` ``` -------------------------------- ### Get Current Zoom Level Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/GoogleMapController/getZoomLevel.html Call this method to retrieve the current zoom level of the map. Ensure the widget is mounted before calling. ```dart Future getZoomLevel() { _checkWidgetMountedOrThrow(); return GoogleMapsFlutterPlatform.instance.getZoomLevel(mapId: mapId); } ``` -------------------------------- ### toString Method Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/HeatmapGradientColor/toString.html The toString method returns a string representation of the HeatmapGradientColor object, including its color and start point. This is useful for debugging and logging. ```APIDOC ## toString Method ### Description Returns a string representation of this object. The default representation is an empty string. Override this method to provide a meaningful string representation for your class. ### Method Signature ```dart @override String toString() ``` ### Implementation ```dart @override String toString() { return '${objectRuntimeType(this, 'HeatmapGradientColor')}($color, $startPoint)'; } ``` ``` -------------------------------- ### GroundOverlay.fromBounds Factory Implementation Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/GroundOverlay/GroundOverlay.fromBounds.html This is the internal implementation of the GroundOverlay.fromBounds factory constructor. It initializes a GroundOverlay instance with all provided parameters. ```dart factory GroundOverlay.fromBounds({ required GroundOverlayId groundOverlayId, required MapBitmap image, required LatLngBounds bounds, Offset anchor = const Offset(0.5, 0.5), double bearing = 0.0, double transparency = 0.0, int zIndex = 0, bool visible = true, bool clickable = true, VoidCallback? onTap, }) { return GroundOverlay._( groundOverlayId: groundOverlayId, image: image, bounds: bounds, anchor: anchor, bearing: bearing, transparency: transparency, zIndex: zIndex, visible: visible, clickable: clickable, onTap: onTap, ); } ``` -------------------------------- ### TileProvider Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/TileProvider-class.html Abstract class for providing tile images. ```APIDOC ## TileProvider An interface for a class that provides the tile images for a TileOverlay. ### Constructors * **TileProvider()**: Creates a new TileProvider. ### Methods * **getTile(int x, int y, int? zoom)**: Returns the tile to be used for this tile coordinate. * **Parameters**: * `x` (int) - The x-coordinate of the tile. * `y` (int) - The y-coordinate of the tile. * `zoom` (int?) - The zoom level. * **Returns**: A `Future` representing the tile image. ### Constants * **noTile**: A stub tile used to indicate that no tile exists for a specific tile coordinate. ``` -------------------------------- ### Get zIndexInt - Google Maps Flutter Source: https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/Marker/zIndexInt.html Retrieves the integer z-index of the marker. This value is used to control the drawing order of map overlays. ```dart int get zIndexInt => _zIndexNum.round(); ```