I think you'll find that it all works correctly if you use numbers
instead of strings for your lat and lng variables.

These lines convert the data from Number to String
   document.getElementById('txtLatitude').value = point.y;
   document.getElementById('txtLongitude').value = point.x;

When you pull the data back, you need to convert it back to a Number

   createPoint(parseFloat(lat), parseFloat(lng), 3);

Note: Your validateNum() only works with Strings, so don't convert to
Number before calling that.



Javascript can perform unambiguous arithmetic on strings that contain
numeric values, but if you attempt to "+" two such strings it considers
the "+" to represent string concatenation rather than addition.

You can get away with using strings in the Mercator projection most of
the time, but consider this line in
PolarProjection.prototype.fromLatLngToPixel
  var lng = this.pole * (Math.PI/180) * (l.lng() + 180);

If "l.lng()" is the string "123.45" then (l.lng() + 180) is "123.45180",
which is not what you want.

-- 
http://econym.org.uk/gmap
The Blackpool Community Church Javascript Team


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" 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-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to