StyleController class abstract

The StyleController can be used to manipulate the style of a MapLibreMap. It can be accessed via MapController.style.

Constructors

StyleController()
Abstract base constructor for implementations.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addImage(String id, Uint8List bytes) Future<void>
Add an image to the map.
addImageFromAssets({required String id, required String asset}) Future<void>
Load an image from the Flutter assets to the map by its asset path.
addImageFromCanvas({required String id, required void painter(Canvas canvas), int width = 200, int height = 200}) Future<void>
Create an image from a Canvas and add it to the map with the given id.
addImageFromIconData({required String id, required IconData iconData, int size = 200, Color color = const Color(0xFF000000)}) Future<void>
Create an image from IconData and add it to the map with the given id.
addImageFromWidget({required String id, required Widget widget, Size? logicalSize, Size? imageSize, TextDirection textDirection = TextDirection.ltr}) Future<void>
Create an image from a Widget and add it to the map with the given id.
addImages(Map<String, Uint8List> images) Future<void>
Add multiple images to the map where the key is the image ID and the value is the image bytes.
addLayer(StyleLayer layer, {String? belowLayerId, String? aboveLayerId, int? atIndex}) Future<void>
Add a new layer to the map. The source must be added before adding it to the map.
addSource(Source source) Future<void>
Add a new source to the map.
dispose() → void
Clean up resources.
getAttributions() Future<List<String>>
Get a list of all attributions from the map style.
getAttributionsSync() List<String>
Get a list of all attributions from the map style.
getLayerIds() List<String>
For testing purposes only. Will be replaced with a public API.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeImage(String id) Future<void>
Removes an image from the map
removeLayer(String id) Future<void>
Removes the layer with the given id from the map's style.
removeSource(String id) Future<void>
Removes the source with the given id from the map's style.
setProjection(MapProjection projection) → void
Set the map projection.
toString() String
A string representation of this object.
inherited
updateGeoJsonSource({required String id, required String data}) Future<void>
Update the data of a GeoJSON source.

Operators

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