OpenLayers.Layer.Markers - OpenLayers

# OpenLayers. Layer. Markers

#### Inherits from

- OpenLayers.Layer

Summary

OpenLayers. Layer. Markers |
Properties |
isBaseLayer | {Boolean} Markers layer is never a base layer.
markers | {Array(OpenLayers.Marker)} internal marker list
drawn | {Boolean} internal state of drawing.
Constructor |
OpenLayers. Layer. Markers | Create a Markers layer.
Functions |
destroy |
setOpacity | Sets the opacity for all the markers.
moveTo |
addMarker |
removeMarker |
clearMarkers | This method removes all markers from a layer.
drawMarker | Calculate the pixel location for the marker, create it, and add it to the layer’s div
getDataExtent | 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()

### setOpacity

> setOpacity: function( | opacity | )

Sets the opacity for all the markers.

#### Parameter

opacity | {Float}

### 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()

> setOpacity: function( | opacity | )

Sets the opacity for all the markers.

> 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.
Close