Base class for 3rd party layers, providing a DOM element which isolates the 3rd-party layer from mouse events. Only used by Google layers.
Automatically instantiated by the Google constructor, and not usually instantiated directly.
Create a new event pane layer with the OpenLayers.Layer.EventPane constructor.
OpenLayers. | Base class for 3rd party layers, providing a DOM element which isolates the 3rd-party layer from mouse events. |
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. | 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 |
{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.
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.
map | {OpenLayers.Map} |
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.
map | {OpenLayers.Map} |
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.
moveTo:function( bounds, zoomChanged, dragging )
Handle calls to move the layer.
bounds | {OpenLayers.Bounds} |
zoomChanged | {Boolean} |
dragging | {Boolean} |
getLonLatFromViewPortPx: function ( viewPortPx )
Get a map location from a pixel location
viewPortPx | {OpenLayers.Pixel} |
{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: function ( lonlat )
Get a pixel location from a map location
lonlat | {OpenLayers.LonLat} |
{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: function( moLonLat )
Get an OL style map location from a 3rd party style map location
Parameters moLonLat - {Object}
{OpenLayers.LonLat} An OpenLayers.LonLat, translated from the passed in MapObject LonLat Returns null if null value is passed in
getMapObjectLonLatFromOLLonLat: function( olLonLat )
Get a 3rd party map location from an OL map location.
olLonLat | {OpenLayers.LonLat} |
{Object} A MapObject LonLat, translated from the passed in OpenLayers.LonLat Returns null if null value is passed in
getOLPixelFromMapObjectPixel: function( moPixel )
Get an OL pixel location from a 3rd party pixel location.
moPixel | {Object} |
{OpenLayers.Pixel} An OpenLayers.Pixel, translated from the passed in MapObject Pixel Returns null if null value is passed in
getMapObjectPixelFromOLPixel: function( olPixel )
Get a 3rd party pixel location from an OL pixel location
olPixel | {OpenLayers.Pixel} |
{Object} A MapObject Pixel, translated from the passed in OpenLayers.Pixel Returns null if null value is passed in
Deconstruct this layer.
destroy: function()
Set the map property for the layer.
setMap: function( map )
On being removed from the map, we’ll like to remove the invisible ‘pane’ div that we added to it on creation.
removeMap: function( map )
If we can’t load the map lib, then display an error message to the user and tell them where to go for help.
loadWarningMessage:function()
To be implemented by subclasses.
getWarningHTML:function()
Set the display on the pane
display: function( display )
Set the z-index order for the pane.
setZIndex: function ( zIndex )
Move the layer based on pixel vector.
moveByPx: function( dx, dy )
Handle calls to move the layer.
moveTo:function( bounds, zoomChanged, dragging )
Get a map location from a pixel location
getLonLatFromViewPortPx: function ( viewPortPx )
Get a pixel location from a map location
getViewPortPxFromLonLat: function ( lonlat )
Get an OL style map location from a 3rd party style map location
getOLLonLatFromMapObjectLonLat: function( moLonLat )
Get a 3rd party map location from an OL map location.
getMapObjectLonLatFromOLLonLat: function( olLonLat )
Get an OL pixel location from a 3rd party pixel location.
getOLPixelFromMapObjectPixel: function( moPixel )
Get a 3rd party pixel location from an OL pixel location
getMapObjectPixelFromOLPixel: function( olPixel )