JavaScript events raised by the map |
||||||||||||||||||
All the maps in FusionMaps v3 suite can raise the following events. Please note that the events are raised only when registerWithJS flag of the map is set to 1. |
||||||||||||||||||
|
||||||||||||||||||
How to track these events? | ||||||||||||||||||
The events raised by FusionMaps are simple JavaScript functions that are invoked, and the DOMId of the invoking map is passed to the function to help you identify the source. For example, the FC_Rendered event for a map can be tracked using following code: | ||||||||||||||||||
<HTML> <HEAD> <TITLE>FusionMaps & JavaScript - Basic Example</TITLE> <SCRIPT LANGUAGE="Javascript" SRC="../JSClass/FusionMaps.js"></SCRIPT> <SCRIPT LANGUAGE="JavaScript"> //FC_Rendered method is called whenever a FusionMaps map on the page //has finished initial rendering. To this function, the map passes its //own DOM Id. function FC_Rendered(DOMId){ //If it's our required map if (DOMId=="map1Id"){ //Simply alert window.alert("Look Ma! I am World Map and I've finished loading and rendering."); return; } } </SCRIPT> </HEAD> <BODY> <div id="map1div"> FusionMaps </div> <script language="JavaScript"> var map1 = new FusionMaps("../Maps/FCMap_World.swf", "map1Id", "750", "400", "0", "1"); map1.setDataXML("<map borderColor='005879' fillColor='D7F4FF' numberSuffix=' Mill.' includeValueInLabels='1' labelSepChar=': ' baseFontSize='9'><data> <entity id='NA' value='515' /><entity id='SA' value='373' /><entity id='AS' value='3875' /><entity id='EU' value='727' /><entity id='AF' value='885' /><entity id='AU' value='32' /></data></map>"); map1.render("map1div"); </script> </BODY> </HTML> |