Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    May 2009
    Location
    Moore, OK
    Posts
    282
    Thanks
    11
    Thanked 41 Times in 41 Posts

    Google Maps Geocoding Coordinates Changing

    I search through the forums and google but didn't find anything on this, but I was wondering if anyone was having or has had issues with google maps changing their lat/long coordinates, even when a frozen version is declared?

    Code:
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?v=3.2&amp;sensor=false"></script>
    In the geocoding portion:
    Code:
    geocoder.geocode({'address': query}, function(results, status) {
    	if (status == google.maps.GeocoderStatus.OK) {
    		var coordinates = results[0].geometry.location;
    		point.latitude = coordinates['oa'];
    		point.longitude = coordinates['pa'];
    		return callback();
    	} else {
    		var error = new Object();
    		error.message = 'We were unable to locate your latitude and longitude. Please check your address and try again.<br />';
    		error.callback = function(){};
    		return point.errorHandler(error);
    	}
    });
    The coordinates variable keeps changing the key. Originally it was:
    Code:
    point.latitude = coordinates['xa'];
    point.longitude = coordinates['ya'];
    Then: (and several others)
    Code:
    point.latitude = coordinates['sa'];
    point.longitude = coordinates['ta'];
    Now:
    Code:
    point.latitude = coordinates['oa'];
    point.longitude = coordinates['pa'];
    Why if a frozen version is declared, is this still changing?

  • #2
    Regular Coder
    Join Date
    May 2009
    Location
    Moore, OK
    Posts
    282
    Thanks
    11
    Thanked 41 Times in 41 Posts
    Problem solved...

    You have to use the google functions instead of access their variables directly.

    Code:
    point.latitude = coordinates.lat();
    point.longitude = coordinates.lng();


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •