I have copied and augmented some of the Geocode javascript  and it
does work on Safari and Chrome but not Firefox. I am using it to
generate the coordinates of a user by first trying Location Aware
Browsing (LAB) and if that fails letting a user click on a map to find
the coordinates. What happens is when I click don't allow when first
trying the LAB,  the call to handleNoGeolocation is not made (in FF).
I am a PHP user and not so much a JS user so I am flying a bit in the
dark here. I am rewriting my PHP to use JS to avoid the 620 errors I
was getting on the server side.

example link http://s.ocial.ly/public/new/index.php (be sure to click
don't allow to see the error)

code

function initialize() {
  var myOptions = {
    zoom: 6,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  };
  map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);

  // Try W3C Geolocation method (Preferred)
  if(navigator.geolocation) {
    browserSupportFlag = true;
    navigator.geolocation.getCurrentPosition(function(position) {
    initialLocation = new
google.maps.LatLng(position.coords.latitude,position.coords.longitude);
    alert("Location Aware Browsers are so cool! You have successfully
shared your location.");
    window.location='/public/new/index.php?
browserlocation=1&lat='+position.coords.latitude
+'&long='+position.coords.longitude;
    }, function() {
      handleNoGeolocation(browserSupportFlag);
    });
  } else {
    // Browser doesn't support Geolocation
    browserSupportFlag = false;
    handleNoGeolocation(browserSupportFlag);
  }
}

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to