dapriett / nativescript-google-maps-sdk

Cross Platform Google Maps SDK for Nativescript
MIT License
244 stars 164 forks source link

MapReady not firing on navigation back to map page #374

Closed dlcole closed 4 years ago

dlcole commented 4 years ago

I have a map page with a side menu that allows me to navigate to a settings page, and then back to the map page. Upon return to the map page the MapReady event does not fire, but the usual navigation events (e.e.g, onLoaded) do. Is this the expected behavior? I've tried adding some code in onLoaded to handle this, but it looks like mapView.settings is not reliably set at that time.

tylerablake commented 4 years ago

Hi @dlcole,

I just tested this and the MapReady event fires when I navigate away and back to the map. I'm setting the mapView.settings properties in the code behind.

Are you setting some of those mapView.settings properties in the view or in the code behind?

dlcole commented 4 years ago

@tylerablake thanks for looking at this! I was able to remove the code in onNavigatingFrom and onLoaded that referenced mapView.settings and that eliminated the crashes I was seeing. It's still the case for me that mapReady isn't firing navigating back to the map page, but that's no longer a problem. For now, I'll chalk that up as a curiosity.