MapController class abstract
Controller to programmatically interact with UMap
.
It allows for map movement through move, rotation through rotate and to fit the map bounds with fitBounds.
It also provides current map properties.
- Implementers
Constructors
- MapController()
-
default implementation of MapController
factory
Properties
- bounds → LatLngBounds?
-
map bounds
no setter
- center → LatLng?
-
center of the map
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isReady → bool
-
is map controller ready to be used
no setter
-
liveStream
→ Stream<
LatLng> ? -
no setter
- map ↔ MapState?
-
map state
getter/setter pair
- onChanged ↔ MapChangedCallback?
-
callback function to be called when map state is changed
getter/setter pair
- onReady ↔ Function?
-
callback function to be called when map controller is ready
getter/setter pair
-
positionStream
→ Stream<
MapData> ? -
stream to listen to current position of the map
no setter
- rotation → double?
-
rotation of the map
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- zoom → double?
-
zoom level of the map
no setter
Methods
-
bearing(
dynamic toDestination, {DistanceAlgorithmType algorithm = DistanceAlgorithmType.Haversine}) → double -
Calculate bearing from current center of the map to
toDestination
. -
destination(
double distance, double bearing, {DistanceAlgorithmType algorithm = DistanceAlgorithmType.Haversine}) → LatLng -
Calculate LatLng destination with
distance
andbearing
from current center of the map. -
dispose(
) → void - dispose map controller
-
distance(
dynamic toDestination, {DistanceAlgorithmType algorithm = DistanceAlgorithmType.Haversine, LengthUnit unit = LengthUnit.M}) → double -
Calculate distance between current center of the map with
toDestination
. -
filterInsideRadius(
List< LatLng> locations, double radius, {DistanceAlgorithmType algorithm = DistanceAlgorithmType.Haversine, LengthUnit unit = LengthUnit.M}) → List<LatLng> -
Filter
locations
to only contains LatLng within a specifiedradius
. -
findLocation(
String query) → Future< LatLng?> - Find LatLng location by address.
-
fitBounds(
dynamic bounds, FitBoundsOptions options) → void - Fits the map bounds. Optional constraints can be defined through the FitBoundsOptions parameter.
-
isInsideRadius(
LatLng location, double radius, {DistanceAlgorithmType algorithm = DistanceAlgorithmType.Haversine, LengthUnit unit = LengthUnit.M}) → bool -
Check if a specific
location
is inside the radius from current center of the map. -
locate(
{bool automove = false, double toZoom = 17.0}) → Future< LatLng?> - Find current LatLng user location
-
move(
dynamic center, {double? zoom, bool animate = false}) → void - Moves the map to a specific location and zoom level.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
rotate(
double rotation, {bool animate = false, Function? onAnimateEnd}) → void - Rotate the map to a specific value.
-
toString(
) → String -
A string representation of this object.
inherited
-
zoomTo(
double zoom, {bool animate = false}) → void - Zoom the map to a specific zoom level.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited