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,
- 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; alpha is 1.0
- uses icon bottom center to indicate map position; anchor is (0.5, 1.0)
- has default tap handling; consumeTapEvents is false
- is stationary; draggable is false
- is drawn against the screen, not the map; flat is false
- has a default icon; icon is
BitmapDescriptor.defaultMarker
- anchors the info window at top center;
infoWindowAnchor
is (0.5, 0.0) - has no info window text;
infoWindowText
isInfoWindowText.noText
- is positioned at 0, 0; position is
LatLng(0.0, 0.0)
- has an axis-aligned icon; rotation is 0.0
- is visible; visible is true
- is placed at the base of the drawing order; zIndex is 0.0
- reports onTap events
- reports onDragEnd events
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.onTap,
this.onDrag,
this.onDragStart,
this.onDragEnd,
}) : assert(0.0 <= alpha && alpha <= 1.0);