I\'m working with the google maps API and trying to stringify an array of points, which each have a latitude and longitude. What I want to do is stringify the data and store
JSON.stringify isn't acting weird... Google maps API sends out their JSON with random keys and you can't work with their keys unfortunately...
If you need to get the latitude and longitude you need to use their API for the same...
You need to use the methods:
lat() and lng() //refer: http://code.google.com/apis/maps/documentation/javascript/reference.html#LatLng
And since you are dealing with points here you need to use the Points API and in this case the lat/lng are properties...
Refer to:http://code.google.com/apis/maps/documentation/javascript/reference.html#Point
If you still wanna go ahead and use stringify :
JSON.stringify({lat: testPoint.y , lon: testPoint.x);