-
Notifications
You must be signed in to change notification settings - Fork 27
This element does not work on the same page as a google-map element #15
Comments
At the Polymer Code Labs there was suspicion that this problem originates in the iron-jsonp-library, causing the Google Maps API to be loaded twice. |
@justinfagnani @garlicnation Any pointers for me, if I start looking at the issue myself? |
Do you have a code sample that reproduces the |
Here is a link that reproduces the error live: And here is a link to the element that can show either Google maps or Google StreetView: |
Seems to be showing "You have included the Google Maps API multiple times on this page." all the time now but the "Uncaught TypeError: m[md].maps.Load is not a function" does show up sometimes, we looked at this at the Polymer Code Labs in Amsterdam and looked like a timing issue what error would show... |
The problem is the "libraries" field of the google-maps-api element. google-streetview-pano defaults to "places", and google-map defaults to "". This causes iron-jsonp-library to treat google-map as a separate library and causes the error. The "libraries" object may need to be a singleton, and can only be configured once per application. Additionally, the google api wrapper should refuse to load any library a second time. |
I tried setting google-maps libraries to default to 'places' to test this - and works better and I can see maps and streetview on the same page. But there is still an issue, if I move between iron-pages with streetview being redrawn I get the error in this screenshot and streetviews stop showing. Maybe I should file that separately or is this connected? Seem to be that you can't load GoogleStreetViewPano elements twice in the same iron-pages "session". |
That's right. A recent change of @garlicnation the problem with not loading the library twice is that @rbjarnason that error looks unrelated. Can you file a separate issue? |
Added a note to the docs: 2b11357 |
As we now have a workaround I won't spend more time on this and will leave it up to you guys to find a solution for this in due time. Thanks for your help! :) |
Thanks. I'm going to close this issue then. |
I get errors like:
Uncaught TypeError: m[md].maps.Load is not a function
You have included the Google Maps API multiple times on this page. This may cause unexpected errors.
Any hints how best to fix?
The text was updated successfully, but these errors were encountered: