Yahoo Maps APIs hard to use

>elusive result with yahoo maps image API

I’m incredulous how difficult it has been to find a method to simply display a Map (using the Map Image API) , from a URL call of the form:

http://api.local.yahoo.com/MapsService/V1/mapImage?appid=
YahooDemo&street=701+First+Avenue&city=Sunnyvale&state=CA

The fact that these calls return an XML result seemed trivial at first, but this has proven so frustrating, I’m ready to go back to Google.

Notice the documentation:

http://developer.yahoo.com/maps/rest/V1/mapImage.html — does a fine job of describing the variables you can use to create your call URL, but stops short of telling you how to display it on a page. I’m sure the “last step” is abundantly clear to all you programmers, but I find it an inexcusable lapse that no demonstration code is provided that actually results in the display of a map on a page. WTF!?

Undertaking a search within developer.yahoo for the solution lead me to this page:

http://developer.yahoo.com/php/howto-parseRestPhp.html — which should have been the end of my search, if it had contained a code example I might apply to the Map Image API. But, unbelievably, the only code example I could use (while I wait for my host to install DOM XML) was this:

http://developer.yahoo.com/php/samples/request/requestFILEGC.txt

… which gives a (hold on to your hat) XML OUTPUT!!!!

// Output the XML
echo htmlspecialchars($xml, ENT_QUOTES);
?>

… as the scripts final result.

I’m attracted to the Map Image API because it’s so straightforward, but can’t for the life of me understand why such an easy to use method for getting maps has been convoluted into near uselessness in this manner. For christ sake’s if you offer the API, then provide even ONE example of code that actually results in the display of a Map.

Can anyone please provide me with a basic method for converting the contents of the < Result> tags into an image I can display on my page?

The effect I want is:

< img
src="http://api.local.yahoo.com/MapsService/V1/mapImage?
appid=YahooDemo&street=701+First+Avenue&city=Sunnyvale&state=CA

Leave a Reply

You must be logged in to post a comment.