# Map.js

Summary

Map.js |
Constants |
Fusion.Event.MAP_EXTENTS_CHANGED |
Fusion.Event.MAP_BUSY_CHANGED |
Fusion.Event.MAP_GENERIC_EVENT |
Fusion.Event.MAP_RESIZED |
Fusion.Event.MAP_SELECTION_ON |
Fusion.Event.MAP_SELECTION_OFF |
Fusion.Event.MAP_ACTIVE_LAYER_CHANGED |
Fusion.Event.MAP_LOADED |
Fusion.Event.MAP_LOADING |
Fusion.Event.MAP_RELOADED |
Fusion.Event.MAP_SESSION_CREATED |
Fusion.Event.MAP_MAPTIP_REQ_FINISHED |
Fusion.Event.WMS_LAYER_ADDED |
Fusion.Event.MAP_SCALE_RANGE_LOADED |
Fusion.Event.MAP_MAP_GROUP_LOADED |
Fusion.Event.MAP_DIGITIZER_ACTIVATED |
Fusion.Event.MAP_DIGITIZER_DEACTIVATED |
Fusion.Event.MAP_BASE_LAYER_CHANGED |
Fusion.Constant.LAYER_POINT_TYPE |
Fusion.Constant.LAYER_LINE_TYPE |
Fusion.Constant.LAYER_POLYGON_TYPE |
Fusion.Constant.LAYER_SOLID_TYPE |
Fusion.Constant.LAYER_RASTER_TYPE |
Fusion.Constant.LAYER_DWF_TYPE |
Fusion.Widget.Map | generic class for map widgets.
Properties |
isDigitizing | Gets whether a digitizer is currently active
message | The {Fusion.MapMessage} notification bar
Functions |
setExternalBaseLayer | Sets the given external layer as the new base layer
mapLoaded | Callback for when all maps have been loaded
setMenu | Attaches a context menu as defined in the AppDef to the map
loadMapGroup | Controls the creation of Layers based on the MapGroup object passed in
layerLoaded | Called after each layer is loaded in the OL viewport.
wheelChange | handles mouse wheel events by accummulating the events and setting a timer to do the actual zoom in/out
doWheelChange | Carries out the actual map zoom based on the wheel movement
wheelUp | User spun scroll wheel up
wheelDown | User spun scroll wheel down
getDomObj | returns the dom element for this widget
getDomId | returns the ID of dom element for this widget
setMapOptions | sets options on the OpenLayers map object, a wrapper for the OL function
addMap | adds a map/Layer to the map and registers some event handlers on the map
getAllMaps | returns the array of map objects
reloadMap | Called to reload all the map objects.
loadScaleRanges | Loads the ScaleRange objects separate from the LoadMap sequence since this also generates sprites and is a relatively expensive operation.
query | dispatch query requests to the maps
selectionHandler | handle selection events from maps and republish for widgets as appropriate
hasSelection | cehck to see if any of the maps have an active selection
clearSelection | clear the selection on all maps
getSelection | initiates a call to get the current selection asynchronously in case we need to retrieve the details from the server
setSelection | sets a Selection XML back to the server for each of the maps
accumulateSelection | accumulate the selection results from each map and when all have reported in, pass the results to the callback function
setActiveLayer | sets the active layer for selection/manipulation
getActiveLayer | returns the active layer for selection/manipulation
_addWorker | indicate that a new asynchronous process has started and make sure the visual indicator is visible for the user.
_removeWorker | indicate that an asynchronous process has completed and hide the visual indicator if no remaining processes are active.
mapExtentsChanged | OpenLayers event handler for whenever the map changes either zoom level of the center has changed.
isBusy | check to see if there are any outstanding requests to the server
sizeChanged | callback for when the browser window size changes, simply calls resize on the map viewport layout object
resize | handles the resizing of the maps and triggers a Fusion event
redraw | redraws the map using current extents and zoom level.
setBackgroundColor | sets the background color for the map
setExtents | handle selection events from maps and republish for widgets as appropriate
setInitialExtents | 1.
getMapGroupExtent | gets the intitial extents from all maps with or without including the extent of any Generic/commercial layers
fullExtents | sets the extent of the map to the max as returned by loadMap
isMapLoaded | returns if the map has finished loading (based on setting the _oCurrentExtent value)
zoom | sets the map zoom and extent.
zoomToScale | Zooms to the specified scale
pixToGeo | convert pixel coordinates into geographic coordinates.
geoToPix | convert geographic coordinates into pixel coordinates.
pixToGeoMeasure | convert pixel into geographic : used to measure.
setProjection | initializes the OpenLayers projection object on the Map object
setMetersPerUnit | initializes the meters per unit values when a new map is loaded.
getMetersPerUnit | returns the meters per unit value
setViewOptions | initializes all widgets with the map units after the map has loaded
setWidgetParam | initializes all widgets with a parameter and value at runtime
geoToPixMeasure | convert geographic into pixels.
getCurrentCenter | returns the current center of the map view
getCurrentExtents | returns the current extents
getExtentFromPoint | returns the Extent of the map given a center point and a scale (optional)
getScale | Gets the current scale of the map
getResolution | Gets the current resolution of the map
getSize | Gets the size of the map
cancelDigitization | De-activates any active digitizers
digitizePoint | Digitizes a point and passes the value to a function for processing.
digitizeLine | Digitizes a line and passes the value to a function for processing.
digitizeLineString | Digitizes a line string and passes the value to a function for processing.
digitizeRectangle | Digitizes a rectangle and passes the value to a function for processing.
digitizePolygon | Digitizes a polygon and passes the value to a function for processing.
digitizeCircle | Digitizes a circle and passes the value to a function for processing.
Fusion.SelectionObject | Holds information about selected map features
Functions |
getNumElements | Gets the number of selected map features
getLowerLeftCoord | Gets the lower left coordinate of this selection’s bounding box
getUpperRightCoord | Gets the upper right coordinate of this selection’s bounding box
getNumLayers | Gets the number of map layers included in this selection
getLayerByName | Gets the selected map layer by its name
getLayer | Gets the selected map layer by the specified index
Fusion.SelectionObject.Layer | Defines a map layer in a {Fusion.SelectionObject}

