我试图在组件地理位置上使用webcomponent google-map,如http://ebidel.github.io/geo-location/components/geo-location/上的第三个示例:
HTML:
<geo-location latitude="{{lat}}" longitude="{{lng}}"></geo-location>
<google-map latitude="{{lat}}" longitude="{{lng}}" showcentermarker></google-map>但我的问题是,运行时的google-map组件的{lat}和{lng}}值从未更新过。
运行时:
<google-map fit="" showcentermarker="" latitude="{{lat}}" longitude="{{lng}}"></google-map>
<geo-location latitude="13" longitude="-73.57572912" watchpos=""></geo-location>发布于 2014-12-17 10:24:28
我怀疑你在使用这样的元素:
<body>
<geo-location ...></geo-location>
<google-map ...></google-map>
</body>但是声明性数据绑定只在聚合物元素内部工作,或者如果您用template is="auto-binding"包围它们的话。
<body>
<template is="auto-binding">
<geo-location ...></geo-location>
<google-map ...></google-map>
</template>
</body>有关此问题的更多信息,请参阅文档中的“使用自动绑定模板元素”一章。
https://stackoverflow.com/questions/27518166
复制相似问题