Marker constructor
const
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,
- double zIndex = 0.0,
- ClusterManagerId? clusterManagerId,
- VoidCallback? onTap,
- ValueChanged<
LatLng> ? onDrag, - ValueChanged<
LatLng> ? onDragStart, - ValueChanged<
LatLng> ? onDragEnd,
Creates a set of marker configuration options.
Default marker options.
Specifies a marker that
- is fully opaque;
alphais 1.0 - uses icon bottom center to indicate map position;
anchoris (0.5, 1.0) - has default tap handling;
consumeTapEventsis false - is stationary;
draggableis false - is drawn against the screen, not the map;
flatis false - has a default icon;
iconisBitmapDescriptor.defaultMarker - anchors the info window at top center;
infoWindowAnchoris (0.5, 0.0) - has no info window text;
infoWindowTextisInfoWindowText.noText - is positioned at 0, 0;
positionisLatLng(0.0, 0.0) - has an axis-aligned icon;
rotationis 0.0 - is visible;
visibleis true - is placed at the base of the drawing order;
zIndexis 0.0 - reports
onTapevents - reports
onDragEndevents
Implementation
const Marker({
required this.markerId,
this.alpha = 1.0,
this.anchor = const Offset(0.5, 1.0),
this.consumeTapEvents = false,
this.draggable = false,
this.flat = false,
this.icon = BitmapDescriptor.defaultMarker,
this.infoWindow = InfoWindow.noText,
this.position = const LatLng(0.0, 0.0),
this.rotation = 0.0,
this.visible = true,
this.zIndex = 0.0,
this.clusterManagerId,
this.onTap,
this.onDrag,
this.onDragStart,
this.onDragEnd,
}) : assert(0.0 <= alpha && alpha <= 1.0);