问题描述:

We are trying use google-map element from Iron Elements.

<google-map latitude="37.77493" longitude="-122.41942" api-key="XXXXX" version="3.exp" libraries="places" > </google-map>

We are trying to load it dynamic/via ajax load. We are facing the issue regarding load of maps api multiple times. We realized its same issue when we use multiple instances of google-map element in same page.

You have included the Google Maps API multiple times on this page.

This may cause unexpected errors.

Is there a workaround from this issue?

Edit:

google-maps-api element states:

Any number of components can use <google-maps-api> elements, and the

library will only be loaded once.

If this is happening, I hope we should not face multiple load issue.

网友答案:

This is a known issue with the google maps component. There is a workaround: you have to define the same libraries attribute to each element you use.

https://github.com/GoogleWebComponents/google-streetview-pano/issues/15

相关阅读:
Top