Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

myLocationButtonEnabled not working on iOS #578

Open
dlcole opened this issue Apr 3, 2024 · 1 comment
Open

myLocationButtonEnabled not working on iOS #578

dlcole opened this issue Apr 3, 2024 · 1 comment

Comments

@dlcole
Copy link

dlcole commented Apr 3, 2024

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.

@dlcole
Copy link
Author

dlcole commented Apr 3, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant