Closed PandaWhisperer closed 8 years ago
Update: I was able to achieve what I wanted by using the Map component's mapCreated
promise.
Additionally, it turns out that the mapObject
is also exposed on the component.
Anyhow, the documentation for the loaded
promise is still incorrect, as mentioned in the original issue.
Indeed you are right and it is impossible to resolve it to a map since there might not be a map (you could load the library without instantiating a single map, just to use the autocomplete form). Or you could have multiple maps on the page. Therefore the doc is wrong, I will update that now.
Actually it was a typo in the code, the text description is absolutely correct
Synopsis
The
loaded
promise does not resolve with themap
instance, as described here. Instead, it resolves toundefined
(see manager.js#L10-L12).Background
I am trying to implement Place Search, which requires instantiating
google.maps.places.PlacesService
, which needs an instance of the map object. I currently can't seem to find another way to get a hold of it (other than theloaded
promise).