PLEASE NOTE: The Yahoo! Maps AJAX API is just a beta release and may therefore change. But this is cool, so I had to share.
Well, after an exhaustive five day crash course in AJAX, and a quick brush up on my JavaScript skills (ugh), I finally finished a fairly stable snippet for creating custom Yahoo Maps on a MODx site. So without further ado, here it is. If someone wants to help write a tutorial for using this thing once they figure it out, that would be wonderful (hint, hint). It should be fairly straight forward to configure the snippet, but here is example document content which you can see in action at
http://www.jasoncoward.com/yahoo-maps-ajax-api.html :
<div id="mapContainer"></div>
[[YahooAjaxMap? &zoomLevel=`12` &location=`76904` &mapPortWidth=`392` &mapPortHeight=`488` &yahooAppID=`validYahooAppId` &addZoomLong=`1` &addPan=`1` &geoRssUrl=`http://xml.weather.yahoo.com/forecastrss||p::76904`]]
This uses a GeoRSS feed from Yahoo! Weather to render a marker on the map containing the latest weather information in what is called a Smart Window. I’ll be working on an example that uses the GeoRSS data, and possibly other techniques, to build menus and detail panes that can display additional information outside the map, based on clicking the markers, or opening smart windows when clicking in the menu of markers, etc. For additional info on the Yahoo! Maps API’s and GeoRSS, visit the Yahoo! Developer page at
http://developer.yahoo.net/maps/ajax/index.html
Oh, and you’ll need to get your own Yahoo Web Services Application ID
here in order to make it work, replacing the `validYahooAppId` with the one you are assigned. This also allows you to track usage.
The snippet code is attached as a text file. Just copy and paste the contents into a snippet called YahooAjaxMap, or whatever you want to call it, create a document and save the content. That should be it.
Let me know if you have any questions, or suggestions for the future of the snippet.