CurrentLocationLayer class

A layer for current location marker in FlutterMap.

Inheritance

Constructors

CurrentLocationLayer({Key? key, LocationMarkerStyle style = const LocationMarkerStyle(), Stream<LocationMarkerPosition?>? positionStream, Stream<LocationMarkerHeading?>? headingStream, CustomPoint<num> followScreenPoint = const CustomPoint(0.0, 0.0), CustomPoint<num> followScreenPointOffset = const CustomPoint(0.0, 0.0), Stream<double?>? followCurrentLocationStream, Stream<void>? turnHeadingUpLocationStream, FollowOnLocationUpdate followOnLocationUpdate = FollowOnLocationUpdate.never, TurnOnHeadingUpdate turnOnHeadingUpdate = TurnOnHeadingUpdate.never, Duration followAnimationDuration = const Duration(milliseconds: 200), Curve followAnimationCurve = Curves.fastOutSlowIn, Duration turnAnimationDuration = const Duration(milliseconds: 200), Curve turnAnimationCurve = Curves.easeInOut, Duration moveAnimationDuration = const Duration(milliseconds: 200), Curve moveAnimationCurve = Curves.fastOutSlowIn, Duration rotateAnimationDuration = const Duration(milliseconds: 200), Curve rotateAnimationCurve = Curves.easeInOut, LocationMarkerIndicators indicators = const LocationMarkerIndicators()})
Create a CurrentLocationLayer.

Properties

followAnimationCurve Curve
The curve of the animation of following the map to the current location. Default to Curves.fastOutSlowIn.
final
followAnimationDuration Duration
The duration of the animation of following the map to the current location. Default to 200ms.
final
followCurrentLocationStream Stream<double?>?
The event stream for follow current location. Add a zoom level into this stream to follow the current location at the provided zoom level or a null if the zoom level should be unchanged. Default to null.
final
followOnLocationUpdate FollowOnLocationUpdate
When should the map follow current location. Default to FollowOnLocationUpdate.never.
final
followScreenPoint → CustomPoint<num>
A screen point that when the map follow to the marker. The point (-1.0, -1.0) indicate the top-left corner of the map widget. The point (+1.0, +1.0) indicate the bottom-right corner of the map widget. The point (0.0, 0.0) indicate the center of the map widget. The final screen point is offset by followScreenPointOffset, i.e. (mapWidgetWidth * followScreenPoint.x / 2 + followScreenPointOffset.x, mapWidgetHeight * followScreenPoint.y / 2 + followScreenPointOffset.y).
final
followScreenPointOffset → CustomPoint<num>
An offset value that when the map follow to the marker. The final screen point is (mapWidgetWidth * followScreenPoint.x / 2 + followScreenPointOffset.x, mapWidgetHeight * followScreenPoint.y / 2 + followScreenPointOffset.y).
final
hashCode int
The hash code for this object.
no setterinherited
headingStream Stream<LocationMarkerHeading?>
A Stream that provide heading data for this marker. Default to LocationMarkerDataStreamFactory.fromCompassHeadingStream.
final
indicators LocationMarkerIndicators
The indicators which will display when in special status.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
moveAnimationCurve Curve
The curve of the marker's move animation. Default to Curves.fastOutSlowIn.
final
moveAnimationDuration Duration
The duration of the marker's move animation. Default to 200ms.
final
positionStream Stream<LocationMarkerPosition?>
A Stream that provide position data for this marker. Default to LocationMarkerDataStreamFactory.fromGeolocatorPositionStream.
final
rotateAnimationCurve Curve
The curve of the heading sector rotate animation. Default to Curves.easeInOut.
final
rotateAnimationDuration Duration
The duration of the heading sector rotate animation. Default to 200ms.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
style LocationMarkerStyle
The style to use for this location marker.
final
turnAnimationCurve Curve
The curve of the animation of turning the map to align the heading. Default to Curves.easeInOut.
final
turnAnimationDuration Duration
The duration of the animation of turning the map to align the heading. Default to 200ms.
final
turnHeadingUpLocationStream Stream<void>?
The event stream for turning heading up. Default to null.
final
turnOnHeadingUpdate TurnOnHeadingUpdate
When should the plugin rotate the map to keep the heading upward. Default to TurnOnHeadingUpdate.never.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<CurrentLocationLayer>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited