# Legato.OpenLayers.Map.Util

Summary

Legato.OpenLayers.Map.Util |
Functions |
getOverlays | Just returns from given layers overlays
getSelectedLayers | Just returns from given layers all selected layers
getQueryableLayers | {Array(<OpenLayers.Layer>)} Found queryable layers
getSnappableLayers | {Array(<OpenLayers.Layer>)} Found snappable layers
getUnselectedLayers | Just returns from given layers all unselected layers
isVectorLayer | Determines if given layer is a vector layer.
getLayersWithoutLegatoIgnore | Just returns from given layers all layers which do’nt have the legatoIgnore flag.
getLayersLegatoIgnore | Just returns from given layers all layers which have the legatoIgnore flag set to true.
getBaseLayers | Just returns from given layers baselayers
getVisibleLayers | Just returns from given layers visible layers
getInvisibleLayers | Just returns from given layers invisible layers
getInvisibleBaseLayers | Just returns from given layers invisible baselayers
getVisibleBaseLayers | Just returns from given layers visible baselayers
getInvisibleOverlays | Just returns from given layers invisible overlays
getVisibleOverlays | Just returns from given layers visible overlays
getLayerIds | Extracts from given layers array all layerids and returns them as an array
getBoxSelectionAsVector | Returns a new box vector based on drawn mouse position box.
getPointSelectionAsVector | params map <OpenLayers.Map> an OpenLayers Map position <OpenLayers.Bounds> a Selection which wants to be transformed into a vector layer
isValidBBox | Validates given BBox if it contains some reasonable values
moveLayer | Moves the given layer up or down
getViewPortPxFromLonLat | Returns a pixel location given a map location.

### Functions

### getOverlays

> Legato.OpenLayers.Map.Util.getOverlays = function( | layers | )

Just returns from given layers overlays

#### Returns

{Array(<OpenLayers.Layer>)} All found overlays

### getSelectedLayers

> Legato.OpenLayers.Map.Util.getSelectedLayers = function( | layers | )

Just returns from given layers all selected layers

#### Returns

{Array(<OpenLayers.Layer>)} All found selected layers

### getQueryableLayers

> Legato.OpenLayers.Map.Util.getQueryableLayers = function( | layers | )

#### Returns

{Array(<OpenLayers.Layer>)} Found queryable layers

### getSnappableLayers

> Legato.OpenLayers.Map.Util.getSnappableLayers = function( | layers | )

#### Returns

{Array(<OpenLayers.Layer>)} Found snappable layers

### getUnselectedLayers

> Legato.OpenLayers.Map.Util.getUnselectedLayers = function( | layers | )

Just returns from given layers all unselected layers

#### Returns

{Array(<OpenLayers.Layer>)} All found unselected layers

### isVectorLayer

> Legato.OpenLayers.Map.Util.isVectorLayer = function( | layer | )

Determines if given layer is a vector layer.

#### Returns

{Boolean} True if Vector layer, false otherwise

### getLayersWithoutLegatoIgnore

> Legato.OpenLayers.Map.Util.getLayersWithoutLegatoIgnore = function( | layers | )

Just returns from given layers all layers which do’nt have the legatoIgnore flag.

#### Returns

{Array(<OpenLayers.Layer>)} All found selected layers without the legatoIgnore flag

### getLayersLegatoIgnore

> Legato.OpenLayers.Map.Util.getLayersLegatoIgnore = function( | layers | )

Just returns from given layers all layers which have the legatoIgnore flag set to true.

#### Returns

{Array(<OpenLayers.Layer>)} All found selected layers where the legatoIgnore flag is true

### getBaseLayers

> Legato.OpenLayers.Map.Util.getBaseLayers = function( | layers | )

Just returns from given layers baselayers

#### Returns

{Array(<OpenLayers.Layer>)} All found baselayers

### getVisibleLayers

> Legato.OpenLayers.Map.Util.getVisibleLayers = function( | layers | )

Just returns from given layers visible layers

#### Returns

{Array(<OpenLayers.Layer>)} All found visible layers

### getInvisibleLayers

> Legato.OpenLayers.Map.Util.getInvisibleLayers = function( | layers | )

Just returns from given layers invisible layers

#### Returns

{Array(<OpenLayers.Layer>)} All found invisible layers

### getInvisibleBaseLayers

> Legato.OpenLayers.Map.Util.getInvisibleBaseLayers = function( | layers | )

Just returns from given layers invisible baselayers

#### Returns

{Array(<OpenLayers.Layer>)} All found invisible baselayers

### getVisibleBaseLayers

> Legato.OpenLayers.Map.Util.getVisibleBaseLayers = function( | layers | )

Just returns from given layers visible baselayers

#### Returns

{Array(<OpenLayers.Layer>)} All found visible baselayers

### getInvisibleOverlays

> Legato.OpenLayers.Map.Util.getInvisibleOverlays = function( | layers | )

Just returns from given layers invisible overlays

#### Returns

{Array(<OpenLayers.Layer>)} All found invisible overlays

### getVisibleOverlays

> Legato.OpenLayers.Map.Util.getVisibleOverlays = function( | layers | )

Just returns from given layers visible overlays

#### Returns

