Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 两个网络组件之间的绑定:谷歌地图&x2B;地理定位_Javascript_Google Maps_Polymer_Web Component - Fatal编程技术网

Javascript 两个网络组件之间的绑定:谷歌地图&x2B;地理定位

Javascript 两个网络组件之间的绑定:谷歌地图&x2B;地理定位,javascript,google-maps,polymer,web-component,Javascript,Google Maps,Polymer,Web Component,我尝试使用webcomponent google map和组件地理位置,如上的第三个示例: HTML: <geo-location latitude="{{lat}}" longitude="{{lng}}"></geo-location> <google-map latitude="{{lat}}" longitude="{{lng}}" showcentermarker></google-map> <google-map fit=""

我尝试使用webcomponent google map和组件地理位置,如上的第三个示例:

HTML:

<geo-location latitude="{{lat}}" longitude="{{lng}}"></geo-location>
<google-map latitude="{{lat}}" longitude="{{lng}}" showcentermarker></google-map>
<google-map fit="" showcentermarker="" latitude="{{lat}}" longitude="{{lng}}"></google-map>
<geo-location latitude="13" longitude="-73.57572912" watchpos=""></geo-location>

但我的问题是,googlemap组件的{{lat}}和{{lng}}值永远不会在运行时更新

运行时:

<geo-location latitude="{{lat}}" longitude="{{lng}}"></geo-location>
<google-map latitude="{{lat}}" longitude="{{lng}}" showcentermarker></google-map>
<google-map fit="" showcentermarker="" latitude="{{lat}}" longitude="{{lng}}"></google-map>
<geo-location latitude="13" longitude="-73.57572912" watchpos=""></geo-location>

我怀疑您正在使用以下元素:

<body>
  <geo-location ...></geo-location>
  <google-map ...></google-map>
</body>
有关这方面的更多信息,请参阅文档中的章节