Wasn't it argv01 who wrote:
>The fact that these two functions, getLatLng and getLocations, are
>passed different params is causing me no end of frustration.
>
>Because there's no "singular" version of getLocations (ie.,
>"getLocation"), I can't pass it strings like "london, england" just to
>get a marker for that location. As you can imagine, it returns a great
>number of Placemarks.

getLocations("london, england") does not return a great number of 
Placemarks, it returns one, and the Point.coordinates of that Placemark 
are the same as the .getLatLng location.

getLatLng() doesn't have its own interface to the server. It simply 
makes a .getLocations() call and extracts a GLatLng from the 
Point.coordinates of the first Placemark.

>Because there's not a "getLocation()" (where the parser would only
>view it as a single address), I am forced to use getLatLng(). But the
>params passed to its callback function are not as full-featured as
>those passed to the getLocations() callback, which I need for all
>sorts of error-handling and other general diagnostics, not to mention
>useful UI feedback.
>
>getLatLng only gets a single Point variable, and in order to preserve
>which address is used, I have to use the callback as an in-line
>function, which is inelegant, not to mention clumsy when you have to
>incorporate many other things. It also gets unnecessarily lengthy when
>you're passing multiple addresses in a loop.

The elegant solution would be to use Function Closure.

>Context:
>
>My photography websites hosts about 50,000 images, and there are many
>toplevel pages that now contain maps indicating where the photos were
>taken. The maps are NOT based on the geographical region of the client
>browser, but on the specifics of the photos themselves. So, when
>passing information for each image, I have to pass country information
>as well as others to reduce ambiguity of the geocoder.  I often have
>to actually include the continent name as well to keep names like
>"Scotland" being confused with "Scotland, Ohio", which is what the map
>will show me because MY browser happens to be in the US.

I don't believe that.

Unless you supply a country bias, Scotland UK always trumps Scotland 
Ohio.

>An example is http://www.danheller.com/windows.html
>(Note that the map only displays markers for a few places--the
>geocoder fails to parse arbitrary names like "buenos aires, argentina"
>and many others. But that's a different issue that will get a separate
>thread.)

Using getLocations() will also reveal the fact that many of your 
requests are failing with error 620, because you're exceeding the 
geocoding speed limit. Don't attempt to re-geocode each photo every time 
someone opens your page. Geocode each photo once and store the 
coordinates in your database.

-- 
Mike Williams
http://econym.org.uk/gmap


--

You received this message because you are subscribed to the Google Groups 
"Google Maps API" 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.


Reply via email to