Defines an icon placed at a specified position on a map.
Name | Type | Description |
|---|---|---|
markerId | Unique marker ID. | |
position | Position of a marker. | |
infoWindow | Information window of a marker. | |
anchor | Offset | Anchor point of a marker. |
draggable | bool | Indicates whether a marker can be dragged. The options are true (yes) and false (no). |
flat | bool | Indicates whether to flatly attach a marker to the map. If the marker is flatly attached to the map, it will stay on the map when the camera rotates or tilts. The marker will remain the same size when the camera zooms in or out. If the marker faces the camera, it will always be drawn facing the camera and rotates or tilts with the camera. |
icon | Marker icon to render. | |
rotation | double | Rotation angle of a marker, in degrees. |
alpha | double | Opacity. The value ranges from 0 (completely transparent) to 1 (completely opaque). |
visible | bool | Indicates whether a marker is visible. The options are true (yes) and false (no). |
zIndex | double | Z-index of a marker. The z-index indicates the overlapping order of a marker. A marker with a larger z-index overlaps that with a smaller z-index. Markers with the same z-index overlap each other in a random order. By default, the z-index is 0. |
clickable | bool | Indicates whether a marker can be tapped. The options are true (yes) and false (no). |
clusterable | bool | Indicates whether a marker can be clustered. |
onClick | VoidCallback? | Callback executed when a marker is tapped. |
onDragEnd | ValueChanged<LatLng>? | Callback executed when marker dragging is finished. |
onDragStart | ValueChanged<LatLng>? | Callback executed when marker dragging is started. |
onDrag | ValueChanged<LatLng>? | Callback executed while a marker is being dragged. |
animationSet | List<dynamic> | Animation set. |
Creates a Marker object.
Parameter | Type | Description |
|---|---|---|
markerId | Unique marker ID. | |
position | Position of a marker. | |
infoWindow | Information window of a marker. | |
anchor | Offset | Anchor point of a marker. |
draggable | bool | Indicates whether a marker can be dragged. The options are true (yes) and false (no). |
flat | bool | Indicates whether to flatly attach a marker to the map. If the marker is flatly attached to the map, it will stay on the map when the camera rotates or tilts. The marker will remain the same size when the camera zooms in or out. If the marker faces the camera, it will always be drawn facing the camera and rotates or tilts with the camera. |
icon | Marker icon to render. | |
rotation | double | Rotation angle of a marker, in degrees. |
alpha | double | Opacity. The value ranges from 0 (completely transparent) to 1 (completely opaque). |
visible | bool | Indicates whether a marker is visible. The options are true (yes) and false (no). |
zIndex | double | Z-index of a marker. The z-index indicates the overlapping order of a marker. A marker with a larger z-index overlaps that with a smaller z-index. Markers with the same z-index overlap each other in a random order. By default, the z-index is 0. |
clickable | bool | Indicates whether a marker can be tapped. The options are true (yes) and false (no). |
clusterable | bool | Indicates whether a marker can be clustered. |
onClick | VoidCallback? | Callback executed when a marker is tapped. |
onDragEnd | ValueChanged<LatLng>? | Callback executed when marker dragging is finished. |
onDragStart | ValueChanged<LatLng>? | Callback executed when marker dragging is started. |
onDrag | ValueChanged<LatLng>? | Callback executed while a marker is being dragged. |
animationSet | List<dynamic> | Animation set. |
Method | Return Type | Description |
|---|---|---|
Marker | Copies an existing Marker object and updates the specified attributes. | |
Marker | Clones a Marker object. |
Copies an existing Marker object and updates the specified attributes.
Parameter | Type | Description |
|---|---|---|
position | Position of a marker. | |
infoWindow | Information window of a marker. | |
anchor | Offset? | Anchor point of a marker. |
draggable | bool? | Indicates whether a marker can be dragged. The options are true (yes) and false (no). |
flat | bool? | Indicates whether to flatly attach a marker to the map. If the marker is flatly attached to the map, it will stay on the map when the camera rotates or tilts. The marker will remain the same size when the camera zooms in or out. If the marker faces the camera, it will always be drawn facing the camera and rotates or tilts with the camera. |
icon | Marker icon to render. | |
rotation | double? | Rotation angle of a marker, in degrees. |
alpha | double? | Opacity. The value ranges from 0 (completely transparent) to 1 (completely opaque). |
visible | bool? | Indicates whether a marker is visible. The options are true (yes) and false (no). |
zIndex | double? | Z-index of a marker. The z-index indicates the overlapping order of a marker. A marker with a larger z-index overlaps that with a smaller z-index. Markers with the same z-index overlap each other in a random order. By default, the z-index is 0. |
clickable | bool? | Indicates whether a marker can be tapped. The options are true (yes) and false (no). |
clusterable | bool? | Indicates whether a marker can be clustered. |
onClick | VoidCallback? | Callback executed when a marker is tapped. |
onDragEnd | ValueChanged<LatLng>? | Callback executed when marker dragging is finished. |
onDragStart | ValueChanged<LatLng>? | Callback executed when marker dragging is started. |
onDrag | ValueChanged<LatLng>? | Callback executed while a marker is being dragged. |
animationSet | List<dynamic>? | Animation set. |
Return Type | Description |
|---|---|
Marker | Marker object. |
Call example:
// Define a Marker object. Marker marker; // Call the updateCopy method. marker = marker!.updateCopy(draggable: true);