{Array(<OpenLayers.Layer>)} All found visible overlays

### getLayerIds

> Legato.OpenLayers.Map.Util.getLayerIds = function( | layers | )

Extracts from given layers array all layerids and returns them as an array

#### Returns

{Array(String)} All layer ids

### getBoxSelectionAsVector

> Legato.OpenLayers.Map.Util.getBoxSelectionAsVector = function( | map,
> | position | )

Returns a new box vector based on drawn mouse position box.

#### Parameters

params | {Object} map <OpenLayers.Map> an OpenLayers Map position <OpenLayers.Bounds> a Selection which wants to be transformed into a vector layer

#### Returns

{<OpenLayers.Feature.Vector>} | The given Selection as Vector

### getPointSelectionAsVector

> Legato.OpenLayers.Map.Util.getPointSelectionAsVector = function( | map,
> | position | )

#### Parameters

params map <OpenLayers.Map> an OpenLayers Map position <OpenLayers.Bounds> a Selection which wants to be transformed into a vector layer

#### Returns

{<OpenLayers.Feature.Vector>} | The given Selection as Vector

### isValidBBox

> Legato.OpenLayers.Map.Util.isValidBBox = function( | bbox | )

Validates given BBox if it contains some reasonable values

#### Parameters

bbox | {<OpenLayers.Bounds>} The BBox to validate

#### Returns

{Boolean} | True if valid, false otherwise

### moveLayer

> Legato.OpenLayers.Map.Util.moveLayer = function( | params | )

Moves the given layer up or down

#### Parameters

params | {Object} a hashmap which contains

- layer {<OpenLayers.Layer>} the layer to move
- up {Boolean} true = layer will be moved up, false = moved down

### getViewPortPxFromLonLat

> Legato.OpenLayers.Map.Util.getViewPortPxFromLonLat = function ( | lonlat,
> | resolution,
> | extent | )

Returns a pixel location given a map location. This method will return fractional pixel values.

#### Parameters

lonlat | {<OpenLayers.LonLat>}
resolution | {Number}
extent | {<OpenLayers.Bounds>}

#### Returns

{<OpenLayers.Pixel>} An <OpenLayers.Pixel> which is the passed-in <OpenLayers.LonLat>,translated into view port pixels.

> Legato.OpenLayers.Map.Util.getOverlays = function( | layers | )

Just returns from given layers overlays

> Legato.OpenLayers.Map.Util.getSelectedLayers = function( | layers | )

Just returns from given layers all selected layers

> Legato.OpenLayers.Map.Util.getQueryableLayers = function( | layers | )

{Array(OpenLayers.Layer)} Found queryable layers

> Legato.OpenLayers.Map.Util.getSnappableLayers = function( | layers | )

{Array(OpenLayers.Layer)} Found snappable layers

> Legato.OpenLayers.Map.Util.getUnselectedLayers = function( | layers | )

Just returns from given layers all unselected layers

> Legato.OpenLayers.Map.Util.isVectorLayer = function( | layer | )

Determines if given layer is a vector layer.

> Legato.OpenLayers.Map.Util.getLayersWithoutLegatoIgnore = function( | layers | )

Just returns from given layers all layers which do’nt have the legatoIgnore flag.

> Legato.OpenLayers.Map.Util.getLayersLegatoIgnore = function( | layers | )

Just returns from given layers all layers which have the legatoIgnore flag set to true.

> Legato.OpenLayers.Map.Util.getBaseLayers = function( | layers | )

Just returns from given layers baselayers

> Legato.OpenLayers.Map.Util.getVisibleLayers = function( | layers | )

Just returns from given layers visible layers

> Legato.OpenLayers.Map.Util.getInvisibleLayers = function( | layers | )

Just returns from given layers invisible layers

> Legato.OpenLayers.Map.Util.getInvisibleBaseLayers = function( | layers | )

Just returns from given layers invisible baselayers

> Legato.OpenLayers.Map.Util.getVisibleBaseLayers = function( | layers | )

Just returns from given layers visible baselayers

> Legato.OpenLayers.Map.Util.getInvisibleOverlays = function( | layers | )

Just returns from given layers invisible overlays

> Legato.OpenLayers.Map.Util.getVisibleOverlays = function( | layers | )

Just returns from given layers visible overlays

> Legato.OpenLayers.Map.Util.getLayerIds = function( | layers | )

Extracts from given layers array all layerids and returns them as an array

> Legato.OpenLayers.Map.Util.getBoxSelectionAsVector = function( | map,
> | position | )

Returns a new box vector based on drawn mouse position box.

> Legato.OpenLayers.Map.Util.getPointSelectionAsVector = function( | map,
> | position | )

params map OpenLayers.Map an OpenLayers Map position OpenLayers.Bounds a Selection which wants to be transformed into a vector layer

> Legato.OpenLayers.Map.Util.isValidBBox = function( | bbox | )

Validates given BBox if it contains some reasonable values

> Legato.OpenLayers.Map.Util.moveLayer = function( | params | )

Moves the given layer up or down

> Legato.OpenLayers.Map.Util.getViewPortPxFromLonLat = function ( | lonlat,
> | resolution,
> | extent | )

Returns a pixel location given a map location.