maplibre / flutter-maplibre-gl

Customizable, performant and vendor-free vector and raster maps, flutter wrapper for maplibre-native and maplibre-gl-js (fork of flutter-mapbox-gl/maps)
https://pub.dev/packages/maplibre_gl
Other
226 stars 125 forks source link

[FEATURE] Get SourceProperties and LayerProperties objects by id #513

Open bakotamas opened 1 month ago

bakotamas commented 1 month ago

Feature Description

Hello!

The getSourceIds and getLayerIds are existing methods of the MapLibreMapController class, they both return a Future<List<String>> of all the ids of the type.

I can't find a way to access the SourceProperties and LayerProperties objects of the sources and layers.

Maybe a SourceProperties? getSourceProperties(String sourceId) and a LayerProperties? getLayerProperties(String layerId) methods would be useful.

I hope its a reasonable request. Regards, Tamas

Additional context

For example, if they would exist, it would be possible to toggle layer visibilities based on the source of the layers, or removing an entire source by id, and then add it back based on the saved properties...