### Constants

### Fusion.Event.MAP_EXTENTS_CHANGED

### Fusion.Event.MAP_BUSY_CHANGED

### Fusion.Event.MAP_GENERIC_EVENT

### Fusion.Event.MAP_RESIZED

### Fusion.Event.MAP_SELECTION_ON

### Fusion.Event.MAP_SELECTION_OFF

### Fusion.Event.MAP_ACTIVE_LAYER_CHANGED

### Fusion.Event.MAP_LOADED

### Fusion.Event.MAP_LOADING

### Fusion.Event.MAP_RELOADED

### Fusion.Event.MAP_SESSION_CREATED

### Fusion.Event.MAP_MAPTIP_REQ_FINISHED

### Fusion.Event.WMS_LAYER_ADDED

### Fusion.Event.MAP_SCALE_RANGE_LOADED

### Fusion.Event.MAP_MAP_GROUP_LOADED

### Fusion.Event.MAP_DIGITIZER_ACTIVATED

### Fusion.Event.MAP_DIGITIZER_DEACTIVATED

### Fusion.Event.MAP_BASE_LAYER_CHANGED

### Fusion.Constant.LAYER_POINT_TYPE

### Fusion.Constant.LAYER_LINE_TYPE

### Fusion.Constant.LAYER_POLYGON_TYPE

### Fusion.Constant.LAYER_SOLID_TYPE

### Fusion.Constant.LAYER_RASTER_TYPE

### Fusion.Constant.LAYER_DWF_TYPE

## Fusion.Widget.Map

generic class for map widgets. Provides common utility classes. This class provides a wrapper around the {OpenLayers.Map} object.

#### Inherits from

- Fusion.Lib.EventMgr

Summary

