Discussion:
gclientgeocoder getLocations reverse
Tiones
2009-04-02 01:16:12 UTC
Permalink
Good morning, folks I'm new here, I'm from Brazil, I am trying to use
a feature of google maps gclientgeocoder getLocations reverse, but not
able to, my goal is to insert the value of the latitude, longitude and
find the address, type the example below you see in a page,
http://graargh.returnstrue.com/rajdeep/maps/tools/latlong_tool/v7/lat-long-tool_v7.html
if someone can help me thank
Mike Williams
2009-04-02 07:25:20 UTC
Permalink
The reverse geocoding seems to be working OK, but I can see two other
problems:

In this code
marker = new GMarker(point);
markers.push(marker);
map.addOverlay(new GMarker(point));
The marker that gets stored in markers[] isn't the one that gets
addOverlay()ed. So when you try to open the info window on
markers[row_no-1] it fails because that marker is not added to a map.


In this code
GEvent.addListener(map, 'click', function(overlay, latlng) {
var lat = latlng.lat();
You fail to check whether the click occurred on an overlay or on the
underlying map. If you click on an existing marker, then "overlay" is a
reference to that marker, and "latlng" is void. So latlng.lat() does not
exist and the code crashes.
--
http://econym.org.uk/gmap
The Blackpool Community Church Javascript Team
Loading...