Welcome, guest Sign In



TagMaps Web Services: Badger Callback

Create a more interactive experience for your users by writing a JavaScript function for your TagMaps badge. Whenever a user selects a tag on the TagMap badge, your JavaScript function will be called.

How it works

  1. Use the badger wizard to generate the HTML embed code and a stub function for you. You must specify that you will "Implement Callback".
  2. Implement your JavaScript callback function on the same page where your TagMap is embedded.
  3. The callback function must be specified as:

    function onTagSelected(tag, tagid, tagLat, tagLon, mapMinLat, mapMinLon, mapMaxLat, mapMaxLon, mapZoom)

  4. Congratulations! You have just created an interactive map application on your web page.

function onTagSelected

Whenever a user selects a tag on the TagMap badge, your function will be called with the following paramaters:

Parameter Value Description
tag string the selected tag
tagid string the tagid of the selected tag
tagLat float the latitude of the selected tag
tagLon float the longitude of the selected tag
mapMinlat float the latitude of bottom-left corner of the map
mapMinlon float the longitude of bottom-left corner of the map
mapMaxlat float the latitude of top-right corner of the map
mapMaxlon float the longitude of top-right corner of the map
mapZoom integer Zoom level of the map (using Yahoo! Maps zoom convention: "16" = world, "5" roughly corresponds to a country, "10" is city, and "1" is the lowest street level.)

Developer Support and Community

If you're building something cool with the TagMaps web services, please let us know or just swing on by the mailing list and shoot the wind with other TagMaps developers/users. Do it all in the tagmaps discussion group.


YDN LIBRARIES & BEST PRACTICES

YAHOO! APIs & WEB SERVICES

LANGUAGE CENTERS

Copyright © 2008 Yahoo! Inc. All rights reserved. Copyright | Privacy Policy

Help us continue to improve the Yahoo! Developer Network - Send Your Suggestions