Properties |
isDigitizing | Gets whether a digitizer is currently active
message | The {Fusion.MapMessage} notification bar
Functions |
setExternalBaseLayer | Sets the given external layer as the new base layer
mapLoaded | Callback for when all maps have been loaded
setMenu | Attaches a context menu as defined in the AppDef to the map
loadMapGroup | Controls the creation of Layers based on the MapGroup object passed in
layerLoaded | Called after each layer is loaded in the OL viewport.
wheelChange | handles mouse wheel events by accummulating the events and setting a timer to do the actual zoom in/out
doWheelChange | Carries out the actual map zoom based on the wheel movement
wheelUp | User spun scroll wheel up
wheelDown | User spun scroll wheel down
getDomObj | returns the dom element for this widget
getDomId | returns the ID of dom element for this widget
setMapOptions | sets options on the OpenLayers map object, a wrapper for the OL function
addMap | adds a map/Layer to the map and registers some event handlers on the map
getAllMaps | returns the array of map objects
reloadMap | Called to reload all the map objects.
loadScaleRanges | Loads the ScaleRange objects separate from the LoadMap sequence since this also generates sprites and is a relatively expensive operation.
query | dispatch query requests to the maps
selectionHandler | handle selection events from maps and republish for widgets as appropriate
hasSelection | cehck to see if any of the maps have an active selection
clearSelection | clear the selection on all maps
getSelection | initiates a call to get the current selection asynchronously in case we need to retrieve the details from the server
setSelection | sets a Selection XML back to the server for each of the maps
accumulateSelection | accumulate the selection results from each map and when all have reported in, pass the results to the callback function
setActiveLayer | sets the active layer for selection/manipulation
getActiveLayer | returns the active layer for selection/manipulation
_addWorker | indicate that a new asynchronous process has started and make sure the visual indicator is visible for the user.
_removeWorker | indicate that an asynchronous process has completed and hide the visual indicator if no remaining processes are active.
mapExtentsChanged | OpenLayers event handler for whenever the map changes either zoom level of the center has changed.
isBusy | check to see if there are any outstanding requests to the server
sizeChanged | callback for when the browser window size changes, simply calls resize on the map viewport layout object
resize | handles the resizing of the maps and triggers a Fusion event
redraw | redraws the map using current extents and zoom level.
setBackgroundColor | sets the background color for the map
setExtents | handle selection events from maps and republish for widgets as appropriate
setInitialExtents | 1.
getMapGroupExtent | gets the intitial extents from all maps with or without including the extent of any Generic/commercial layers
fullExtents | sets the extent of the map to the max as returned by loadMap
isMapLoaded | returns if the map has finished loading (based on setting the _oCurrentExtent value)
zoom | sets the map zoom and extent.
zoomToScale | Zooms to the specified scale
pixToGeo | convert pixel coordinates into geographic coordinates.
geoToPix | convert geographic coordinates into pixel coordinates.
pixToGeoMeasure | convert pixel into geographic : used to measure.
setProjection | initializes the OpenLayers projection object on the Map object
setMetersPerUnit | initializes the meters per unit values when a new map is loaded.
getMetersPerUnit | returns the meters per unit value
setViewOptions | initializes all widgets with the map units after the map has loaded
setWidgetParam | initializes all widgets with a parameter and value at runtime
geoToPixMeasure | convert geographic into pixels.
getCurrentCenter | returns the current center of the map view
getCurrentExtents | returns the current extents
getExtentFromPoint | returns the Extent of the map given a center point and a scale (optional)
getScale | Gets the current scale of the map
getResolution | Gets the current resolution of the map
getSize | Gets the size of the map
cancelDigitization | De-activates any active digitizers
digitizePoint | Digitizes a point and passes the value to a function for processing.
digitizeLine | Digitizes a line and passes the value to a function for processing.
digitizeLineString | Digitizes a line string and passes the value to a function for processing.
digitizeRectangle | Digitizes a rectangle and passes the value to a function for processing.
digitizePolygon | Digitizes a polygon and passes the value to a function for processing.
digitizeCircle | Digitizes a circle and passes the value to a function for processing.

### Properties

