EMS.Popup

A popup is a small div that can opened and closed on the map.  Typically opened in response to clicking on a marker.  See OpenLayers.Marker.  Popups don’t require their own layer and are added the the map using the OpenLayers.Map.addPopup method.

Example

popup = new EMS.Popup("chicken",
                   new OpenLayers.LonLat(5,40),
                   new OpenLayers.Size(200,200),
                   "example popup",
                   marker.icon,
                   true);

map.addPopup(popup);
Summary
EMS.PopupA popup is a small div that can opened and closed on the map.
Constants
EVENT_TYPES{Array} Supported application event types.
CLOSE_SIZE{OpenLayers.Size} the size of the close button.
CLOSE_IMAGE{String} path of the close button image.
CALLOUT_SIZE{OpenLayers.Size} is the size of the left and right callout arrows.
CALLOUT_LEFT_IMAGE{String} path of the left callout image.
CALLOUT_RIGHT_IMAGE{String} path of the right callout image.
Properties
events{OpenLayers.Events} events object to be used when attaching custom events handlers to this object.
id{String} Prefix to the div.id attribute.
lonlat{EMS.LonLat} Prefix to lonlat field
padding{Number} The internal padding for the content div.
Constructor
EMS.PopupConstructs a new instance of a popup.
Functions
visibleDetermine whether or not the popup is visible.
toggleToggle visibility of the popup.
showMake the popup visible.
hideMake the popup invisible.
setSizeSets the size of the popup.
setBackgroundColorSets the background colour of the popup.
setOpacitySets the opacity
setBorderSets the border style for the popup.
setContentHTMLSets the contents of the popup

Constants

EVENT_TYPES

{Array} Supported application event types.

CLOSE_SIZE

{OpenLayers.Size} the size of the close button.

CLOSE_IMAGE

{String} path of the close button image.

CALLOUT_SIZE

{OpenLayers.Size} is the size of the left and right callout arrows.

CALLOUT_LEFT_IMAGE

{String} path of the left callout image.

CALLOUT_RIGHT_IMAGE

{String} path of the right callout image.

Properties

events

{OpenLayers.Events} events object to be used when attaching custom events handlers to this object.

id

{String} Prefix to the div.id attribute.

lonlat

{EMS.LonLat} Prefix to lonlat field

padding

{Number} The internal padding for the content div.

Constructor

EMS.Popup

Constructs a new instance of a popup.

Properties

id{String}
lonlat{OpenLayers.LonLat}
size{OpenLayers.Size}
contentHTML{String}
anchor{Object} Object which must expose a -size OpenLayers.Size and -offset OpenLayers.Pixel (generally an {OpenLayers.Icon} or {EMS.Icon}).
closeBox{Boolean} whether to display close button.

Functions

visible

visible: function()

Determine whether or not the popup is visible.

Returns

{Boolean} indicating whether or not the popup is visible

toggle

toggle: function()

Toggle visibility of the popup.  Can trigger shown and hidden events.

show

show: function()

Make the popup visible.  Will trigger the shown event.

hide

hide: function()

Make the popup invisible.  Will trigger the hidden event.

setSize

setSize:function(size)

Sets the size of the popup.

Parameters

size{OpenLayers.Size} The size to set to

setBackgroundColor

setBackgroundColor:function(color)

Sets the background colour of the popup.

Parameters

color{Mixed} is either a {String} as a hex color or an EMS.Color.

setOpacity

setOpacity:function(opacity)

Sets the opacity

Parameters

opacity{Float}

setBorder

setBorder:function(border)

Sets the border style for the popup.

Parameters

border{String} the border style setting

setContentHTML

setContentHTML:function(contentHTML)

Sets the contents of the popup

Parameters

contentHTML{String} The HTML contents to place in the popup.
Drop-in replacement for OpenLayers.LonLat that automatically converts to the EMS.Projection.SPHERICAL_MERCATOR projection.
visible: function()
Determine whether or not the popup is visible.
toggle: function()
Toggle visibility of the popup.
show: function()
Make the popup visible.
hide: function()
Make the popup invisible.
setSize:function(size)
Sets the size of the popup.
setBackgroundColor:function(color)
Sets the background colour of the popup.
setOpacity:function(opacity)
Sets the opacity
setBorder:function(border)
Sets the border style for the popup.
setContentHTML:function(contentHTML)
Sets the contents of the popup
Instances of OpenLayers.Marker are a combination of a OpenLayers.LonLat and an OpenLayers.Icon.
addPopup: function(popup,
exclusive)
This class represents a longitude and latitude pair
Instances of this class represent a width/height pair
This class represents a screen coordinate, in x and y coordinates
The icon represents a graphical icon on the screen.
Close