# OpenLayers.Layer.EventPane

Base class for 3rd party layers. Create a new event pane layer with the OpenLayers.Layer.EventPane constructor.

#### Inherits from

- OpenLayers.Layer

Summary

OpenLayers.Layer.EventPane | Base class for 3rd party layers.
Properties |
smoothDragPan | {Boolean} smoothDragPan determines whether non-public/internal API methods are used for better performance while dragging EventPane layers.
isBaseLayer | {Boolean} EventPaned layers are always base layers, by necessity.
isFixed | {Boolean} EventPaned layers are fixed by default.
pane | {DOMElement} A reference to the element that controls the events.
mapObject | {Object} This is the object which will be used to load the 3rd party library in the case of the google layer, this will be of type GMap, in the case of the ve layer, this will be of type VEMap
Constructor |
OpenLayers.Layer.EventPane | Create a new event pane layer
Functions |
destroy | Deconstruct this layer.
setMap | Set the map property for the layer.
removeMap | On being removed from the map, we’ll like to remove the invisible ‘pane’ div that we added to it on creation.
loadWarningMessage | If we can’t load the map lib, then display an error message to the user and tell them where to go for help.
getWarningHTML | To be implemented by subclasses.
display | Set the display on the pane
setZIndex | Set the z-index order for the pane.
moveByPx | Move the layer based on pixel vector.
moveTo | Handle calls to move the layer.
getLonLatFromViewPortPx | Get a map location from a pixel location
getViewPortPxFromLonLat | Get a pixel location from a map location
getOLLonLatFromMapObjectLonLat | Get an OL style map location from a 3rd party style map location
getMapObjectLonLatFromOLLonLat | Get a 3rd party map location from an OL map location.
getOLPixelFromMapObjectPixel | Get an OL pixel location from a 3rd party pixel location.
getMapObjectPixelFromOLPixel | Get a 3rd party pixel location from an OL pixel location

### Properties

### smoothDragPan

{Boolean} smoothDragPan determines whether non-public/internal API methods are used for better performance while dragging EventPane layers. When not in sphericalMercator mode, the smoother dragging doesn’t actually move north/south directly with the number of pixels moved, resulting in a slight offset when you drag your mouse north south with this option on. If this visual disparity bothers you, you should turn this option off, or use spherical mercator. Default is on.

### isBaseLayer

{Boolean} EventPaned layers are always base layers, by necessity.

### isFixed

{Boolean} EventPaned layers are fixed by default.

### pane

{DOMElement} A reference to the element that controls the events.

### mapObject

{Object} This is the object which will be used to load the 3rd party library in the case of the google layer, this will be of type GMap, in the case of the ve layer, this will be of type VEMap

### Constructor

### OpenLayers.Layer.EventPane

Create a new event pane layer

#### Parameters

name | {String}
options | {Object} Hashtable of extra options to tag onto the layer

### Functions

### destroy

> destroy: function()

Deconstruct this layer.

### setMap

> setMap: function( | map | )

Set the map property for the layer. This is done through an accessor so that subclasses can override this and take special action once they have their map variable set.

#### Parameters

map | {OpenLayers.Map}

### removeMap

> removeMap: function( | map | )

On being removed from the map, we’ll like to remove the invisible ‘pane’ div that we added to it on creation.

#### Parameters

map | {OpenLayers.Map}

### loadWarningMessage

> loadWarningMessage:function()

If we can’t load the map lib, then display an error message to the user and tell them where to go for help.

This function sets up the layout for the warning message. Each 3rd party layer must implement its own getWarningHTML() function to provide the actual warning message.

### getWarningHTML

> getWarningHTML:function()

To be implemented by subclasses.

#### Returns

{String} String with information on why layer is broken, how to get it working.

### display

> display: function( | display | )

Set the display on the pane

#### Parameters

display | {Boolean}

### setZIndex

> setZIndex: function ( | zIndex | )

Set the z-index order for the pane.

#### Parameters

zIndex | {int}

### moveByPx

> moveByPx: function( | dx,
> | dy | )

Move the layer based on pixel vector. To be implemented by subclasses.

#### Parameters

dx | {Number} The x coord of the displacement vector.
dy | {Number} The y coord of the displacement vector.

