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
186 stars 106 forks source link

Question: How to get sources from MaplibreMapController #342

Closed danieljosua1 closed 7 months ago

danieljosua1 commented 7 months ago

Hi, I'm fairly new to MapLibre and have a question: I get vector files from an Endpoint that contains POIs I want to display on the map. These should display different icons depending on the data type they contain.

await controller.addSource( 'poi_source_id', VectorSourceProperties(tiles: [ 'https://geomap.ivv-aachen.de/geoserver/gwc/service/tms/1.0.0/ivv_gis:rpb_poi@EPSG:900913@pbf/{z}/{x}/{y}.pbf', ], scheme: 'tms', minzoom: 0, maxzoom: 14));

Is there a way to call "map.getSource(sourceId)" like in MapLibre Native Android, to access this source to get the data in it? Unfortunately I have not been able to do this so far. Thanks for your help

m0nac0 commented 7 months ago

Maybe the MaplibreMapController.querySourceFeatures method is what you are looking for?

danieljosua1 commented 7 months ago

Thanks! I will try this one out