OpenLayers. Layer. Markers

Inherits from

Summary
{Boolean} Markers layer is never a base layer.
Array({OpenLayers.Marker}) internal marker list
{Boolean} internal state of drawing.
Create a Markers layer.
This method removes all markers from a layer.
Calculate the pixel location for the marker, create it, and add it to the layer’s div
Calculates the max extent which includes all of the markers.

Properties

isBaseLayer

{Boolean} Markers layer is never a base layer.

markers

Array({OpenLayers.Marker}) internal marker list

drawn

{Boolean} internal state of drawing.  This is a workaround for the fact that the map does not call moveTo with a zoomChanged when the map is first starting up.  This lets us catch the case where we have never drawn the layer, and draw it even if the zoom hasn’t changed.

Constructor

OpenLayers. Layer. Markers

Create a Markers layer.

Parameters

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

Functions

destroy

destroy: function()

moveTo

moveTo:function(bounds,
zoomChanged,
dragging)

Parameters

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

addMarker

addMarker: function(marker)

Parameters

marker{OpenLayers.Marker}

removeMarker

removeMarker: function(marker)

Parameters

marker{OpenLayers.Marker}

clearMarkers

clearMarkers: function()

This method removes all markers from a layer.  The markers are not destroyed by this function, but are removed from the list of markers.

drawMarker

drawMarker: function(marker)

Calculate the pixel location for the marker, create it, and add it to the layer’s div

Parameters

marker{OpenLayers.Marker}

getDataExtent

getDataExtent: function ()

Calculates the max extent which includes all of the markers.

Returns

{OpenLayers.Bounds}

Instances of OpenLayers.Marker are a combination of a OpenLayers.LonLat and an OpenLayers.Icon.
destroy: function()
moveTo:function(bounds,
zoomChanged,
dragging)
addMarker: function(marker)
removeMarker: function(marker)
clearMarkers: function()
This method removes all markers from a layer.
drawMarker: function(marker)
Calculate the pixel location for the marker, create it, and add it to the layer’s div
getDataExtent: function ()
Calculates the max extent which includes all of the markers.
Instances of this class represent bounding boxes.