MapControllerImpl class
Implements MapController whilst exposing methods for internal use which should not be visible to the user (e.g. for setting the current camera). This controller is for internal use. All updates to the state should be done by calling methods of this class to ensure consistency.
- Inheritance
-
- Object
- ChangeNotifier
- ValueNotifier<
_MapControllerState> - MapControllerImpl
- Implemented types
Constructors
- MapControllerImpl.new({MapOptions? options, TickerProvider? vsync})
- Constructor of the MapController implementation for internal usage.
Properties
- camera → MapCamera
-
Get the current MapCamera instance. Prefer using
MapCamera.of(context)
if possible.no setteroverride - hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- interactiveViewerState ← MapInteractiveViewerState
-
Link the viewer state with the controller. This should be done once when
the FlutterMapInteractiveViewerState is initialized.
no getter
- isAnimating → bool
-
Getter that returns true if the MapControllerImpl performs a zoom,
drag or rotate animation.
no setter
-
mapEventStream
→ Stream<
MapEvent> -
Stream of all emitted
MapEvent
sno setteroverride - options ↔ MapOptions
-
Used to change MapOptions and update the required widgets.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value ↔ _MapControllerState
-
The current value stored in this notifier.
getter/setter pairinherited-getteroverride-setter
- vsync ← TickerProvider
-
no getter
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
override
-
doubleTapZoomEnded(
MapEventSource source) → void - To be called when a double tap zoom ends.
-
doubleTapZoomStarted(
MapEventSource source) → void - To be called when a double tap zoom starts.
-
dragUpdated(
MapEventSource source, Offset offset) → void - To be called when an ongoing drag movement updates.
-
fitCamera(
CameraFit cameraFit) → bool -
Move and zoom the map to fit
cameraFit
.override -
fitCameraRaw(
CameraFit cameraFit, {Offset offset = Offset.zero}) → bool -
flingAnimatedRaw(
{required double velocity, required Offset direction, required Offset begin, Offset offset = Offset.zero, double mass = 1, double stiffness = 1000, double ratio = 5, required bool hasGesture}) → void - Fling animation for the map. The raw method allows to set all parameters.
-
flingEnded(
MapEventSource source) → void - To be called when a fling gesture ends.
-
flingNotStarted(
MapEventSource source) → void - To be called when a fling gesture does not start.
-
flingStarted(
MapEventSource source) → void - To be called when a fling gesture starts.
-
longPressed(
MapEventSource source, TapPosition tapPosition, LatLng position) → void - Called when a long-press gesture has happened, calls the MapOptions.onLongPress callback and emits a MapEventLongPress event.
-
move(
LatLng center, double zoom, {Offset offset = Offset.zero, String? id}) → bool -
Moves and zooms the map to a
center
andzoom
leveloverride -
moveAndRotate(
LatLng center, double zoom, double degree, {String? id}) → MoveAndRotateResult -
Calls move and rotate together, but is more efficient for the combined
operation
override
-
moveAndRotateAnimatedRaw(
LatLng newCenter, double newZoom, double newRotation, {required Offset offset, required Duration duration, required Curve curve, required bool hasGesture, required MapEventSource source}) → void - Move and rotate the the map with an animation. The raw method allows to set all parameters.
-
moveAndRotateRaw(
LatLng newCenter, double newZoom, double newRotation, {required Offset offset, required bool hasGesture, required MapEventSource source, String? id}) → MoveAndRotateResult - Internal endpoint to move, rotate and change zoom level of the MapCamera.
-
moveAnimatedRaw(
LatLng newCenter, double newZoom, {Offset offset = Offset.zero, required Duration duration, required Curve curve, required bool hasGesture, required MapEventSource source}) → void - Animated movement of the map. The raw method allows to set all parameters.
-
moveEnded(
MapEventSource source) → void - To be called when a drag gesture ends.
-
moveRaw(
LatLng newCenter, double newZoom, {Offset offset = Offset.zero, required bool hasGesture, required MapEventSource source, String? id}) → bool - Internal endpoint to move the MapCamera and change zoom level.
-
moveStarted(
MapEventSource source) → void - To be called when a gesture that causes movement starts.
-
nonRotatedSizeChange(
MapEventSource source, MapCamera oldCamera, MapCamera newCamera) → void - To be called when the map's size constraints change.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
rotate(
double degree, {String? id}) → bool -
Rotates the map to a decimal
degree
around the current center, where 0° is Northoverride -
rotateAnimatedRaw(
double newRotation, {required Offset offset, required Duration duration, required Curve curve, required bool hasGesture, required MapEventSource source}) → void - Animated rotation of the map. The raw method allows to set all parameters.
-
rotateAroundPoint(
double degree, {Offset? offset, String? id}) → MoveAndRotateResult -
Rotates the map to a decimal
degree
around a custom screen point, where 0° is Northoverride -
rotateAroundPointRaw(
double degree, {required Offset? offset, required bool hasGesture, required MapEventSource source, String? id}) → MoveAndRotateResult - Internal endpoint to rotate around a point that is not in the center of the map.
-
rotateEnded(
MapEventSource source) → void - To be called when a rotation gesture ends.
-
rotateRaw(
double newRotation, {required bool hasGesture, required MapEventSource source, String? id}) → bool - Internal endpoint to rotate the MapCamera.
-
rotateStarted(
MapEventSource source) → void - To be called when a rotation gesture starts.
-
secondaryTapped(
MapEventSource source, TapPosition tapPosition, LatLng position) → void - Called when a long-press gesture has happened, calls the MapOptions.onSecondaryTap callback and emits a MapEventSecondaryTap event.
-
setNonRotatedSizeWithoutEmittingEvent(
Size nonRotatedSize) → bool - Set the widget size but don't emit a event to the event system.
-
stopAnimationRaw(
{bool canceled = true}) → void - Stops all ongoing animations of the MapControllerImpl. This is commonly used by other gestures that should stop all ongoing movement.
-
tapped(
MapEventSource source, TapPosition tapPosition, LatLng position) → void - Called when a long-press gesture has happened, calls the MapOptions.onTap callback and emits a MapEventTap event.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited