Geeks With Blogs

News



Add to Google

Tim Hibbard CEO for EnGraph software

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);
   });

Posted on Friday, January 13, 2006 9:24 AM Mapping | Back to top


Comments on this post: Get Lat / Long from Google Map

# re: Get Lat / Long from Google Map
Requesting Gravatar...
Excellent, that was exactly what I needed to get my lat and long!

Thanks from those of us whose Javascript is a bit rusty!
Left by Richard on Mar 10, 2006 3:10 AM

# re: Get Lat / Long from Google Map
Requesting Gravatar...
Excellent - wish I'd seen it earlier
Left by GNorman on Aug 09, 2007 2:17 AM

# re: Get Lat / Long from Google Map
Requesting Gravatar...
Extelent, thanks.
Left by Anonymous on Dec 12, 2007 5:51 PM

# re: Get Lat / Long from Google Map
Requesting Gravatar...
I think your API key went away, the map isn't showing.
Left by Ken on Mar 20, 2008 1:36 PM

# re: Get Lat / Long from Google Map
Requesting Gravatar...
It seems to work alright in IE, but something is wrong in firefox. Thanks for letting me know Ken.
Left by Tim Hibbard on Mar 20, 2008 10:12 PM

# re: Get Lat / Long from Google Map
Requesting Gravatar...
excellent
Left by guest on Jul 23, 2008 10:32 PM

# re: Get Lat / Long from Google Map
Requesting Gravatar...
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.
Left by jimbo on Aug 12, 2008 12:21 PM

# re: Get Lat / Long from Google Map
Requesting Gravatar...
Just enter in the google maps search, something like:

35.0,-89.0


and off it goes!
Left by Your Name on Aug 20, 2008 11:25 AM

Your comment:
 (will show your gravatar)


Copyright © Tim Hibbard | Powered by: GeeksWithBlogs.net