Exporting maps as PDF/Images >JavaScript Reference > JavaScript API

 

object FusionMapsExportObject()

Description:
This object contains all the routines that are required for FusionMaps Export Component to work.

infosoftglobal.FusionMapsExportObject()

Note:
This object is dependent upon infosoftglobal.FusionMaps for a few of its internal routines. Hence, it is pertinent that FusionMaps.js be included prior to the definition of this object.

Constructor

FusionMapsExportObject( string id, string swfLocation, object componentAttributes, object exportAttributes, 
    array sourceMaps, boolean debugMode );

Description:
This is used when we need to create a new FusionMapsExportObject().

Constructor Parameter Description:
Parameter Name Type Description
id string

This specifies the DOM ID of the SWF that will be embedded on the HTML page.

 

Note:
This ID is compulsory and must be unique on page as other FusionMaps object will use this ID to locate and access every new FusionMapsExportObject.

swfLocation string

Specify the URL (location) of the FCExporter.swf on your server.

 

Note:
Typically, this is a compulsory attribute. However, in case you have multiple FusionMapsExportObjects on your page, you may define this value centrally at FusionMapsExportObject.defaultParameters.swfLocation

componentAttributes object

[optional] Use this to specify properties of the Export Component SWF file. These attributes are sent as flashVars to the Export Component SWF when it is embedded on the web page.

 

The value of this parameter needs to be entered in {key1: 'value1', key2: 'value2' ... } style. The list of valid attributes can be found in the Component Attributes section.

 

Example:
var myComp = new FusionMapsExportObject( 'myComp', 'FusionMaps/FCExporter.swf', {width: '400', height: '100', borderColor: 'FF0000'} );

exportAttributes object

[optional] Use this to specify export attributes for the maps that are being exported. The values in this parameter will override the corresponding value specified in dataXML of the map(s).

 

The value of this parameter needs to be entered in {key1: 'value1', key2: 'value2' ... } style. The list of valid attributes can be found in the XML Attributes section.

 

Example:
var myComp = new FusionMapsExportObject( 'myComp', 'FusionMaps/FCExporter.swf', null, { showExportDialog: '0', exportAtClient: '1' } );

sourceMaps array

[optional] Use this to specify the maps that will be exported in the order of array definition when the BeginExport() function is called. The value of this parameter should be the DOM ID string (map id) of each map that you want to export.

 

Example:
var myComp = new FusionMapsExportObject( 'myComp', 'FusionMaps/FCExporter.swf', null, null, ['myMapId1', 'myMapId2'] );

 

Note:
Even in case you want to export a single map, you should provide the single map id as an array.

debugMode boolean
(true/false)

[optional] Set this parameter to true if you want the Export Component to halt on every error and notify of the nature of the error encountered.

 

A detailed section on how to debug your export component in case you encounter an error can be found in the Debugging Export Component section.

 

Alternative Constructor

FusionMapsExportObject( object arguments );

Description:
The FusionMapsExportObject also accepts an object as the entire parameter for constructor. In this method, the object can be initialized as above with its properties being of the same name as those provided in the "Constructor Parameter Description" table above.

Example:

var myComponent = new FusionMaps( {
id: 'myComponent',
swfLocation: 'FusionMaps/FCExporter.swf', exportAttributes: { exportAtClient: '1',
showExportDialog: '0'
}, debugMode: true
}
);

 

Public Variables and Properties

Name Value Type Description Default Value
checkFlashVersion boolean
(true/false)

This variable, when set to true, checks whether the installed Flash Player in the user's browser meets the minimum requirement (version 10 or above) or not.

 

In case the user does not have the required flash version, it shows a friendly message notifying user of the same.

 

Example Usage:

FusionMapsExportObject.checkFlashVersion = true;

false
defaultParameters object

All new FusionMapsExportObject will have the properties specified within this object.

 

Effectively this allows developers to set global "default" values of every FusionMapsExportObject within the page scope.

 

Example Usage:

FusionMapsExportObject.defaultParameters.debugMode = true;

This enables "debugMode" on all new FusionMapsExportObject

 

Note:

defaultParameters accepts properties as mentioned in the table "Constructor Parameter Description"

