All the maps in FusionMaps v3 suite expose the following JavaScript APIs. Click on a method name to see detailed usage information on the same.

Please note that the events are raised only when registerWithJS flag of the map is set to 1.

These APIs are NOT present in FusionMaps.js (FusionMaps JavaScript class). Rather, these APIs are in-built into the SWFs. So, you need to invoke them on the DOM object of the map (i.e., on the object returned by getMapFromID(DomID) call).

 
API Method signature Purpose What it returns?
setDataURL(strDataURL:String) Changes the data of the map to the new specified URL. The URL has to be relative to the map. Nothing
setDataXML(strDataXML:String)

Changes the data of the map to the specified XML string.

Note of caution: When specifying XML as string, please make sure that there are no conflicts in quotes between the JS function call and the quotation mark used to enclose attributes in XML string.

Nothing
print() Prints the map Nothing
exportMap(exportSettings: Object) Calls the export map routine to save the map as PDF/image. exportSettings object here contains over-riding parameters to over-ride the export parameters initially specified in XML. Nothing. But, in most cases, a callback function is invoked to convey status of export.
getXML() Returns the XML data of map. XML data of map as string
getMapAttribute(attrName: String) Returns the value of the attribute as specified in map's XML data > <map> element Value of the attribute; or "null" if the attribute was empty or not found in XML
signature() A string representing the signature of SWF. For FusionMaps v3 maps, it's FusionMaps/3.1
hasRendered() A boolean value indicating whether the map has rendered. Boolean value indicating whether the map has finished rendering
getDataAsCSV() Returns the data of map as CSV string. The output CSV string can be configured using XML parameters. String representing data of map in CSV format.