You are viewing documentation for an older version. For current documentation - click here.

FusionMaps XT uses FusionCharts jQuery plugin that takes care of all the products of the FusionCharts Suite XT including FusionMaps XT.

FusionCharts jQuery plugin also enables you to bind FusionCharts events using jQuery bind method. The event handler needs to be attached to the container element of the FusionCharts object. To avoid conflict with other jQuery events having same names, "fusioncharts" has been appended to the all FusionCharts event names or types.

To aid your understanding of this section, we will recommend you to go through the Overview page of FusionCharts jQuery plugin and Events page of FusionMaps XT and JavaScript > API section

The code snippet below shows how you can bind to DrawComplete event of FusionCharts:

$("#mapContainer").bind( "fusionchartsdrawcomplete", function (e, args) { 
   alert("Map named " + e.sender.id + " has completed map drawing." ); 
}); 

In the above code, the map container element with ID "mapContainer" is set with bind method to handle DrawComplete event of maps. The event name or event type is passed as "fusionchartsdrawcomplete" ("fusioncharts" prefixed). An anonymous function is passed to handle this event. All maps found in the "mapContainer" element will raise this event. The event handler function will show an alert with the DOM Id of the map which will raise the event.

Using FusionCharts jQuery plugin, you can render FusionMaps XT anywhere within a Web page, change map type, update and retrieve map data, update functional and cosmetic settings and use all existing features of FusionCharts.

Note that the list of FusionCharts event names or event types can be derived from FusionMaps XT and JavaScript > API > Events page. The event names used here are similar to those listed in the "Name (Advanced model)" column of the list of events in the Events page. You will just need to prefix the listed event names with "fusioncharts". This is done to avoid conflict with the pre-existing jQuery event types having same names, for example, the event name Loaded (as listed in the Events page) needs to be passed as "fusionchartsloaded". The parameters passed to the event handler function for each event are also same as stated in the Events page.