Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>How do you fetch Google Maps API script ? Is sensor param set to true or false ? I had Safari Geolocation not working (under Windows) until I changed "sensor=false" to "sensor=true" like the example below: </p> <pre><code>&lt;script src="http://maps.googleapis.com/maps/api/js?sensor=true" type="text/javascript"&gt;&lt;/script&gt; </code></pre> <p>And it works perfectly in every browser : IE9, Chrome, FF10+, Safari (Win).</p> <p><strong>Noticed another strange thing</strong> - it works only with WiFi in Safari - if you wired-connected, it won't work and would just stuck trying forever.</p> <p>So, to fix Safari just add the following <code>{ maximumAge: 600000, timeout: 10000 }</code> to handle timeout : </p> <pre><code>// Try W3C Geolocation (Preferred) if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { handleGeolocationAcquired(position.coords.latitude, position.coords.longitude); }, function(error) { handleNoGeolocation(); }, { maximumAge: 600000, timeout: 10000 }); // Try Google Gears Geolocation } else if (google.gears) { var geo = google.gears.factory.create('beta.geolocation'); geo.getCurrentPosition(function (position) { handleGeolocationAcquired(position.latitude, position.longitude); }, function () { handleNoGeolocation(); }); } //Cannot obtain Geo Location else { handleNoGeolocation(); } </code></pre> <p>This way, in case you're in Safari (under Windows) and wired-connected (=> endless loop acquiring Geo location) : after 10 seconds, it will fallback to error handler. <br/> BTW - <strong>maximumAge</strong> param just sets location expiration.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload