EMS.Control.LayerSwitcher

A control for switching between various layers.  This gets the layers from the map itself.  This handles special layers EMS.Layer.PHOTO and EMS.Layer.HYBRID slightly differently if they are present.

Please note that this control will only work if positioned <EMS.Position.LEFT>.  You can attach it to the bottom or top but not to the right.

Inherits from

Summary
EMS.Control.LayerSwitcherA control for switching between various layers.
Properties
height{Integer} is the height of the control in pixels.
background{String} background image.
northArrow{EMS.Control.NorthArrow} is the north arrow control.
position{Mixed} is either OpenLayers.Pixel or a EMS.Position.
Functions
destroy
drawDraws the control itself.
EMS.Control.LayerSwitcher.ButtonInternal class of the EMS.Control.LayerSwitcher for rendering a button.
Constants
FONT{String} CSS style applied to the button if text is passed in.
COLOR{String} CSS color used for text.
HEIGHT{Integer} height in pixels of the button.
Properties
layer{OpenLayers.Layer} is the layer this button is attached to.
first{Boolean} property indicating the button is first in the set.
last{Boolean} property indicating the button is last in the set, it may also be first as well.
Constructor
EMS.Control.LayerSwitcher.Button
Functions
destroyCleans up the listeners.
updateCalled post draw to update any labelling.
draw{DOMElement} newly created element ready for insertion.
isSelected{Boolean} will return true if the button is considered selected.
selectPuts the button into a select state.
unselectTurns the select state off.
EMS.Control.LayerSwitcher.PhotoButtonInternal class of the EMS.Control.LayerSwitcher for rendering a photo button.
Functions
destroy
drawExtension of the button to add the hide and show link to button if there is a EMS.Layer.HYBRID available.
updateCalled post draw to update any labelling.
selectPuts the button into a select state.
unselectTurns the select state off.

Properties

height

{Integer} is the height of the control in pixels.

background

{String} background image.

northArrow

{EMS.Control.NorthArrow} is the north arrow control.  If defaulted, it will just use the control with the default option.

position

{Mixed} is either OpenLayers.Pixel or a EMS.Position.  This defaults to be the top left.

Functions

destroy

destroy: function()

draw

draw: function(px)

Draws the control itself.

Parameters

px{Mixed} is either OpenLayers.Pixel or a EMS.Position.

Returns

{DOMElement}

EMS.Control.LayerSwitcher.Button

Internal class of the EMS.Control.LayerSwitcher for rendering a button.

Summary
Constants
FONT{String} CSS style applied to the button if text is passed in.
COLOR{String} CSS color used for text.
HEIGHT{Integer} height in pixels of the button.
Properties
layer{OpenLayers.Layer} is the layer this button is attached to.
first{Boolean} property indicating the button is first in the set.
last{Boolean} property indicating the button is last in the set, it may also be first as well.
Constructor
EMS.Control.LayerSwitcher.Button
Functions
destroyCleans up the listeners.
updateCalled post draw to update any labelling.
draw{DOMElement} newly created element ready for insertion.
isSelected{Boolean} will return true if the button is considered selected.
selectPuts the button into a select state.
unselectTurns the select state off.

Constants

FONT

{String} CSS style applied to the button if text is passed in.

COLOR

{String} CSS color used for text.

HEIGHT

{Integer} height in pixels of the button.

Properties

layer

{OpenLayers.Layer} is the layer this button is attached to.

first

{Boolean} property indicating the button is first in the set.

last

{Boolean} property indicating the button is last in the set, it may also be first as well.

Constructor

EMS.Control.LayerSwitcher.Button

Parameters

options{Object} which contains the options.  The options that are used are text, first and content.

Functions

destroy

destroy: function()

Cleans up the listeners.

update

update: function()

Called post draw to update any labelling.

draw

draw: function()

Returns

{DOMElement} newly created element ready for insertion.

isSelected

isSelected: function()

Returns

{Boolean} will return true if the button is considered selected.

select

select: function()

Puts the button into a select state.

unselect

unselect: function()

Turns the select state off.

EMS.Control.LayerSwitcher.PhotoButton

Internal class of the EMS.Control.LayerSwitcher for rendering a photo button.  This is a specialised form of the EMS.Control.LayerSwitcher.Button particularly made for the EMS.Layer.PHOTO layer.  The difference being between this and a normal button, there will be a link allowing turning on or off of the EMS.Layer.HYBRID layer (if it is present in the map).  Inherits from:

Summary
Functions
destroy
drawExtension of the button to add the hide and show link to button if there is a EMS.Layer.HYBRID available.
updateCalled post draw to update any labelling.
selectPuts the button into a select state.
unselectTurns the select state off.

Functions

destroy

destroy: function()

draw

draw: function()

Extension of the button to add the hide and show link to button if there is a EMS.Layer.HYBRID available.

update

update: function()

Called post draw to update any labelling.

select

select: function()

Puts the button into a select state.

unselect

unselect: function()

Turns the select state off.

A simple north arrow from an image.
This class represents a screen coordinate, in x and y coordinates
Enumeration of possible positions relative to the map.
destroy: function()
draw: function(px)
Draws the control itself.
A control for switching between various layers.
destroy: function()
Cleans up the listeners.
update: function()
Called post draw to update any labelling.
draw: function()
{DOMElement} newly created element ready for insertion.
isSelected: function()
{Boolean} will return true if the button is considered selected.
select: function()
Puts the button into a select state.
unselect: function()
Turns the select state off.
destroy: function()
draw: function()
Extension of the button to add the hide and show link to button if there is a EMS.Layer.HYBRID available.
Hybrid layer.
update: function()
Called post draw to update any labelling.
select: function()
Puts the button into a select state.
unselect: function()
Turns the select state off.
Photo layer.
Extention to the OpenLayers.Control that translates relative positions from EMS.Position.
Internal class of the EMS.Control.LayerSwitcher for rendering a button.
Close