object

 

 

Prototyped Variables and Properties

These variables and properties are available for every new instances of FusionMapsExportObject.

Name Value Type Description Default Value
id string

This specifies the DOM ID of the SWF that will be embedded on the HTML page.

 

Note:
This ID must be unique on page as other FusionMaps object will use this ID to locate and access every new FusionMapsExportObject.

undefined
swfLocation string

Specify the URL (location) of the FCExporter.swf on your server.

 

Note:
Typically, this is a compulsory attribute. However, in case you have multiple FusionMapsExportObjects on your page, you may define this value centrally at FusionMapsExportObject.defaultParameters.swfLocation

FusionMapsExportObject.
defaultParameters.
swfLocation
componentAttributes object

Use this to specify properties of the Export Component SWF file. These attributes are sent as flashVars to the Export Component SWF when it is embedded on the web page.

 

The value of this parameter needs to be entered in {key1: 'value1', key2: 'value2' ... } style. The list of valid attributes can be found in the Component Attributes section.

 

Example:
var myComp = new FusionMapsExportObject( 'myComp', 'FusionMaps/FCExporter.swf', {width: '400', height: '100', borderColor: 'FF0000'} );

FusionMapsExportObject.
defaultParameters.
componentAttributes
exportAttributes object

Use this to specify export attributes for the maps that are being exported. The values in this parameter will override the corresponding value specified in dataXML of the map(s).

 

The value of this parameter needs to be entered in {key1: 'value1', key2: 'value2' ... } style. The list of valid attributes can be found in the XML Attributes section.

 

Example:
var myComp = new FusionMapsExportObject( 'myComp', 'FusionMaps/FCExporter.swf', null, { showExportDialog: '0', exportAtClient: '1' } );

FusionMapsExportObject.
defaultParameters.
exportAttributes
sourceMaps array

Use this to specify the maps that will be exported in the order of array definition when the BeginExport() function is called. The values of this parameter should be the DOM ID string (map id) of each map that you want to export.

 

Example:
var myComp = new FusionMapsExportObject( 'myComp', 'FusionMaps/FCExporter.swf', null, null, ['myMapId1', 'myMapId2'] );

 

Note:

Even in case you want to export a single map, you should provide the single map id as an array.

FusionMapsExportObject.
defaultParameters.
sourceMaps
debugMode boolean
(true/false)

Set this parameter to true if you want the Export Component to halt on every error and notify of the nature of the error encountered.

 

A detailed section on how to debug your export component in case you encounter error, can be found in the Debugging Export Component section.

FusionMapsExportObject.
defaultParameters.
debugMode
strictTrigger boolean
(true/false)
This property sets whether to force the "triggering" export component to be the final "processor" of the exported data. FusionMapsExportObject.
defaultParameters.
strictTrigger

 

Protoyped Methods

These methods are available to all new instances of FusionMapsExportObject.

Method Definition Description and Parameters Returns
boolean Render(string containerNode)

This function is called to render the Exporter Component SWF on the current page.

 

Parameters:

containerNode: It is the DOM ID of the HTML element inside which the SWF EMBED HTML is to be written.

 

Note:

The containerNode parameter can also be a direct reference to the HTML DOM element

Whether the render operation was successful or not
array BeginExport() Initiates exportMap sequence on all the maps provided in the sourceMaps array. Array of DOM IDs of all the maps that were successfully exported
array BeginExportAll() Initiates exportMap sequence on all FusionMaps within the current page. Array of DOM IDs of all the maps that were successfully exported
string GetOuterHTML()

Returns the HTML that is to be put in your web page in order to display the Exporter Component.

 

This can be used if you want to manually put in the HTML of the SWF component instead of using the Render()

HTML of the SWF Embed object

 

Public Events

FusionMapsExportObject raises certain events that you can use to integrate the Export Component with the rest of your website.

Event Name Description Return Accepted
void FC_ExportReady( string DOMId)

This event is raised as soon as a map has finished the capturing phaze and is ready to be relayed to the exporter component, both client-side as well as server-side.

 

You can use this event to track the progress of your export.

 

DOMId: This is the DOMId of the map (MapID) that has finished rendering.

 

void