EMS.Control.PanButton

This is the pan buttons for panning north, south, east and west on the map.  The will appear at the extremes of the map element.  You can adjust this by setting an offset.

Unless explicitly stated by using the fullsize flag, these will resize depending on the size of the map.

You may also use your own icon.

Default example

// Will dynamically adjust the size of the icon depending on the map size
var north = new EMS.Control.PanButton("n");

Fullsize only example

// Will always use the large sized icon
var north = new EMS.Control.PanButton("n", {fullsize: true});

Miniature only example

// Will always use the small sized icon
var north = new EMS.Control.PanButton("n", {fullsize: false});

Offset example

// Will be 20 pixels from the edge of the map element
var north = new EMS.Control.PanButton("n", {offset: 20});

Custom icon example

// Custom icon is used, this will not resize dynamically
var icon = new OpenLayers.Icon("north.png", new OpenLayers.Size(16, 20));
var north = new EMS.Control.PanButton("n", {icon: icon});

Inherits from

Summary
EMS.Control.PanButtonThis is the pan buttons for panning north, south, east and west on the map.
Constants
FULLSIZE_THRESHOLD{OpenLayers.Size} is the size of the map which, if in a dynamic state, the controls will change from miniture to fullsize or the other way around.
Properties
id{String} Prefix to the div.id
type{String} One of n, s, e, w
icon{OpenLayers.Icon} is the icon used as the display.
offset{Mixed} is an OpenLayers.Pixel or integer.
fullsize{Boolean} Small pan buttons or large.
Constructor
EMS.Control.PanButtonCreate an instance of EMS.Control.PanButton.
Functions
destroy
drawConstructs contents of the control.

Constants

FULLSIZE_THRESHOLD

{OpenLayers.Size} is the size of the map which, if in a dynamic state, the controls will change from miniture to fullsize or the other way around.

Properties

id

{String} Prefix to the div.id

type

{String} One of n, s, e, w

icon

{OpenLayers.Icon} is the icon used as the display.  This will be created if not set.

offset

{Mixed} is an OpenLayers.Pixel or integer.  Offset for the pan arrow and the outer edge of the map.

fullsize

{Boolean} Small pan buttons or large.  If not set, the control goes into a dynamic state where it will decide the size of the control based on the size of the map.

Constructor

EMS.Control.PanButton

Create an instance of EMS.Control.PanButton.

Parameters

type{String} One of n, s, e, w.
options{Object} Extra options to override existing properties or add new ones.  These are: fullsize, icon and offset.

Functions

destroy

destroy: function()

draw

draw: function()

Constructs contents of the control.

Returns

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

Instances of this class represent a width/height pair
The icon represents a graphical icon on the screen.
This class represents a screen coordinate, in x and y coordinates
Create an instance of EMS.Control.PanButton.
destroy: function()
draw: function()
Constructs contents of the control.
Extention to the OpenLayers.Control that translates relative positions from EMS.Position.
Close