4.0 Javascript API

FacilitiesMap has several JavaScript functions which can be called from embedded applications. Note that these will only work if the embedded application is on the same domain as FMv2 (due to cross site scripting security issues). These can be called using the “top” declaration, followed by the appropriate function.

 

Function Name

Description

FacilitiesMap

Used to test for application embedding within FacilitiesMap (i.e., whether or not your application is launched within FacilitiesMap)

var embeddedInFacilitiesmap = top.FacilitiesMap(); // True if embedded

SelectMapTab

 

Select the map tab

top.SelectMapTab();

SelectApplicationTab

 

Select the application tab

top.SelectApplicationTab();

SelectReportsTab

 

Select the reports tab

top.SelectReportsTab();

SetApplicationURL(url, expand)

 

Set the application tab url, and expand if true


// the URL of the site.  Note: if the URL doesn't start with http:// it will be assumed that it is a relative URL.

var url = "https://maps.google.com/?ll=38.544466,-121.727234&t=h&z=20&output=embed";

var expand = true;  // changes focus the to Application Tab.

top.SetApplicationURL(url, expand);

SetReportsURL(url, expand)

 

Set the reports tab url, and expand if true

// the URL of the site.  Note: if the URL doesn't start with http:// it will be assumed that it is a relative URL.

var url = "https://maps.google.com/?output=embed";

var expand = true;  // changes focus the to Reports Tab.

top.SetReportsURL(url, expand);

SetSearchURL(url, expand)

 

Set the search pane url, and expand if true

// the URL of the site.  Note: if the URL doesn't start with http:// it will be assumed that it is a relative URL.

var url = "https://maps.google.com/?output=embed";

var expand = true;  // Expands the search section on the InfoBar.

top.SetSearchURL(url, expand);

SetSearchResultsURL(url, expand)

 

Displays a url in the Feature Details pane of the InfoBar.

// the URL of the site.  Note: if the URL doesn't start with http:// it will be assumed that it is a relative URL.

var url = "https://maps.google.com/?output=embed";

var expand = true;  // Expands the Feature Details pane on the InfoBar.

top.SetSearchURL(url, expand);

SetRedlineURL(url, expand)

 

Set the redline pane url, and expand if true (the redline pane must be visible)

// the URL of the site.  Note: if the URL doesn't start with http:// it will be assumed that it is a relative URL.

var url = "https://maps.google.com/?output=embed";

var expand = true;  // Expands the Manage Redlines pane on the InfoBar.

top.SetRedlineURL(url, expand);

SetFileResourcesURL(url, expand)

 

Set the file resources pane url, and expand if true (the file resources pane must be visible)

// the URL of the site.  Note: if the URL doesn't start with http:// it will be assumed that it is a relative URL.

var url = "https://maps.google.com/?output=embed";

var expand = true;  // Expands the File Resources pane on the InfoBar.

top.SetFileResourcesURL(url, expand);

ExpandSearchPane

 

Expand the search pane

top.ExpandSearchPane();

ExpandSearchResultsPane

 

Expand the search results pane

top.ExpandSearchResultsPane();

ExpandRedlinePane

 

Expand the redline pane (the redline pane must be visible)

top.ExpandRedlinePane();

ExpandGetFileResourcesPane

 

Expand the file resources pane (the file resources pane must be visible)

top.ExpandGetFileResourcesPane();

NavigationPaneExpand

 

Expand the navigation pane (the “infobar”)

top.NavigationPaneExpand();

NavigationPaneCollapse

 

Collapse the navigation pane (the “infobar”)

top.NavigationPaneCollapse();

NavigationPaneToggle

 

Toggle expand/collapse the navigation pane (the “infobar”)

top.NavigationPaneToggle();

ClearSelection

 

Clear the map selection

top.ClearSelection();

ZoomToFeatures(dataDefinitionId, keys, keysDelimiter, enableLayer, autoZoom, autoSelect, selectTriggersInfobar, alertOnError)

 

Zoom to map features:

 

dataDefinitionId                               The DataId of the data definition of the feature

keys                                                       Delimited string of the desired featureIds to zoom to

keysDelimiter                                    Delimiter for multiple keys (e.g., '|')

enableLayer                                       Boolean value; whether or not to turn on a layer that isn't visible

autoZoom                                           Boolean value; whether or not to zoom to the features

autoSelect                                          Boolean value;  Select features

selectTriggersInfobar                            Boolean value;  Display results in InfoBar

alertOnError                                       Boolean value; whether or not to fail silently


top.ZoomToFeatures(539,'14720|15226','|',true,true,true,true,false);

[Last updated for version 2306 (12/2012)]
Comments