### moveTo

> moveTo:function( | bounds,
> | zoomChanged,
> | dragging | )

Handle calls to move the layer.

#### Parameters

bounds | {OpenLayers.Bounds}
zoomChanged | {Boolean}
dragging | {Boolean}

### getLonLatFromViewPortPx

> getLonLatFromViewPortPx: function ( | viewPortPx | )

Get a map location from a pixel location

#### Parameters

viewPortPx | {OpenLayers.Pixel}

#### Returns

{OpenLayers.LonLat} An OpenLayers.LonLat which is the passed-in view port OpenLayers.Pixel, translated into lon/lat by map lib If the map lib is not loaded or not centered, returns null

### getViewPortPxFromLonLat

> getViewPortPxFromLonLat: function ( | lonlat | )

Get a pixel location from a map location

#### Parameters

lonlat | {OpenLayers.LonLat}

#### Returns

{OpenLayers.Pixel} An OpenLayers.Pixel which is the passed-in OpenLayers.LonLat, translated into view port pixels by map lib If map lib is not loaded or not centered, returns null

### getOLLonLatFromMapObjectLonLat

> getOLLonLatFromMapObjectLonLat: function( | moLonLat | )

Get an OL style map location from a 3rd party style map location

Parameters moLonLat - {Object}

#### Returns

{OpenLayers.LonLat} An OpenLayers.LonLat, translated from the passed in MapObject LonLat Returns null if null value is passed in

### getMapObjectLonLatFromOLLonLat

> getMapObjectLonLatFromOLLonLat: function( | olLonLat | )

Get a 3rd party map location from an OL map location.

#### Parameters

olLonLat | {OpenLayers.LonLat}

#### Returns

{Object} A MapObject LonLat, translated from the passed in OpenLayers.LonLat Returns null if null value is passed in

### getOLPixelFromMapObjectPixel

> getOLPixelFromMapObjectPixel: function( | moPixel | )

Get an OL pixel location from a 3rd party pixel location.

#### Parameters

moPixel | {Object}

#### Returns

{OpenLayers.Pixel} An OpenLayers.Pixel, translated from the passed in MapObject Pixel Returns null if null value is passed in

### getMapObjectPixelFromOLPixel

> getMapObjectPixelFromOLPixel: function( | olPixel | )

Get a 3rd party pixel location from an OL pixel location

#### Parameters

olPixel | {OpenLayers.Pixel}

#### Returns

{Object} A MapObject Pixel, translated from the passed in OpenLayers.Pixel Returns null if null value is passed in

> destroy: function()

Deconstruct this layer.

> setMap: function( | map | )

Set the map property for the layer.

> removeMap: function( | map | )

On being removed from the map, we’ll like to remove the invisible ‘pane’ div that we added to it on creation.

> loadWarningMessage:function()

If we can’t load the map lib, then display an error message to the user and tell them where to go for help.

> getWarningHTML:function()

To be implemented by subclasses.

> display: function( | display | )

Set the display on the pane

> setZIndex: function ( | zIndex | )

Set the z-index order for the pane.

> moveByPx: function( | dx,
> | dy | )

Move the layer based on pixel vector.

> moveTo:function( | bounds,
> | zoomChanged,
> | dragging | )

Handle calls to move the layer.

> getLonLatFromViewPortPx: function ( | viewPortPx | )

Get a map location from a pixel location

> getViewPortPxFromLonLat: function ( | lonlat | )

Get a pixel location from a map location

> getOLLonLatFromMapObjectLonLat: function( | moLonLat | )

Get an OL style map location from a 3rd party style map location

> getMapObjectLonLatFromOLLonLat: function( | olLonLat | )

Get a 3rd party map location from an OL map location.

> getOLPixelFromMapObjectPixel: function( | moPixel | )

Get an OL pixel location from a 3rd party pixel location.

> getMapObjectPixelFromOLPixel: function( | olPixel | )

Get a 3rd party pixel location from an OL pixel location
Create a new event pane layer
Instances of OpenLayers.Map are interactive maps embedded in a web page.
Instances of this class represent bounding boxes.
This class represents a screen coordinate, in x and y coordinates
This class represents a longitude and latitude pair
Close