plugins
plugins copied to clipboard
myLocationButtonEnabled not working on iOS
On iOS, using v1.7.1 of @nativescript/google-maps and specifying
map.myLocationEnabled = true;
map.uiSettings.myLocationButtonEnabled = true;
causes the myLocation Button to be displayed and shows a shadow when selected, but the camera position/zoom does not change. The same code works correctly on Android.
Working through this code in a debugger:
didTapMyLocationButtonForMapView(mapView: GMSMapView): boolean {
this._owner?.get?.().notify?.({
eventName: MapView.myLocationButtonTapEvent,
object: this._owner?.get?.(),
});
return true;
}
I can see that there are no observers for the event. This is likely a hack, but if I return false instead of true, then the camera position moves to the current location, as expected.
This is in google-maps/index.ios.ts
It would be nice to get this wired up for iOS.
Thanks