### isDigitizing

Gets whether a digitizer is currently active

### message

The {Fusion.MapMessage} notification bar

### Functions

### setExternalBaseLayer

> setExternalBaseLayer: function( | baseLayer | )

Sets the given external layer as the new base layer

Parameter: {Fusion.Layers} baseLayer | a Fusion.Layers instance to set as the new base map

Return: none

### mapLoaded

> mapLoaded: function()

Callback for when all maps have been loaded

Parameter: none.

Return: none

### setMenu

> setMenu: function()

Attaches a context menu as defined in the AppDef to the map

Parameter: none.

Return: none

### loadMapGroup

> loadMapGroup: function( | mapGroup,
> | loadOverlays | )

Controls the creation of Layers based on the MapGroup object passed in

Parameter: {Object} mapGroup | a representation of the MapGroup object
{Boolean} loadOverlays | if true, this will leave the first layer (usually a commercial baselayer) on the map and just replace all the overlays

Return: none

### layerLoaded

> layerLoaded: function( | mapTag | )

Called after each layer is loaded in the OL viewport. Nothing happens here until the last layer is laoded, then it sets the OL baselayer and zooms to the initial extent.

Parameter: none

Return: none

### wheelChange

> wheelChange: function( | evt,
> | deltaZ | )

handles mouse wheel events by accummulating the events and setting a timer to do the actual zoom in/out

#### Parameters

evt | {Event} the mouse wheel event object
deltaZ | {Integer} the number of ticks wheeled

### doWheelChange

> doWheelChange: function( | evt,
> | deltaZ | )

Carries out the actual map zoom based on the wheel movement

#### Parameters

evt | {Event} the mouse wheel event object
deltaZ | {Integer} the number of ticks wheeled

Return: none

### wheelUp

> wheelUp: function( | evt | )

User spun scroll wheel up

#### Parameters

evt | {Event}

### wheelDown

> wheelDown: function( | evt | )

User spun scroll wheel down

#### Parameters

evt | {Event}

### getDomObj

> getDomObj: function()

returns the dom element for this widget

Parameters: none

Return: none

### getDomId

> getDomId: function()

returns the ID of dom element for this widget

Parameters: none

Return: {String} the id of the DOM element

### setMapOptions

> setMapOptions: function( | options | )

sets options on the OpenLayers map object, a wrapper for the OL function

Parameters: {Object} options | has of option key/value pairs

Return: none

### addMap

> addMap: function( | map | )

adds a map/Layer to the map and registers some event handlers on the map

Parameters: {Object} map | the map object to tbe added (really a layer object)

Return: none

### getAllMaps

> getAllMaps: function()

returns the array of map objects

Parameters: none

Return: {Array} the array of map Objects

### reloadMap

> reloadMap: function()

Called to reload all the map objects. this uses setTimeout so this method can be called from an IFRAME

Parameters: none

Return: none

### loadScaleRanges

> loadScaleRanges: function()

Loads the ScaleRange objects separate from the LoadMap sequence since this also generates sprites and is a relatively expensive operation.

Parameters: {Function} userFunc | a user defined function to be called as a callback

Return: none

### query

> query: function( | options | )

dispatch query requests to the maps

Parameters: {object} options | query options to be passed to each map

### selectionHandler

> selectionHandler: function()

handle selection events from maps and republish for widgets as appropriate

Parameters: none

Return: none

### hasSelection

> hasSelection: function()

cehck to see if any of the maps have an active selection

Returns: {Boolean} | true if any map has a selection

### clearSelection

> clearSelection: function()

clear the selection on all maps

### getSelection

> getSelection: function( | callback,
> | layers,
> | startcount | )

initiates a call to get the current selection asynchronously in case we need to retrieve the details from the server

### setSelection

> setSelection: function( | selText,
> | zoomTo | )

sets a Selection XML back to the server for each of the maps

#### Parameters

{String} selText | the selection string
{Boolean} zoomTo | if set, will zoom to the selection on completion

### accumulateSelection

> accumulateSelection: function( | map,
> | oSelection | )

