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
215 stars 117 forks source link

Is there any way to reload the source for the added tile layer? #302

Open KostyaLocal opened 1 year ago

KostyaLocal commented 1 year ago

If I delete the layer and the source, the blinking occurs. I found that if I change tileUrl of source in js MapBox, it will reload, but there is no access to source object in the controller in maplibre.

mariusvn commented 10 months ago

This issue needs more clarification and context in order to be understood and maybe resolved.

m0nac0 commented 10 months ago

In principle, we could add a generic setSourceProperty method to MaplibreMapController, similar to the setLayerProperty method added in #303, then you could use that to update the tileUrl and reload the source (assuming that also works in the native libraries).

m0nac0 commented 10 months ago

I tried adding such a method, but it seems that

So while the generic updateSourceProperty method I had in mind doesn't seem possible (at least right now), it may be possible able to implement

KostyaLocal commented 9 months ago

In principle, we could add a generic setSourceProperty method to MaplibreMapController, similar to the setLayerProperty method added in #303, then you could use that to update the tileUrl and reload the source (assuming that also works in the native libraries). I'd really appreciate it. The case is very useful to redraw the map when the poi layer on the server has changed.

l2-flutter-dev commented 4 months ago

I'd really appreciate this as well, I'm looking for a way to update the tileUrl and this would be exactly what I need.