Your code is just blindly taking the first placemark in the reverse geocoding result. It might not be the best one (but usually is from what I seen)
You can send a viewport along with the request: http://code.google.com/apis/maps/documentation/javascript/v2/reference.html#GClientGeocoder.setViewport setting it to the viewport of the map usually works well, but you can also set it to a small bounding box (of a radius roughy the sort of accuracy you would like. (this is because, rather just blindly picking the absolute closest result, its actully looking for the most 'prominent'. So a point near a village will often return a arbitary adress near the center (where the placename label is drawn) - really just picking the village, but its shown as an address level. You would think it might pick a arbitary address of the edge of the village, but it doesnt do that. So the bounding box is a good way to elevate the ranking of very close points) - Or as Andrew says if just wanting it for directions, can just pass coordinates the directions. It does 'absolute nearest' reverse geocoding automatically :) On 6 November 2010 20:43, graceman9 <[email protected]> wrote: > The problem is that geocoding is incredibly far from given points. > > Example: > http://ezo.org.ua/code/maps/reverse-geocoding-inaccuracy/ > > There are many places around a given point, but I get very distant > results. > Can I get back really nearest point? > > -- > You received this message because you are subscribed to the Google Groups > "Google Maps API V2" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-maps-api?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google Maps API V2" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.