accumulate the selection results from each map and when all have reported in, pass the results to the callback function

#### Parameters

{Object} map | the map object that has the selection
{Object} oSelection | the Fusion selection object

### setActiveLayer

> setActiveLayer: function( | oLayer | )

sets the active layer for selection/manipulation

#### Parameters

{Object} oLayer | the layer to be set as active

### getActiveLayer

> getActiveLayer: function()

returns the active layer for selection/manipulation

#### Returns

{Object} the active layer

### _addWorker

> _addWorker: function()

indicate that a new asynchronous process has started and make sure the visual indicator is visible for the user. This is intended to be used internally by gMap but could be used by external tools if appropriate.

### _removeWorker

> _removeWorker: function()

indicate that an asynchronous process has completed and hide the visual indicator if no remaining processes are active. This is intended to be used internally by gMap but could be used by external tools if appropriate. Only call this function if addWorker was previously called

### mapExtentsChanged

> mapExtentsChanged: function()

OpenLayers event handler for whenever the map changes either zoom level of the center has changed. This in turn triggers the Fusion event.

Parameters: none

Return: none

### isBusy

> isBusy: function()

check to see if there are any outstanding requests to the server

Parameters: none

Return: {Boolean} true if there are active requests

### sizeChanged

> sizeChanged: function()

callback for when the browser window size changes, simply calls resize on the map viewport layout object

Parameters: none

Return: none

### resize

> resize: function()

handles the resizing of the maps and triggers a Fusion event

Parameters: none

Return: none

### redraw

> redraw: function()

redraws the map using current extents and zoom level. A dummy parameter is added to the map request to ensure the map request is not cached.

Parameters: none

Return: none

### setBackgroundColor

> setBackgroundColor: function( | color | )

sets the background color for the map

Parameters: {String} color | the CSS color value to set as background

Return: none

### setExtents

> setExtents: function( | oExtents | )

handle selection events from maps and republish for widgets as appropriate

Parameters: {Object} oExtents | an OpenLayers.Bounds object or an array of 4 values that will be converted to Bounds

Return: none

### setInitialExtents

> setInitialExtents: function()

#### determine the initialExtents of the map from (in order of precedence)

1. a URL query parameter called ‘extent’ 2. an <InitialView> specified in the MapGroup in AppDef 3. the maxExtent as specified by the LoadMap call (default)

Returns: {Object} an OpenLayers.Bounds object which is the initial extent

### getMapGroupExtent

> getMapGroupExtent: function( | includeGenericLayers | )

gets the intitial extents from all maps with or without including the extent of any Generic/commercial layers

Return: {Object} an OpenLayers.Bounds object which is the initial extent

### fullExtents

> fullExtents: function()

sets the extent of the map to the max as returned by loadMap

### isMapLoaded

> isMapLoaded: function()

returns if the map has finished loading (based on setting the _oCurrentExtent value)

Returns {Boolean} true if the map is loaded and extent has been set

### zoom

> zoom: function( | fX,
> | fY,
> | nFactor | )

sets the map zoom and extent.

#### Parameters

fX {Float} | new x coordinate value in map units
fY {Float} | new y coordinate value in map units
nFactor {Float} | zoom factor; positive values zoom in, negative out

- if set to 0 or 1, the map is just recentered
- if the map has fractional zoom enabled, the map resolution will be modified by this factor
- with fixed scales, zoom up or down log2(nFactor) level

Returns: none

### zoomToScale

> zoomToScale: function( | fScale | )

Zooms to the specified scale

#### Parameters

fScale | {Float} The scale to zoom to

Returns: none

### pixToGeo

> pixToGeo: function( | pX,
> | pY | )

convert pixel coordinates into geographic coordinates.

#### Parameters

pX | {Integer} the x coordinate in pixel units
pY | {Integer} the y coordinate in pixel units

#### Return

an object with geographic coordinates in x and y properties of the object.

### geoToPix

> geoToPix: function( | gX,
> | gY | )

convert geographic coordinates into pixel coordinates.

