plugins
plugins copied to clipboard
Google Maps myLocationEnabled
Hi,
I'm trying to enable the "My Location" button. This worked previous but now appears to not work. Any ideas what I may be doing wrong?
onMapReady({ map }: { map: GoogleMap }) {
geolocation.enableLocationRequest(false, true)
.then(() => {
geolocation.isEnabled().then(isEnabled => {
if (!isEnabled) {
return;
}
map.myLocationEnabled = true;
});
});
}
@maddockst you need to use a custom LocationSource https://developers.google.com/android/reference/com/google/android/gms/maps/GoogleMap#setLocationSource(com.google.android.gms.maps.LocationSource)