Marker class
Marks a geographical location on the map.
A marker icon is drawn oriented against the device's screen rather than the map's surface; that is, it will not necessarily change orientation due to map rotations, tilting, or zooming.
- Annotations
Constructors
-
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.
const
Properties
- alpha → double
-
The opacity of the marker, between 0.0 and 1.0 inclusive.
final
- anchor → Offset
-
The icon image point that will be placed at the position of the marker.
final
- consumeTapEvents → bool
-
True if the marker icon consumes tap events. If not, the map will perform
default tap handling by centering the map on the marker and displaying its
info window.
final
- draggable → bool
-
True if the marker is draggable by user touch events.
final
- flat → bool
-
True if the marker is rendered flatly against the surface of the Earth, so
that it will rotate and tilt along with map camera movements.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- icon → BitmapDescriptor
-
A description of the bitmap used to draw the marker icon.
final
- infoWindow → InfoWindow
-
A Google Maps InfoWindow.
final
- mapsId → MarkerId
-
A identifier for this object.
no setter
- markerId → MarkerId
-
Uniquely identifies a Marker.
final
-
onDrag
→ ValueChanged<
LatLng> ? -
Signature reporting the new LatLng during the drag event.
final
-
onDragEnd
→ ValueChanged<
LatLng> ? -
Signature reporting the new LatLng at the end of a drag event.
final
-
onDragStart
→ ValueChanged<
LatLng> ? -
Signature reporting the new LatLng at the start of a drag event.
final
- onTap → VoidCallback?
-
Callbacks to receive tap events for markers placed on this map.
final
- position → LatLng
-
Geographical location of the marker.
final
- rotation → double
-
Rotation of the marker image in degrees clockwise from the anchor point.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- visible → bool
-
True if the marker is visible.
final
- zIndex → double
-
The z-index of the marker, used to determine relative drawing order of
map overlays.
final
Methods
-
clone(
) → Marker - Creates a new Marker object whose values are the same as this instance.
-
copyWith(
{double? alphaParam, Offset? anchorParam, bool? consumeTapEventsParam, bool? draggableParam, bool? flatParam, BitmapDescriptor? iconParam, InfoWindow? infoWindowParam, LatLng? positionParam, double? rotationParam, bool? visibleParam, double? zIndexParam, VoidCallback? onTapParam, ValueChanged< LatLng> ? onDragStartParam, ValueChanged<LatLng> ? onDragParam, ValueChanged<LatLng> ? onDragEndParam}) → Marker - Creates a new Marker object whose values are the same as this instance, unless overwritten by the specified parameters.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Object - Converts this object to something serializable in JSON.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override