#### Parameters

gX | {Integer} the x coordinate in geographic units
gY | {Integer} the y coordinate in geographic units

#### Return

an object with pixel coordinates in x and y properties of the object.

### pixToGeoMeasure

> pixToGeoMeasure: function( | nPixels | )

convert pixel into geographic : used to measure.

#### Parameters

nPixels | {Integer} measures in pixel

@return geographic measure

### setProjection

> setProjection: function( | projCode,
> | units | )

initializes the OpenLayers projection object on the Map object

#### Parameters

projCode | {String} projection code
units | the units

### setMetersPerUnit

> setMetersPerUnit: function( | metersPerUnit | )

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.

#### Parameters

metersPerUnit | {Float} the value returned by LoadMap.php for meters per unit

### getMetersPerUnit

> getMetersPerUnit: function()

returns the meters per unit value

#### Return

metersPerUnit the value as set when the map initialized

### setViewOptions

> setViewOptions: function( | data | )

initializes all widgets with the map units after the map has loaded

### setWidgetParam

> setWidgetParam: function( | param,
> | data | )

initializes all widgets with a parameter and value at runtime

### geoToPixMeasure

> geoToPixMeasure: function( | fGeo | )

convert geographic into pixels.

#### Parameters

fGeo | {Float} distance in geographic units

#### Return

pixels

### getCurrentCenter

> getCurrentCenter: function()

returns the current center of the map view

#### Return

{Object} an object with the following attributes x - the x coordinate of the center y - the y coordinate of the center

### getCurrentExtents

> getCurrentExtents: function()

returns the current extents

### getExtentFromPoint

> getExtentFromPoint: function( | fX,
> | fY,
> | fScale | )

returns the Extent of the map given a center point and a scale (optional)

#### Return

{OpenLayers.Bounds} the bounds for the map centered on a point

### getScale

> getScale: function()

Gets the current scale of the map

#### Returns

The current map scale

### getResolution

> getResolution: function()

Gets the current resolution of the map

#### Returns

The current resolution of the map

### getSize

> getSize: function()

Gets the size of the map

#### Returns

return description

### cancelDigitization

> cancelDigitization: function()

De-activates any active digitizers

### digitizePoint

> digitizePoint: function( | options,
> | callback | )

Digitizes a point and passes the value to a function for processing. Digitization can be cancelled via the cancelDigitization() method or via pressing the ESC key

#### Parameters

callback | {Function} The callback function that will receive the digitized geometry

#### Return

{OpenLayers.Geometry.Point}

### digitizeLine

> digitizeLine: function( | options,
> | callback | )

Digitizes a line and passes the value to a function for processing. Digitization can be cancelled via the cancelDigitization() method or via pressing the ESC key

#### Parameters

options | {Object} digitization options
callback | {Function} The callback function that will receive the digitized geometry

#### Return

{OpenLayers.Geometry.LineString}

### digitizeLineString

> digitizeLineString: function( | options,
> | callback | )

Digitizes a line string and passes the value to a function for processing. Digitization can be cancelled via the cancelDigitization() method or via pressing the ESC key

#### Parameters

options | {Object} digitization options
callback | {Function} The callback function that will receive the digitized geometry

#### Return

{OpenLayers.Geometry.LineString}

### digitizeRectangle

> digitizeRectangle: function( | options,
> | callback | )

Digitizes a rectangle and passes the value to a function for processing. Digitization can be cancelled via the cancelDigitization() method or via pressing the ESC key

#### Parameters

options | {Object} digitization options
callback | {Function} The callback function that will receive the digitized geometry

#### Return

{OpenLayers.Geometry.Polygon}

### digitizePolygon

> digitizePolygon: function( | options,
> | callback | )

Digitizes a polygon and passes the value to a function for processing. Digitization can be cancelled via the cancelDigitization() method or via pressing the ESC key

#### Parameters

options | {Object} digitization options
callback | {Function} The callback function that will receive the digitized geometry

#### Return

{OpenLayers.Geometry.Polygon}

### digitizeCircle

