Closed scottix closed 3 years ago
Another comment/issues I found. I was playing with the plugin and was able to reinitialize the map, but turns out there is a race condition with mapRef
mapRef is set to null and will only get initialized when the div is mounted. You don't see the issue right now because by the time the GoogleMap api loads the div is ready.
In the reinitialize case the api is already loaded but mapRef is null because it hasn't been mounted yet.
One solution would be is to put the promise in a variable and then use onMounted function continue loading.
Can you provide a minimal reproduction of these issues @scottix ?
In a SPA, the component can get unMounted when I navigate to another page, but if I return to the page with the map or go to another page that has a map. The component doesn't get reinitialized, this is because the google map loader has already loaded previous api.
I think you should check if google.map is available, if is then you can just re-configure the map.