ViewModel class

Constructors

ViewModel({ContextMenuBuilder? contextMenuBuilder = const DefaultContextMenuBuilder(), required DisplayModel displayModel, Widget? noPositionView, List<Widget>? overlays})

Properties

contextMenuBuilder ContextMenuBuilder?
getter/setter pair
displayModel DisplayModel
final
hashCode int
The hash code for this object.
no setterinherited
mapDimension Dimension
The width and height of the visible view in mappixels. Note that this is NOT equal to screen-pixels since the view will be scaled by viewScaleFactor in order to gain a better resolution of the tile-images.
no setter
mapViewPosition MapViewPosition?
no setter
noPositionView Widget?
getter/setter pair
observeGesture Stream<GestureEvent>
Receives events when a gesture is recognized. Use this event to eventually stop automatically moving the map
no setter
observeLongTap Stream<TapEvent>
Receives event when the user taps for a longer period at the same position of the screen. This event is sent when the user releases
no setter
observeMoveAroundCancel Stream<MoveAroundEvent>
Receives events to denotes that a user just wanted to long-press at the same position. Cancels a "move-around" start event.
no setter
observeMoveAroundEnd Stream<MoveAroundEvent>
Receives events when the user ended a drag'n'drop event
no setter
observeMoveAroundStart Stream<MoveAroundEvent>
Receives events when the user taps for a longer period at the same position of the screen. This could mean either that the user wants to drag something around or that the user performs a long-tap. In the latter case a observeMoveAroundCancel event will be sent.
no setter
observeMoveAroundUpdate Stream<MoveAroundEvent>
Receives events to denote that the user moves an object around
no setter
observePosition Stream<MapViewPosition>
Receives events when the position or zoom or indoor-level of the map changes
no setter
observeTap Stream<TapEvent>
Receives events when the user taps (short) at the screen
no setter
overlays List<Widget>?
Overlays to the map. Overlays can show things which do not move along with the map. Examples for overlays are zoombuttons.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
viewScaleFactor double
The factor to scale down the map. DisplayModel.deviceScaleFactor scales the size of the map up and make it bigger. With this value
latefinal

Methods

addOverlay(Widget overlay) → void
clearTapEvent() → void
This method is intended to remove the contextmenu. Call this method if the user clicks at the close-icon of the contextmenu
dispose() → void
gestureEvent() → void
An event sent by the FlutterGestureDetector to indicate a user-driven gesture-event. This can be used to switch off automatic movement of the map.
gestureMoveCancelEvent(MoveAroundEvent event) → void
The moveStart event has already been reported but the user decided to cancel the move events
gestureMoveEndEvent(MoveAroundEvent event) → void
gestureMoveStartEvent(MoveAroundEvent event) → void
gestureMoveUpdateEvent(MoveAroundEvent event) → void
getIndoorLevel() int
indoorLevelDown() → void
indoorLevelUp() → void
longTapEvent(TapEvent event) → void
left/upper 0/0 indicates the left-upper corner of the widget (NOT of the screen)
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rotate(double rotation) → void
setCenter(double left, double upper) → void
setIndoorLevel(int indoorLevel) MapViewPosition
setLeftUpper(double left, double upper) → void
setMapViewPosition(double latitude, double longitude) → void
setMapViewPositionAndRotation(double latitude, double longitude, double rotation) → void
setScaleAround(Mappoint focalPoint, double scale) MapViewPosition?
sets the new scale relative to the current zoomlevel. A scale of 1 means no action, 0..1 means zoom-out (you will see more area on screen since at pinch-to-zoom the fingers are moved towards each other)
setViewDimension(double width, double height) Dimension
setZoomLevel(int zoomLevel) MapViewPosition
tapEvent(TapEvent event) → void
The user has tapped at the map. The event has been detected by the FlutterGestureDetector. left/upper 0/0 indicates the left-upper corner of the widget (NOT of the screen)
toString() String
A string representation of this object.
inherited
zoomAround(double latitude, double longitude, int zoomLevel) MapViewPosition
zoomIn() → void
zoomInAround(double latitude, double longitude) → void
zoomOut() → void

Operators

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