I added My Location button + on click event like this:
FloatingActionButton(
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(12.0))),
child: const Icon(Icons.gps_fixed_sharp, size: 25),
onPressed: () async {
try {
var position = await _determinePosition();
mapController?.animateCamera(CameraUpdate.newLatLngZoom(LatLng(position.latitude, position.longitude), 17));
} catch (e) {
FToast.toast(context, msg: e.toString());
}
},
)
So, after location determined, camera is animated to my location. It works, but I'm getting problem with blue point showing my current location on map. It's enabled by default with myLocationEnabled: true, in MapboxMap constructor. It's visible only when app is started with location permissions allowed.
After user taps "My Location" button, app displays prompt to allow location permissions, then determines location and moves camera. However, in this case, still MapBox does not show my location point - I need to restart app to get it visible.
How to tell Mapbox that location permissions have been granted to show my location point on map? I can't find any method inside map controller to do so.