> digitizeCircle: function( | options,
> | callback | )

Digitizes a circle and passes the value to a function for processing. Digitization can be cancelled via the cancelDigitization() method or via pressing the ESC key

#### Parameters

options | {Object} digitization options
callback | {Function} The callback function that will receive the digitized circle

#### Return

{Object} | The circle structured { x, y, r }

## Fusion.SelectionObject

Holds information about selected map features

Summary

Functions |
getNumElements | Gets the number of selected map features
getLowerLeftCoord | Gets the lower left coordinate of this selection’s bounding box
getUpperRightCoord | Gets the upper right coordinate of this selection’s bounding box
getNumLayers | Gets the number of map layers included in this selection
getLayerByName | Gets the selected map layer by its name
getLayer | Gets the selected map layer by the specified index

### Functions

### getNumElements

> getNumElements : function()

Gets the number of selected map features

#### Returns

the number of selected map features

### getLowerLeftCoord

> getLowerLeftCoord : function()

Gets the lower left coordinate of this selection’s bounding box

#### Returns

the lower left coordinate

### getUpperRightCoord

> getUpperRightCoord : function()

Gets the upper right coordinate of this selection’s bounding box

#### Returns

the upper right coordinate

### getNumLayers

> getNumLayers : function()

Gets the number of map layers included in this selection

#### Returns

The number of map layers

### getLayerByName

> getLayerByName : function( | name | )

Gets the selected map layer by its name

#### Parameters

name | The name of the selected map layer

#### Returns

{Fusion.SelectionObject.Layer} The selected map layer

### getLayer

> getLayer : function( | iIndice | )

Gets the selected map layer by the specified index

#### Parameters

iIndice | The index of the selected map layer

#### Returns

{Fusion.SelectionObject.Layer} The selected map layer

## Fusion.SelectionObject.Layer

Defines a map layer in a {Fusion.SelectionObject}

It is to show a floating message bar over the main map viewer

> setExternalBaseLayer: function( | baseLayer | )

Sets the given external layer as the new base layer

> mapLoaded: function()

Callback for when all maps have been loaded

> setMenu: function()

Attaches a context menu as defined in the AppDef to the map

> loadMapGroup: function( | mapGroup,
> | loadOverlays | )

Controls the creation of Layers based on the MapGroup object passed in

> layerLoaded: function( | mapTag | )

Called after each layer is loaded in the OL viewport.

> wheelChange: function( | evt,
> | deltaZ | )

handles mouse wheel events by accummulating the events and setting a timer to do the actual zoom in/out

> doWheelChange: function( | evt,
> | deltaZ | )

Carries out the actual map zoom based on the wheel movement

> wheelUp: function( | evt | )

User spun scroll wheel up

> wheelDown: function( | evt | )

User spun scroll wheel down

> getDomObj: function()

returns the dom element for this widget

> getDomId: function()

returns the ID of dom element for this widget

> setMapOptions: function( | options | )

sets options on the OpenLayers map object, a wrapper for the OL function

> addMap: function( | map | )

adds a map/Layer to the map and registers some event handlers on the map

> getAllMaps: function()

returns the array of map objects

> reloadMap: function()

Called to reload all the map objects.

> loadScaleRanges: function()

Loads the ScaleRange objects separate from the LoadMap sequence since this also generates sprites and is a relatively expensive operation.

> query: function( | options | )

dispatch query requests to the maps

> selectionHandler: function()

handle selection events from maps and republish for widgets as appropriate

> hasSelection: function()

cehck to see if any of the maps have an active selection

> clearSelection: function()

clear the selection on all maps

> getSelection: function( | callback,
> | layers,
> | startcount | )

initiates a call to get the current selection asynchronously in case we need to retrieve the details from the server

> setSelection: function( | selText,
> | zoomTo | )

sets a Selection XML back to the server for each of the maps

> accumulateSelection: function( | map,
> | oSelection | )

accumulate the selection results from each map and when all have reported in, pass the results to the callback function

> setActiveLayer: function( | oLayer | )

