当前位置: 动力学知识库 > 问答 > 编程问答 >

Issue using google-map polymer element multiple times in same page

问题描述:

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

分享给朋友:
您可能感兴趣的文章:
随机阅读: