Map.js | |
Constants | |
Fusion. | |
Fusion. | |
Fusion. | |
Fusion. | |
Fusion. | |
Fusion. | |
Fusion. | |
Fusion. | |
Fusion. | |
Fusion. | |
Fusion. | |
Fusion. | |
Fusion. | |
Fusion. | |
Fusion. | |
Fusion. | |
Fusion. | |
Fusion. | |
Fusion. | |
Fusion. | |
Fusion. | |
Fusion. | |
Fusion. | |
Fusion. | generic class for map widgets. |
Properties | |
isDigitizing | Gets whether a digitizer is currently active |
message | The {Fusion.MapMessage} notification bar |
Functions | |
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. | 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. | Defines a map layer in a {Fusion.SelectionObject} |
generic class for map widgets. Provides common utility classes. This class provides a wrapper around the {OpenLayers.Map} object.
Properties | |
isDigitizing | Gets whether a digitizer is currently active |
message | The {Fusion.MapMessage} notification bar |
Functions | |
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. |
The {Fusion.MapMessage} notification bar
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
_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
setInitialExtents: function()
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
zoom: function( fX, fY, nFactor )
sets the map zoom and extent.
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 |
Returns: none
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.
metersPerUnit | {Float} the value returned by LoadMap.php for meters per unit |
getExtentFromPoint: function( fX, fY, fScale )
returns the Extent of the map given a center point and a scale (optional)
{OpenLayers.Bounds} the bounds for the map centered on a point
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
callback | {Function} The callback function that will receive the digitized geometry |
{OpenLayers.Geometry.Point}
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
options | {Object} digitization options |
callback | {Function} The callback function that will receive the digitized geometry |
{OpenLayers.Geometry.LineString}
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
options | {Object} digitization options |
callback | {Function} The callback function that will receive the digitized geometry |
{OpenLayers.Geometry.LineString}
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
options | {Object} digitization options |
callback | {Function} The callback function that will receive the digitized geometry |
{OpenLayers.Geometry.Polygon}
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
options | {Object} digitization options |
callback | {Function} The callback function that will receive the digitized geometry |
{OpenLayers.Geometry.Polygon}
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
options | {Object} digitization options |
callback | {Function} The callback function that will receive the digitized circle |
{Object} | The circle structured { x, y, r } |
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 |
getLayerByName : function( name )
Gets the selected map layer by its name
name | The name of the selected map layer |
{Fusion.SelectionObject.Layer} The selected map layer
getLayer : function( iIndice )
Gets the selected map layer by the specified index
iIndice | The index of the selected map layer |
{Fusion.SelectionObject.Layer} The selected map layer
Defines a map layer in a {Fusion.SelectionObject}
Callback for when all maps have been loaded
mapLoaded: function()
Attaches a context menu as defined in the AppDef to the map
setMenu: function()
Controls the creation of Layers based on the MapGroup object passed in
loadMapGroup: function( mapGroup, loadOverlays )
Called after each layer is loaded in the OL viewport.
layerLoaded: function( mapTag )
handles mouse wheel events by accummulating the events and setting a timer to do the actual zoom in/out
wheelChange: function( evt, deltaZ )
Carries out the actual map zoom based on the wheel movement
doWheelChange: function( evt, deltaZ )
User spun scroll wheel up
wheelUp: function( evt )
User spun scroll wheel down
wheelDown: function( evt )
returns the dom element for this widget
getDomObj: function()
returns the ID of dom element for this widget
getDomId: function()
sets options on the OpenLayers map object, a wrapper for the OL function
setMapOptions: function( options )
adds a map/Layer to the map and registers some event handlers on the map
addMap: function( map )
returns the array of map objects
getAllMaps: function()
Called to reload all the map objects.
reloadMap: function()
Loads the ScaleRange objects separate from the LoadMap sequence since this also generates sprites and is a relatively expensive operation.
loadScaleRanges: function()
dispatch query requests to the maps
query: function( options )
handle selection events from maps and republish for widgets as appropriate
selectionHandler: function()
cehck to see if any of the maps have an active selection
hasSelection: function()
clear the selection on all maps
clearSelection: function()
initiates a call to get the current selection asynchronously in case we need to retrieve the details from the server
getSelection: function( callback, layers, startcount )
sets a Selection XML back to the server for each of the maps
setSelection: function( selText, zoomTo )
accumulate the selection results from each map and when all have reported in, pass the results to the callback function
accumulateSelection: function( map, oSelection )
sets the active layer for selection/manipulation
setActiveLayer: function( oLayer )
returns the active layer for selection/manipulation
getActiveLayer: function()
indicate that a new asynchronous process has started and make sure the visual indicator is visible for the user.
_addWorker: function()
indicate that an asynchronous process has completed and hide the visual indicator if no remaining processes are active.
_removeWorker: function()
OpenLayers event handler for whenever the map changes either zoom level of the center has changed.
mapExtentsChanged: function()
check to see if there are any outstanding requests to the server
isBusy: function()
callback for when the browser window size changes, simply calls resize on the map viewport layout object
sizeChanged: function()
handles the resizing of the maps and triggers a Fusion event
resize: function()
redraws the map using current extents and zoom level.
redraw: function()
sets the background color for the map
setBackgroundColor: function( color )
handle selection events from maps and republish for widgets as appropriate
setExtents: function( oExtents )
1.
setInitialExtents: function()
gets the intitial extents from all maps with or without including the extent of any Generic/commercial layers
getMapGroupExtent: function( includeGenericLayers )
sets the extent of the map to the max as returned by loadMap
fullExtents: function()
returns if the map has finished loading (based on setting the _oCurrentExtent value)
isMapLoaded: function()
sets the map zoom and extent.
zoom: function( fX, fY, nFactor )
Zooms to the specified scale
zoomToScale: function( fScale )
convert pixel coordinates into geographic coordinates.
pixToGeo: function( pX, pY )
convert geographic coordinates into pixel coordinates.
geoToPix: function( gX, gY )
convert pixel into geographic : used to measure.
pixToGeoMeasure: function( nPixels )
initializes the OpenLayers projection object on the Map object
setProjection: function( projCode, units )
initializes the meters per unit values when a new map is loaded.
setMetersPerUnit: function( metersPerUnit )
returns the meters per unit value
getMetersPerUnit: function()
initializes all widgets with the map units after the map has loaded
setViewOptions: function( data )
initializes all widgets with a parameter and value at runtime
setWidgetParam: function( param, data )
convert geographic into pixels.
geoToPixMeasure: function( fGeo )
returns the current center of the map view
getCurrentCenter: function()
returns the current extents
getCurrentExtents: function()
returns the Extent of the map given a center point and a scale (optional)
getExtentFromPoint: function( fX, fY, fScale )
Gets the current scale of the map
getScale: function()
Gets the current resolution of the map
getResolution: function()
Gets the size of the map
getSize: function()
De-activates any active digitizers
cancelDigitization: function()
Digitizes a point and passes the value to a function for processing.
digitizePoint: function( options, callback )
Digitizes a line and passes the value to a function for processing.
digitizeLine: function( options, callback )
Digitizes a line string and passes the value to a function for processing.
digitizeLineString: function( options, callback )
Digitizes a rectangle and passes the value to a function for processing.
digitizeRectangle: function( options, callback )
Digitizes a polygon and passes the value to a function for processing.
digitizePolygon: function( options, callback )
Digitizes a circle and passes the value to a function for processing.
digitizeCircle: function( options, callback )
Gets the number of selected map features
getNumElements : function()
Gets the lower left coordinate of this selection’s bounding box
getLowerLeftCoord : function()
Gets the upper right coordinate of this selection’s bounding box
getUpperRightCoord : function()
Gets the number of map layers included in this selection
getNumLayers : function()
Gets the selected map layer by its name
getLayerByName : function( name )
Gets the selected map layer by the specified index
getLayer : function( iIndice )