Lib Fusion |
Fusiondeclare global namespace object for Fusion library to use Summary
Fusion. ConstantApplication scope constants Summary
initialize
Initialize the Fusion application. This method must be called from the template’s onload method once all script files have been loaded. Applications can register for the event Fusion.Event.FUSION_INITIALIZED to carry out further application initialization when all the Fusion objects have been created and are available. @param {Object} options Optional paramters that can be passed to initialize are
initializeLocale
Initialize the Strings hash with the requested locale. This method simply extends the OpenLayers strings hash with strings specific to Fusion. Add strings to the files in fusion/text/[locale].json. This method can be called before Fusion.initialize() if localized strings are required in the template initialization.
loadQueuedScripts
load any scripts that have been queued for loading. As the scripts load, they are removed. When all queued scripts have been loaded, the load state is advanced. If any of the loaded scripts require other scripts (for inheritance), they will be queued and loaded before the load state is advanced. scriptLoaded
a script has loaded. It is removed from the various tracking arrays. When all requested scripts have been loaded, we check to see if any scripts where required by the ones just loaded. If yes, then we loadQueuedScripts again, otherwise we advance the load state. Parameter: url {String} the url of the script that was loaded. ajaxRequest
convenience function to issue an XmlHttpRequest to the server relative to the Fusion installation. Parameter: {String} scriptURL the URL (relative to Fusion) to request Parameter: {Object} options optional parameters to send with the request, passed directly to the OpenLayers Ajax.Request function getXmlAsJson
Convert XML to JSON using a server-side script for requests that aren’t available in JSON.
boolean indicator if the content is JSON or not. xml2json
Callback method to convert the XNR response into an actual json object and triggers the call to the callback method Parameter: callback callback method to be executed on success and will be passed a parsed json object Parameter: {XmlHttpRequest} r the XmlHttpRequest object Parameter: json boolean indicator if the content is JSON or not (set by OpenLayers) getWidgetById
return a reference to a widget by the id of the DOM Element that it was created in. Parameter: {String} id the DOM id to get the widget for Returns: {Fusion.Widget} the widget or null getConfigurationItem
returns individual elements out of the Fusion config.json file
Returns: {String} a the value for the key of null if not found reportError
Triggers the Fusion.Event.FUSION_ERROR and passes along the error object to the callback functions registered for this event. Widgets call Fusion.reportError(o) to inform the system of errors. Applications will typically register an event listener for the error event and do something to report the error to the user. By default, errors are not reported since there is no listener
Returns: none convert
Converts a length value from one unit system into another.
Returns: {Float} the value in output units initUnits
initializes the meters per unit values when a new map is loaded. Some systems make different assumptions for the conversion of degrees to meters so this makes sure both Fusion and OpenLayers are using the same value.
|
Initialize the Fusion application.
initialize: function( options )
Initialize the Strings hash with the requested locale.
initializeLocale: function( locale )
set the current initialization state of the application.
setLoadState: function( state )
load any scripts that have been queued for loading.
loadQueuedScripts: function()
Insert a new script into the loading queue.
queueScript: function( url )
Called when a script fails to load for some reason.
scriptFailed: function( url )
a script has loaded.
scriptLoaded: function( url )
check if scripts have loaded.
checkLoadingScripts: function()
asynchronously load the application definition.
loadConfig: function()
the server has returned the application configuration file that contains enough information to bootstrap the application.
getConfigCB: function( r )
the server has returned the application configuration file that contains enough information to bootstrap the application.
serverSet: function()
the application failed to load the application configuration file.
serverFailed: function( r )
convenience function to issue an XmlHttpRequest to the server relative to the Fusion installation.
ajaxRequest: function( scriptURL, options )
trap exceptions produced in handling an ajax response.
ajaxException: function( r, e )
Convert XML to JSON using a server-side script for requests that aren’t available in JSON.
getXmlAsJson: function( url, callback )
Callback method to convert the XNR response into an actual json object and triggers the call to the callback method
xml2json: function( callback, r, json )
return a map widget with the given name
getMapByName: function( name )
return a map widget that is associated with the given DOM element by id.
getMapById: function( id )
return the map widget at the given index if there are more than one map elements specified in the AppDef
getMapByIndice: function( indice )
return a reference to a widget by the id of the DOM Element that it was created in.
getWidgetById: function( id )
returns the applicaiton’s absolute URL minus the filename.html part
getApplicationURL: function()
returns the application’s absolute URL minus the filename.html part
getFusionURL: function()
returns individual elements out of the Fusion config.json file
getConfigurationItem: function( arch, key )
Accessor to return the server-side script language
getScriptLanguage: function()
Accessor to return the URL of the redirect script
getRedirectScript: function()
Accessor to return the broker object (for MapGuide only).
getBroker: function()
Marks a JavaScript file as required which puts it into the queue for loading during Fusion initialization.
require: function( url )
Triggers the Fusion.Event.FUSION_ERROR and passes along the error object to the callback functions registered for this event.
reportError: function( o )
returns index into the units array for the given unit name or abbreviation
unitFromName: function( unit )
Given a unit, this method returns the units name
unitName: function( unit )
Given a unit, this method returns the units abbreviation
unitAbbr: function( unit )
Converts a length value from native units into meters.
toMeter: function( unit, value )
Converts a length value from meters into native units.
fromMeter: function( unit, value )
Converts a length value from one unit system into another.
convert: function( unitsIn, unitsOut, value )
initializes the meters per unit values when a new map is loaded.
initUnits: function( metersPerUnit )
find the OpenLayers units identifier given the Fusion metersPerUnit value
getClosestUnits: function( metersPerUnit )
Dynamically load a CSS stylesheet.
addWidgetStyleSheet: function( url )
An initialization time function to parse the application URL parameters and stores them in an array.
parseQueryString: function()
Returns the query parameter value for a given parameter name
getQueryParam: function( p )
Return the path to this script for bootstrapping Fusion.
_getScriptLocation: function ()
Pre-create a session to avoid the 401 Unauthorized dialog
var createSessionId = function()