Often, it is useful to execute JavaScript in response to activity in the map. For example, maybe you'd like to display additional information when a state is clicked. Or, you'd like to highlight the name of city when it is hovered over in the map. To make such interactivity possible, our maps can call predefined JavaScript functions when certain events occur. To utilize this functionality, follow these steps:
simplemaps_worldmap_click(id) | This function is called when a state is clicked. id is the state's id. |
simplemaps_worldmap_locclick(id) | This function is called when a location is clicked. id is the location's id. |
simplemaps_worldmap_region_click(id) | This function is called when a region is clicked. id is the region's id. |
simplemaps_worldmap_over(id) | This function is called when a state is hovered over. id is the state's id. |
simplemaps_worldmap_out(id) | This function is called when a state is hovered out. id is the state's id. |
simplemaps_worldmap_locover(id) | This function is called when a location is hovered over. id is the location's id. |
simplemaps_worldmap_locout(id) | This function is called when a location is hovered out. id is the location's id. |
simplemaps_worldmap_back() | This function is called when the back arrow is clicked. |
simplemaps_worldmap_complete() | This function is called after the map has finished loading. |
simplemaps_worldmap_zooming_complete() | This function is called after a zooming action has finished. Use this to make sure the map is done zooming before you change and refresh the map. |
Alternative: JavaScript can be included in a state, location, or region's url parameter
This is an alternative to using simplemaps_worldmap_click(id). For example, the following in your mapdata.js file:
© Simplemaps.com 2010-2015 | License | Privacy Policy | Releases | Testimonials | Resources | Documentation
Deprecated Maps: Flash USA Map | Flash World Map | Flash Canada Map | Flash Europe Map | Flash Congress Map
Formerly FlashUSAmap.com and Flashworldmap.com