Click here to Skip to main content
11,920,772 members (59,873 online)
Rate this:
Please Sign up or sign in to vote.
See more: Javascript HTML
How to get the Latitude and Longitude from google maps.

here is my code

function onloadHandler()
var loc = new google.maps.LatLng(how to get the lat and long here...)


Thanks in advance
Posted 18-Jan-13 13:00pm
Garth J Lancaster 18-Jan-13 19:20pm
I'm not sure your question is entirely clear

How to get the Lat & Long OF WHAT ??? - Your position, the position of some other entity like a building or landmark, or a marker that was added to the map.

If you're after 'you're own position', depending on what sort of device you're doing this on, why not read it directly from the devices GPS sensors ? (eg iPhone, Android) .. because if you're looking at a Google map on these devices, showing 'your position' on the map, thats one way they know where you are to be able to plot it ...

If you're looking for 'some other Lat/Long', then you're going to need to elaborate a bit more
bandi-ramesh 19-Feb-13 12:04pm
need more and exact explanation

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 548
1 Dave Kreskowiak 245
2 phil.o 170
3 KrunalRohit 134
4 F-ES Sitecore 130
0 OriginalGriff 6,778
1 KrunalRohit 4,530
2 Sergey Alexandrovich Kryukov 3,203
3 George Jonsson 2,815
4 Suvendu Shekhar Giri 2,181

Advertise | Privacy | Mobile
Web03 | 2.8.151120.1 | Last Updated 18 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100