Can we add marker in google Map using XY co ordinates

1,932 views
Skip to first unread message

Anirudha

unread,
Apr 20, 2011, 12:37:22 AM4/20/11
to Google Maps JavaScript API v3
Hi
I am using Google map in my application.
I am adding marker on Google map by using LAT/LONG of the point as
shown below

var marker = new google.maps.Marker({ position: new
google.maps.LatLng(LatValue,LongValue), map: map, title: MyTitle,
icon:MyIcon });

But it is found that in my case instead of LAT/LONG values , XY co
ordinates are available.
So can we plot marker using XY co ordinates something like this

var marker = new google.maps.Marker({ position: new
google.maps.LatLng(X Co ordinate,Y Co ordinate), map: map, title:
MyTitle, icon:MyIcon });

Is there any formula/method of converting XY co ordinate to LAT/
LONG?

Thanks & Regards,
Anirudha Deshpande

geoco...@gmail.com

unread,
Apr 20, 2011, 1:28:33 AM4/20/11
to Google Maps JavaScript API v3
There are lots of them. You need to know the coordinate system that x
and y are in (are they pixels?) and their units.

Usually on a _map_ (particularly one like google maps which uses a
mercator projection), latitude and longitude make the most sense.

-- Larry

Martin™

unread,
Apr 20, 2011, 6:42:02 PM4/20/11
to Google Maps JavaScript API v3
Reply all
Reply to author
Forward
0 new messages