Javascript decimal to degrees for google maps


/ Published in: JavaScript
Save to your folder(s)

When you show the coordinates of a point, it’s sometimes better to show them as degrees and not as deciaml (even if decimal is simpler). Each of the two coordinates can be converted with the same function. In the function call the “tipo” is the type of the “v” value: if you call the function without the type, then the default type is “N”, that means “NORTH”, it means that you’re converting a Latitude value. Values for latitude type are “N” for NORTH and “S” for SOUTH.
If you specify “E” or “W” than you’re converting a Longitude value.

URL: http://www.barattalo.it/2009/12/26/decimal-degrees-conversion-and-distance-of-two-points-on-google-map/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.