sets the active layer for selection/manipulation

> getActiveLayer: function()

returns the active layer for selection/manipulation

> _addWorker: function()

indicate that a new asynchronous process has started and make sure the visual indicator is visible for the user.

> _removeWorker: function()

indicate that an asynchronous process has completed and hide the visual indicator if no remaining processes are active.

> mapExtentsChanged: function()

OpenLayers event handler for whenever the map changes either zoom level of the center has changed.

> isBusy: function()

check to see if there are any outstanding requests to the server

> sizeChanged: function()

callback for when the browser window size changes, simply calls resize on the map viewport layout object

> resize: function()

handles the resizing of the maps and triggers a Fusion event

> redraw: function()

redraws the map using current extents and zoom level.

> setBackgroundColor: function( | color | )

sets the background color for the map

> setExtents: function( | oExtents | )

handle selection events from maps and republish for widgets as appropriate

> setInitialExtents: function()

1.

> getMapGroupExtent: function( | includeGenericLayers | )

gets the intitial extents from all maps with or without including the extent of any Generic/commercial layers

> fullExtents: function()

sets the extent of the map to the max as returned by loadMap

> isMapLoaded: function()

returns if the map has finished loading (based on setting the _oCurrentExtent value)

> zoom: function( | fX,
> | fY,
> | nFactor | )

sets the map zoom and extent.

> zoomToScale: function( | fScale | )

Zooms to the specified scale

> pixToGeo: function( | pX,
> | pY | )

convert pixel coordinates into geographic coordinates.

> geoToPix: function( | gX,
> | gY | )

convert geographic coordinates into pixel coordinates.

> pixToGeoMeasure: function( | nPixels | )

convert pixel into geographic : used to measure.

> setProjection: function( | projCode,
> | units | )

initializes the OpenLayers projection object on the Map object

> setMetersPerUnit: function( | metersPerUnit | )

initializes the meters per unit values when a new map is loaded.

> getMetersPerUnit: function()

returns the meters per unit value

> setViewOptions: function( | data | )

initializes all widgets with the map units after the map has loaded

> setWidgetParam: function( | param,
> | data | )

initializes all widgets with a parameter and value at runtime

> geoToPixMeasure: function( | fGeo | )

convert geographic into pixels.

> getCurrentCenter: function()

returns the current center of the map view

> getCurrentExtents: function()

returns the current extents

> getExtentFromPoint: function( | fX,
> | fY,
> | fScale | )

returns the Extent of the map given a center point and a scale (optional)

> getScale: function()

Gets the current scale of the map

> getResolution: function()

Gets the current resolution of the map

> getSize: function()

Gets the size of the map

> cancelDigitization: function()

De-activates any active digitizers

> digitizePoint: function( | options,
> | callback | )

Digitizes a point and passes the value to a function for processing.

> digitizeLine: function( | options,
> | callback | )

Digitizes a line and passes the value to a function for processing.

> digitizeLineString: function( | options,
> | callback | )

Digitizes a line string and passes the value to a function for processing.

> digitizeRectangle: function( | options,
> | callback | )

Digitizes a rectangle and passes the value to a function for processing.

> digitizePolygon: function( | options,
> | callback | )

Digitizes a polygon and passes the value to a function for processing.

> digitizeCircle: function( | options,
> | callback | )

Digitizes a circle and passes the value to a function for processing.

> getNumElements : function()

Gets the number of selected map features

> getLowerLeftCoord : function()

Gets the lower left coordinate of this selection’s bounding box

> getUpperRightCoord : function()

Gets the upper right coordinate of this selection’s bounding box

> getNumLayers : function()

Gets the number of map layers included in this selection

> getLayerByName : function( | name | )

Gets the selected map layer by its name

> getLayer : function( | iIndice | )

Gets the selected map layer by the specified index
Holds information about selected map features
Instances of OpenLayers.Map are interactive maps embedded in a web page.
an internal class for managing generic events.
Instances of this class represent bounding boxes.
Defines a map layer in a {Fusion.SelectionObject}
Close