Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-13-2011, 03:41 PM   PM User | #1
Coyote6
Regular Coder

 
Join Date: May 2009
Location: Moore, OK
Posts: 277
Thanks: 10
Thanked 41 Times in 41 Posts
Coyote6 is an unknown quantity at this point
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?
Coyote6 is offline   Reply With Quote
Old 05-13-2011, 03:50 PM   PM User | #2
Coyote6
Regular Coder

 
Join Date: May 2009
Location: Moore, OK
Posts: 277
Thanks: 10
Thanked 41 Times in 41 Posts
Coyote6 is an unknown quantity at this point
Problem solved...

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

Code:
point.latitude = coordinates.lat();
point.longitude = coordinates.lng();
Coyote6 is offline   Reply With Quote
Reply

Bookmarks

Tags
api, geocoding, google, map, variables

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:59 AM.


Advertisement
Log in to turn off these ads.