CanvasMarker class
CanvasMarker is a class used to draw markers on a tile. painter must be provided to draw the marker. Provide markers as List to CanvasMarkerLayer.
Constructors
- CanvasMarker({required LatLng position, required CanvasPainter painter, HitArea? hitArea, MarkerSize? size, bool rotate = false, Function? onTap})
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- hitArea ↔ HitArea?
-
If provided, this function is used to detect hits on the marker.
It should return a Path that represents the area that will be hit tested.
This is an optional parameter, if not provided, the Rect returned by the painter will be used for hit testing.
getter/setter pair
- onTap ↔ Function?
-
Callback function that is called when the marker is tapped.
getter/setter pair
- painter ↔ CanvasPainter
-
A painter function that draws on a Canvas.
getter/setter pair
- position ↔ LatLng
-
This is a LatLng object that represents the position of the marker on the map.
getter/setter pair
- rotate ↔ bool
-
If true then counter rotates the marker to camera rotation.
Only works in direct painter mode (when
drawWithCanvasZoomis set inMarkerManager).getter/setter pair - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size ↔ MarkerSize?
-
Optional size of the marker. If provided, it can be used for culling and hit testing optimizations.
getter/setter pair
Methods
-
copyWith(
{LatLng? position, CanvasPainter? painter, HitArea? hitArea, bool? rotate, Function? onTap, Function? onDoubleTap, Function? onLongPress, dynamic onHover(bool)?}) → CanvasMarker - Copy the marker with new properties.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override