EMS.Icon

Inherits from

Summary
EMS.Icon
states{Integer} is the number of states the icon has.
Functions
EMS.IconCreates a new instance of a hover icon.
drawConstructs contents of the control.
setState
Static Functions
start{EMS.Icon} A new start icon useful for putting at the start of a route.
end{EMS.Icon} A end start icon useful for putting at the end of a route.
via
crossShortcut for getting a cross-hair icon.
poi
multipoi
babushka

states

{Integer} is the number of states the icon has.  This defaults to one.

Functions

EMS.Icon

Creates a new instance of a hover icon.

Parameters

url{String} The URL of the icon.
size{OpenLayers.Size} The size of the icon.
offset{OpenLayers.Pixel} The offset to the center of the icon.
calculateOffset{Function} A (optional) function to calculate the offset to the center of the icon.
states{Integer} The number of states this icon contains (defaults to 1).

draw

draw: function(px)

Constructs contents of the control.

Parameters

px{OpenLayers.Pixel}

Returns

{DOMElement} A reference to a div that represents this control.

setState

setState: function(state)

Parameters

state{Integer} is the state to set.

Static Functions

start

EMS.Icon.start = function()

Returns

{EMS.Icon} A new start icon useful for putting at the start of a route.

end

EMS.Icon.end = function()

Returns

{EMS.Icon} A end start icon useful for putting at the end of a route.

via

EMS.Icon.via = function(index)

Parameters

index{Integer} is the index, a value between 1 and 5 which will appear on the icon.  Returns: {EMS.Icon} A via point with a number on it.

cross

EMS.Icon.crosshair = function(color)

Shortcut for getting a cross-hair icon.

Parameter

color{String|<EMS.Color>} is either a string name such as GREEN, RED or BLUE.  Or one EMS.Color.  Only RED, GREEN or BLUE is currently supported.  If nothing is given, it will default to BLUE.

Returns

{EMS.Icon} A cross hair icon.

poi

EMS.Icon.poi = function(text,
color,
background,
hover)

Parameters

text{String} is the text to be shown.  There is really only enough room on the icon for about 2-3 characters.
color{String}|{EMS.Color} is the {String} name of the color, the {String} hex color or the EMS.Color.  This is optional and will default to being white.
background{String|<EMS.Gradient>} is the {String} name of the gradient or a EMS.Gradient.  This is optional and will default to being EMS.Gradient.RED.
hover{String|<EMS.Gradient>} is the {String} name of the gradient or a EMS.Gradient to be used for the hover color.  This will default to blue one is not given.

Returns

{EMS.Icon} A newly created poi icon.

multipoi

EMS.Icon.multipoi = function(text,
color,
background,
hover)

Parameters

text{String} is the text to be shown.  This is the little number in the top right corner.
color{String|<EMS.Color>} is the {String} name of the color, the {String} hex color or the EMS.Color.  This is optional and will default to being white.
background{String|<EMS.Gradient>} is the {String} name of the gradient or a EMS.Gradient.  This is optional and will default to being EMS.Gradient.RED.
hover{String|<EMS.Gradient>} is the {String} name of the gradient or a EMS.Gradient to be used for the hover color.  This will default to blue one is not given.

Returns

{EMS.Icon} A newly created poi icon.

babushka

EMS.Icon.babushka = function(text,
color,
background,
hover)

Parameters

text{String} is the text to be shown.  This is the little number in the top right corner.
color{String|<EMS.Color>} is the {String} name of the color, the {String} hex color or the EMS.Color.  This is optional and will default to being white.
background{String|<EMS.Gradient>} is the {String} name of the gradient or a EMS.Gradient.  This is optional and will default to being EMS.Gradient.RED.
hover{String|<EMS.Gradient>} is the {String} name of the gradient or a EMS.Gradient to be used for the hover color.  This will default to blue one is not given.

Returns

{EMS.Icon} A newly created babushka icon.

draw: function(px)
Constructs contents of the control.
setState: function(state)
EMS.Icon.start = function()
{EMS.Icon} A new start icon useful for putting at the start of a route.
Creates a new instance of a hover icon.
EMS.Icon.end = function()
{EMS.Icon} A end start icon useful for putting at the end of a route.
EMS.Icon.via = function(index)
EMS.Icon.crosshair = function(color)
Shortcut for getting a cross-hair icon.
EMS.Icon.poi = function(text,
color,
background,
hover)
EMS.Icon.multipoi = function(text,
color,
background,
hover)
EMS.Icon.babushka = function(text,
color,
background,
hover)
The icon represents a graphical icon on the screen.
Instances of this class represent a width/height pair
This class represents a screen coordinate, in x and y coordinates
Color gradient with a start and end color.
Red gradient.
Close