lundi 16 février 2015

AngularJS and Maps API: stop prompting for computer's location


I created my web application, in which I added a map and custom markers with the following Angular loop:



<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://ift.tt/1B9F4LF}}">Map</a>
</div>
</info-window>


This part works correctly and the browser does not ask the authorization to collect the computer's location. On a different page of the same website, I again show a map with custom marker with this simpler code:



<map data-ng-model="mymapdetail" zoom="11" center="{{selectedItem.coordinates}}">
<marker position="{{selectedItem.coordinates}}" icon="./images/icon.png" />


In this second page, when I open it, all browsers detects that I am asking for computer's location. If I don't answer to the question, my custom marker is correctly shown. As soon as I answer, regardless of sharing or not my position, the marker disappears. I need to clear the cache to show the marker again. No errors appear in the console.


Where is the issue?





Aucun commentaire:

Enregistrer un commentaire