Javascript AngularJS和地图API:停止提示计算机';s位置
我创建了我的web应用程序,在该应用程序中,我添加了一个带有以下角度循环的地图和自定义标记:Javascript AngularJS和地图API:停止提示计算机';s位置,javascript,angularjs,html,google-maps,google-maps-api-3,Javascript,Angularjs,Html,Google Maps,Google Maps Api 3,我创建了我的web应用程序,在该应用程序中,我添加了一个带有以下角度循环的地图和自定义标记: <map data-ng-model="mymap" zoom="4" center="[38.50, -95.00]" style="heigth:375px"> <div ng-repeat="item in list"> <marker position="[{{item.coordinates}}]" icon="./images/icon.png"
<map data-ng-model="mymap" zoom="4" center="[38.50, -95.00]" style="heigth:375px">
<div ng-repeat="item in list">
<marker position="[{{item.coordinates}}]" icon="./images/icon.png"
on-click="showInfoWindow('mbar')" />
<info-window id="mbar" >
<div>{{item.name}}</div>
<div class="getdirections">
<a ng-href="http://maps.google.com/?daddr={{item.coordinates}}">Map</a>
</div>
</info-window>
{{item.name}
此部件工作正常,浏览器不会要求授权收集计算机的位置。
在同一网站的另一个页面上,我再次显示一个带有自定义标记的地图,代码更简单:
<map data-ng-model="mymapdetail" zoom="11" center="{{selectedItem.coordinates}}">
<marker position="{{selectedItem.coordinates}}" icon="./images/icon.png" />
在第二个页面中,当我打开它时,所有浏览器都会检测到我在询问计算机的位置。如果我没有回答这个问题,我的自定义标记将正确显示。我一回答,不管我的位置是否相同,标记就消失了。我需要清除缓存以再次显示标记。控制台中不会出现任何错误
问题在哪里?我似乎发现了问题:
第一段:
<marker position="[{{item.coordinates}}]" ...
<marker position="{{selectedItem.coordinates}}"