How to create google maps Latlng object from latitude and longitude string
Convert a string like (latitude,longitude) into a LatLng object
In previous article I explained about GME (Google Maps Engine) - An Overview, How to calculate angle of line between two points in JavaScript? , How to Show Google Map Multiple Markers Info Window in Java Script - API Google Maps and many more.
Here we will see how to convert string (latitude,longitude) value into a google maps LatLng object. Find the source code below:
function CreateLatLngObject(Latitude, Longitude) {
var latlng = new
google.maps.LatLng(parseFloat(Latitude), parseFloat(Longitude));
return latlng;
}
I hope this will help you.
Please leave your comments, suggestions and queries about this post in the comment sections in order for me to improve my writing skills and to showcase more useful posts. Thanks for reading .. :)
How to create google maps Latlng object from latitude and longitude string
Reviewed by Ravi Kumar
on
11:35 AM
Rating:

No comments: