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

Customize My Location button #337

Open Live4win opened 7 months ago

Live4win commented 7 months ago

Is there a way to customize the My Location button which appears on the map view's bottom right corner when MaplibreMap.myLocationEnabled is set to true? Or to create one from scratch which can interact with the map's location marker?

m0nac0 commented 7 months ago

I don't think that the underlying MapLibre libraries we use offer the possibility to style that button.

Live4win commented 7 months ago

I see. I also thougt that I could also make a button which uses the map's controller to turn on/off the 'my location' marker on the map without having the default button already displayed, but I don't see anything exposed on the controller which lets me do that. Is it possible to do it in the first place?

edit: added 'without having the default button already displayed'

m0nac0 commented 7 months ago

I actually don't think that that's possible. If you find a way to do that with the maplibre native/JS libraries we could expose that functionality, but AFAIK (and as far as my quick research shows) it's not possible (though that doesn't have to mean it really isn't possible)