Tim Hibbard

Software Architect for EnGraph software
posts - 605, comments - 394, trackbacks - 507

My Links

News



Add to Google





Twitter












Tag Cloud

Article Categories

Archives

Post Categories

Image Galleries

EnGraph Blogs

Links

Other

Roll

Get Lat / Long from Google Map

Quite often, I need the lat/long of a location. I've always used the tool from conversationswithmyself.com, but there are a couple things that I don't like about it.

1) Map is too small
2) Map does not have a zoom control

So I built my own (http://www.timhibbard.com/geoinfo/)

Here is the javascript code:

var map = new GMap(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
var point = new GPoint(-95.31549, 38.97663);
map.centerAndZoom(point, 10);
lstner = GEvent.addListener(map, 'click', function(overlay, point){
   var pointA = new GPoint(point.x, point.y);
   var mark = new GMarker(pointA);
   map.addOverlay(mark);
   map.centerAtLatLng(point);
   GEvent.addListener(mark, 'click', function(){
      mark.openInfoWindowHtml("long = " + point.x + ", lat = " + point.y);
      });
   mark.openInfoWindowHtml("long = " + point.x + ", lat = " + point.y);
   });

Print | posted on Friday, January 13, 2006 9:24 AM | Filed Under [ Mapping ]

Feedback

Gravatar

# re: Get Lat / Long from Google Map

Excellent, that was exactly what I needed to get my lat and long!

Thanks from those of us whose Javascript is a bit rusty!
3/10/2006 3:10 AM | Richard
Gravatar

# re: Get Lat / Long from Google Map

Seaport
2/19/2007 4:57 PM | seaport
Gravatar

# re: Get Lat / Long from Google Map

Excellent
4/7/2007 2:39 PM | Murali
Gravatar

# re: Get Lat / Long from Google Map

Excellent - wish I'd seen it earlier
8/9/2007 2:17 AM | GNorman
Gravatar

# re: Get Lat / Long from Google Map

Extelent, thanks.
12/12/2007 5:51 PM | Anonymous
Gravatar

# re: Get Lat / Long from Google Map

I think your API key went away, the map isn't showing.
3/20/2008 1:36 PM | Ken
Gravatar

# re: Get Lat / Long from Google Map

It seems to work alright in IE, but something is wrong in firefox. Thanks for letting me know Ken.
3/20/2008 10:12 PM | Tim Hibbard
Gravatar

# re: Get Lat / Long from Google Map

excellent
7/23/2008 10:32 PM | guest
Gravatar

# re: Get Lat / Long from Google Map

what site will give me a map if I already know lat,long??

Eg, something like this:

http://maps.google.com/yadda.php?lat=35.0,lon=-89.0

I found a private site here: but I dont want to link to it...
http://www.gorissen.info/Pierre/maps/googleMapLocation.php?lat=35.000000&lon=-89.000000

I cant seem to find one...
Thanks for any leads.
8/12/2008 12:21 PM | jimbo
Gravatar

# re: Get Lat / Long from Google Map

Just enter in the google maps search, something like:

35.0,-89.0


and off it goes!
8/20/2008 11:25 AM | Your Name

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 3 and 3 and type the answer here:

Powered by: