MapState class

Global Map State

Inheritance

Constructors

MapState({required MapController controller, required MapOptions options})

Properties

angle double
Current angle of this map (radian).
getter/setter pair
angleStart double
Initial angle of this map (radian).
getter/setter pair
bounds LatLngBounds
Bounds of this map.
no setter
canRotate bool
Whether user can rotate this map.
no setter
center LatLng
Current center of this map.
no setter
centerMarker → dynamic
Center marker of this map.
no setter
centerPoint UPoint
Center point of this map.
no setter
controller MapController
Map controller.
no setter
crs Crs
Crs of this map.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
hasMaxBounds bool
Whether max bounds of this map is set.
no setter
hasRotation bool
Whether the map is rotated.
no setter
height double
Map height
no setter
isLocating bool
Whether the map is currently searching for user location.
no setter
isNotLocating bool
Whether the map is currently not searching user location.
no setter
liveStream StreamController<LatLng>
Stream to listen to current live user position on the map
no setter
location → Location?
Current user location.
no setter
locationMarker → dynamic
Location marker of this map.
no setter
maxZoom double
Max zoom level.
getter/setter pair
minZoom double
Min zoom level.
getter/setter pair
neBound LatLng?
North east bound of this map.
no setter
onAngleChanged Function
no getter
onLongPress Function?
Callback function to be called when long press on this map.
no setter
onTap Function?
Callback function to be called when tap on this map.
no setter
options MapOptions
Map options.
no setter
originalRotation double
Original initial rotation of this map.
no setter
pixelBounds Bounds
Current pixel bounds.
no setter
pixelOrigin UPoint
Pixel origin of this map.
no setter
position LatLng?
Current user position.
no setter
positionStream StreamController<MapData>
Stream to listen to current data position of the map.
no setter
rotation double
Current rotation degrees of this map.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showCenterMarker bool
Whether the map is showing center marker.
no setter
showLocationMarker bool
Whether the map is showing location marker.
no setter
size Size
Size of this map.
no setter
swBound LatLng?
South west bound of this map.
no setter
width double
Map width
no setter
zoom double
Current zoom level of this map.
no setter

Methods

addChangedListener(Function listener) → void
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
close() → void
close map state
dispose() → void
dispose map state
override
findLocation(String address) Future<LatLng?>
fitBounds(dynamic bounds, [FitBoundsOptions? options]) → void
fitWorld([FitBoundsOptions? options]) → void
getCenterPoint(LatLng? center, [double? zoom]) UPoint
Calculate center point from LatLng center position and zoom level.
getPixelBounds(LatLng? center, double zoom) Bounds
Get pixel bounds based on specified center and zoom level.
getPixelOrigin(LatLng? center, [double? zoom]) UPoint
Calculate pixel origin from LatLng center position and zoom level.
getPixelWorldBounds(double? zoom) Bounds?
Get pixel world bounds with a specified zoom.
getScaledZoom(double fromZoom, double scale) double
getScaleZoom(double scale, [double? fromZoom]) double
Returns the zoom level that the map would end up at, if it is at fromZoom level and everything is scaled by a factor of scale.
getZoomScale(double toZoom, [double? fromZoom]) double
Returns the scale factor to be applied to a map transition from zoom level fromZoom to toZoom.
init(TickerProvider vsync, Function onAngleChanged) Future<void>
latlngToPoint(LatLng? latlng, [double? zoom]) UPoint
Convert latlng position to physical point on screen.
limitZoom([double? zoom]) double
Limit zoom level of this map.
locate([bool automove = false, double zoom = 17.0]) Future<LatLng?>
Tries to locate the current user location.
move(dynamic center, double? zoom, [bool animate = false]) Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
offsetToLatLng(Offset offset, [double? width, double? height]) LatLng?
Convert offset to latlng position on the map.
offsetToPoint(Offset offset) UPoint
Convert offset to point
offsetToSize(Offset offset) Size
Convert offset to size
pointToLatLng(UPoint point, [double? zoom]) LatLng?
Convert physical point on screen to latlng position on the map.
pointToOffset(UPoint point) Offset
Convert point to offset
project(LatLng? latlng, [double? zoom]) UPoint
Convert latlng position to physical point on screen.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
reset() → void
resize(double width, double height) → void
rotate(double rotateTo, [bool animate = false, Function? onAnimateEnd]) → void
sizeToOffset(Size size) Offset
Convert size to offset
toString() String
A string representation of this object.
inherited
unproject(UPoint point, [double? zoom]) LatLng?
Convert physical point on screen to latlng position on the map.
wrapLatLngBounds(LatLngBounds latlngBounds) LatLngBounds
Wrap bounds
zoomAround(dynamic position, double zoom) → void
zoomIn([double zoomDelta = zoomDeltaDef]) → void
zoomOut([double zoomDelta = zoomDeltaDef]) → void
zoomTo(double zoom, [bool animate = false]) → void

Operators

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