isn't quite ashamed enough to present

jr conlin's ink stained banana

2006-10-05

::Head Poundy

To: Past Tense Self (circa last week or so)
Subject: YUI Maps 3.4 AJAX Interfaces and the .searchLocal method

Hi there!
So, you're about to start screwing around with .searchLocal as a cheap way to do reverse geocoding for the Y!map API. As you fire up FireBug and start dumping out objects via console.debug, you're going to notice something.

Well, specifically, you're going to have something like
function getLoc (e) {
var center = map.getCenterLatLon();
map.searchLocal(center,'starbucks',10,1);
YEvent.Capture(map,EventsList.onEndLocalSearch,resolveLocation);
}
function resolveLocation (e) {
console.debug (e.Data);
}

What you'll note is that Firebug cheerfully reports that you've got an object containing success = 1. You'll note that this greatly differs from the example code in that there are no ITEMS objects around. What you don't know is that they're there, you just have to kinda-sorta root for them.

If you run a for in loop over the ITEMS[] objects, you'll see:

  1. TITLE
  2. ADDRESS
  3. CITY
  4. STATE
  5. PHONE
  6. LATITUDE
  7. LONGITUDE
  8. RATING An array of Rating objects
  9. DISTANCE from the YGeoPoint
  10. URL the yahoo.local URL with the extra business info (hours, amenties, etc)
  11. BUSINESSURL the business' URL
  12. CATEGORIES Array containing the various y!Local Category objects

See? No need to storm the maps folks with a baseball bat and a weeks worth of hatred and bile.

Just need to make sure they update the Y!Maps docs to be a bit more clear about that.

Put down the baseball bat, future self. Think happy thoughts, Warm sunshine, cool breezes, not sharing a cell with "Pickles".

Alice
2006-10-05 - 22:48:00

At least your problem didn't require you to be two steps away from writing a patch.

Also, I thought the baseball bat disappeared.


Dave Naffziger
2006-10-09 - 15:02:17

After finding that the Google Maps API doesn't present current data, we've just begun investigating some of the Yahoo local/maps APIs at Judy's Book. Incidentally, I also discovered that Yahoo has the most current map data of the 4 major providers.


Hey, delicious user, Save This Page
Blogs of note
personal that's my blog
(The Official Blog of the Internet)
memoirs of hydrogen guy matthew shepherd (quebec) rhapsodic.org j$ (right) Henriette's Herbal Blog fanatical apathy lynne ydw i iconophobia slumbering lungfish
geek Y!Cool Thing michael j radwin jeremy z
(The Official Website of the Internet)
dave's picks ultramookie Josh Woodward derek balling j$ (left) simon willison Yahoo! Search Blog
news ars technica search engine watch webmaster world.com
forums uh.net man-man killroy & tina

experimental

Firefox search plugins for Yahoo!

My Living Room media box config

The Official "Official" Registry of the Internet

Powered by WordPress
Hosted on Dreamhost.