Closed gaurav21r closed 8 years ago
I believe the namespace would be google.map.geometry
. The APIs aren't hung off the element. The Maps API still puts them on the global scope. Alternatively, you can access the API on this element as <element>.api.geometry
@ebidel Thank you for your prompt response!
I tried the namespace in my project but geometry
was not defined. But I tried it in the Polymer catalog example and it did come! I will try to recreate my scenario here somehow.
The <element>.api
you speak of is actually the <google-maps-api>
element and not the <google-map>
. Understandable since it is a static object from the API and instance methods / props would be in <google-maps-api>
. But it isn't very apparent on first look. Can we improve the documentation somehow?
Well technically it's not meant to be accessed by google-map users. It's part of the element's shadow DOM. I'd recommend using the global namespace in your code
When trying to access the
geometry
API via$element.map.geometry
isundefined
.According to the API Docs, this can happen when the
libraries
parameter does not havegeometry
. https://developers.google.com/maps/documentation/javascript/librariesAlthough this https://github.com/GoogleWebComponents/google-apis/blob/master/google-maps-api.html#L115 seems to include all Libraries.