GebetaMap class
Shows a MapLibre map.
Also refer to the documentation of gebeta_gl
and GebetaMapController.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- GebetaMap
Constructors
-
GebetaMap.new({Key? key, required CameraPosition initialCameraPosition, String styleString = MapLibreStyles.demo, MapCreatedCallback? onMapCreated, OnStyleLoadedCallback? onStyleLoadedCallback, Set<
Factory< ? gestureRecognizers, bool compassEnabled = true, CameraTargetBounds cameraTargetBounds = CameraTargetBounds.unbounded, MinMaxZoomPreference minMaxZoomPreference = MinMaxZoomPreference.unbounded, bool rotateGesturesEnabled = true, bool scrollGesturesEnabled = true, bool zoomGesturesEnabled = true, bool tiltGesturesEnabled = true, bool? doubleClickZoomEnabled, bool dragEnabled = true, bool trackCameraPosition = false, bool myLocationEnabled = false, MyLocationTrackingMode myLocationTrackingMode = MyLocationTrackingMode.none, MyLocationRenderMode myLocationRenderMode = MyLocationRenderMode.normal, Point<OneSequenceGestureRecognizer> >num> ? logoViewMargins, CompassViewPosition? compassViewPosition, Point<num> ? compassViewMargins, AttributionButtonPosition? attributionButtonPosition = AttributionButtonPosition.bottomRight, Point<num> ? attributionButtonMargins, Duration? iosLongClickDuration, OnMapClickCallback? onMapClick, OnUserLocationUpdated? onUserLocationUpdated, OnMapClickCallback? onMapLongClick, OnCameraTrackingDismissedCallback? onCameraTrackingDismissed, OnCameraTrackingChangedCallback? onCameraTrackingChanged, OnCameraIdleCallback? onCameraIdle, OnMapIdleCallback? onMapIdle, TransformRequestCallback? transformRequest, String? apiKey, List<AnnotationType> annotationOrder = const [AnnotationType.line, AnnotationType.symbol, AnnotationType.circle, AnnotationType.fill], List<AnnotationType> annotationConsumeTapEvents = const [AnnotationType.symbol, AnnotationType.fill, AnnotationType.line, AnnotationType.circle]}) -
const
Properties
-
annotationConsumeTapEvents
→ List<
AnnotationType> -
Defines the layer order of click annotations
final
-
annotationOrder
→ List<
AnnotationType> -
Defines the layer order of annotations displayed on map
final
- apiKey → String?
-
API key for authentication with tile servers.
If provided, it will be added as a bearer token in the Authorization header for all requests.
This is a convenience parameter that internally creates a transformRequest function.
If both apiKey and transformRequest are provided, transformRequest takes precedence.
final
-
attributionButtonMargins
→ Point<
num> ? -
Set the layout margins for the Gebeta Attribution Buttons. If you set this
value, you may also want to set attributionButtonPosition to harmonize
the layout between iOS and Android, since the underlying frameworks have
different defaults.
final
- attributionButtonPosition → AttributionButtonPosition?
-
Set the position for the Gebeta Attribution Button
When set to null, the default value of the underlying Gebeta libraries is used,
which differs depending on the operating system the app is being run on.
final
- cameraTargetBounds → CameraTargetBounds
-
Geographical bounding box for the camera target.
final
- compassEnabled → bool
-
True if the map should show a compass when rotated.
final
-
compassViewMargins
→ Point<
num> ? -
Set the layout margins for the Compass
final
- compassViewPosition → CompassViewPosition?
-
Set the position for the Compass
final
- doubleClickZoomEnabled → bool?
-
Set to true to forcefully disable/enable if map should respond to double
click to zoom.
final
- dragEnabled → bool
-
True if drag functionality should be enabled.
final
-
gestureRecognizers
→ Set<
Factory< ?OneSequenceGestureRecognizer> > -
Which gestures should be consumed by the map.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialCameraPosition → CameraPosition
-
The initial position of the map's camera.
final
- iosLongClickDuration → Duration?
-
How long a user has to click the map on iOS until a long click is registered.
Has no effect on web or Android. Can not be changed at runtime, only the initial value is used.
If null, the default value of the native MapLibre library / of the OS is used.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
logoViewMargins
→ Point<
num> ? -
Set the layout margins for the Logo
final
- minMaxZoomPreference → MinMaxZoomPreference
-
Preferred bounds for the camera zoom level.
final
- myLocationEnabled → bool
-
True if a "My Location" layer should be shown on the map.
final
- myLocationRenderMode → MyLocationRenderMode
-
Specifies if and how the user's heading/bearing is rendered in the user location indicator.
See the documentation of MyLocationRenderMode for details.
If this is set to a value other than MyLocationRenderMode.normal, myLocationEnabled needs to be true.
final
- myLocationTrackingMode → MyLocationTrackingMode
-
The mode used to let the map's camera follow the device's physical location.
myLocationEnabled
needs to be true for values other thanMyLocationTrackingMode.None
to work.final - onCameraIdle → OnCameraIdleCallback?
-
final
- onCameraTrackingChanged → OnCameraTrackingChangedCallback?
-
Called when the location tracking mode changes
final
- onCameraTrackingDismissed → OnCameraTrackingDismissedCallback?
-
Called when the map's camera no longer follows the physical device location, e.g. because the user moved the map
final
- onMapClick → OnMapClickCallback?
-
final
- onMapCreated → MapCreatedCallback?
-
Please note: you should only add annotations (e.g. symbols or circles) after
onStyleLoadedCallback
has been called.final - onMapIdle → OnMapIdleCallback?
-
Called when map view is entering an idle state, and no more drawing will
be necessary until new data is loaded or there is some interaction with
the map.
final
- onMapLongClick → OnMapClickCallback?
-
final
- onStyleLoadedCallback → OnStyleLoadedCallback?
-
Called when the map style has been successfully loaded and the annotation managers have been enabled.
Please note: you should only add annotations (e.g. symbols or circles) after this callback has been called.
final
- onUserLocationUpdated → OnUserLocationUpdated?
-
While the
myLocationEnabled
property is set totrue
, this method is called whenever a new location update is received by the map view.final - rotateGesturesEnabled → bool
-
True if the map view should respond to rotate gestures.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollGesturesEnabled → bool
-
True if the map view should respond to scroll gestures.
final
- styleString → String
-
A Gebeta GL style document defining the map's appearance.
The style document specification is at
https://maplibre.org/maplibre-style-spec
. A short introduction can be found in the documentation of thegebeta_gl
library. The following formats are supported:final - tiltGesturesEnabled → bool
-
True if the map view should respond to tilt gestures.
final
- trackCameraPosition → bool
-
True if you want to be notified of map camera movements by the GebetaMapController. Default is false.
final
- transformRequest → TransformRequestCallback?
-
A callback that can transform tile requests by modifying URLs and adding headers.
This is particularly useful for adding authentication headers to tile requests.
final
- zoomGesturesEnabled → bool
-
True if the map view should respond to zoom gestures.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< StatefulWidget> -
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, int wrapWidth = 65}) → 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
Static Properties
- useHybridComposition ↔ bool
-
Set
GebetaMap.useHybridComposition
tofalse
in order use Virtual-Display (better for Android 9 and below but may result in errors on Android 12) or leave ittrue
(default) to use Hybrid composition (Slower on Android 9 and below).getter/setter pair