ALKMaps.Layer.Markers

Inherits from

Summary
ALKMaps.Layer.Markers
Properties
events{ALKMaps.Events}
isBaseLayer{Boolean} Markers layer is never a base layer.
markers{Array(ALKMaps.Marker2)} internal marker list
drawn{Boolean} internal state of drawing.
strategies{Array(ALKMaps.Strategy)} Optional list of strategies for the layer.
Constructor
ALKMaps.Layer.MarkersCreate a Markers layer.
Functions
destroy
afterAddCalled at the end of the map.addLayer sequence.
setOpacitySets the opacity for all the markers.
moveTo
addMarker
addMarkers
removeMarker
clearMarkersThis method removes all markers from a layer.
drawMarkerCalculate the pixel location for the marker, create it, and add it to the layer’s div
getDataExtentCalculates the max extent which includes all of the markers.
getViewPortDataExtentCalculates the max extent which includes all of the markers on the viewport.
addMarkerToMapLayerContainerDivAdd marker.
removeMarkerFromMapLayerContainerDivRemove marker.
setVisibilityHide or show markers when the layer visibility is changed.
isClusterStrategyActiveReturn true if there is an active maker2 clustering strategy on the layer.

Properties

events

{ALKMaps.Events}

Register a listener for a particular event with the following syntax

layer.events.register(type, obj, listener);

Listeners will be called with a reference to an event object.  The properties of this event depends on exactly what happened.

All event objects have at least the following properties

object{Object} A reference to layer.events.object.
element{DOMElement} A reference to layer.events.element.
beforemarkeraddedTriggered before a marker is added.  Listeners will receive an object with a marker property referencing the marker to be added.  To stop the marker from being added, a listener should return false.
beforemarkersaddedTriggered before an array of markers is added.  Listeners will receive an object with a markers property referencing the marker to be added.
aftermarkeraddedTriggered after a marker is added.  Listeners will receive an object with a marker property referencing the marker to be added.  To stop the marker from being added, a listener should return false.
aftermarkersaddedTriggered after an array of markers is added.  Listeners will receive an object with a markers property referencing the marker to be added.
beforemarkerremovedTriggered before a marker is removed.

isBaseLayer

{Boolean} Markers layer is never a base layer.

markers

{Array(ALKMaps.Marker2)} 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.

strategies

{Array(ALKMaps.Strategy)} Optional list of strategies for the layer.  Only works with ALKMaps.Marker2.

Constructor

ALKMaps.Layer.Markers

Create a Markers layer.

Parameters

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

Functions

destroy

destroy: function()

afterAdd

afterAdd: function()

Called at the end of the map.addLayer sequence.  At this point, the map will have a base layer.  Any autoActivate strategies will be activated here.

setOpacity

setOpacity: function(opacity)

Sets the opacity for all the markers.

Parameters

opacity{Float}

moveTo

moveTo:function(bounds,
zoomChanged,
dragging)

Parameters

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

addMarker

addMarker: function(marker,
options)

Parameters

marker{ALKMaps.Marker}

addMarkers

addMarkers: function(markers,
options)

Parameters

markers{Array(ALKMaps.Marker)}

removeMarker

removeMarker: function(marker,
options)

Parameters

marker{ALKMaps.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{ALKMaps.Marker}

getDataExtent

getDataExtent: function ()

Calculates the max extent which includes all of the markers.

Returns

{ALKMaps.Bounds}

getViewPortDataExtent

getViewPortDataExtent: function ()

Calculates the max extent which includes all of the markers on the viewport.

Returns

{ALKMaps.Bounds}

addMarkerToMapLayerContainerDiv

addMarkerToMapLayerContainerDiv: function(marker)

Add marker.  Only works with ALKMaps.Marker2.

removeMarkerFromMapLayerContainerDiv

removeMarkerFromMapLayerContainerDiv: function(marker)

Remove marker.  Only works with ALKMaps.Marker2.

setVisibility

setVisibility: function(visibility)

Hide or show markers when the layer visibility is changed.  Only works with ALKMaps.Marker2.

isClusterStrategyActive

isClusterStrategyActive: function()

Return true if there is an active maker2 clustering strategy on the layer.

Instances of ALKMaps.Marker2 are a combination of a div and other elements.
Abstract vector layer strategy class.
destroy: function()
afterAdd: function()
Called at the end of the map.addLayer sequence.
setOpacity: function(opacity)
Sets the opacity for all the markers.
moveTo:function(bounds,
zoomChanged,
dragging)
addMarker: function(marker,
options)
addMarkers: function(markers,
options)
removeMarker: function(marker,
options)
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.
getViewPortDataExtent: function ()
Calculates the max extent which includes all of the markers on the viewport.
addMarkerToMapLayerContainerDiv: function(marker)
Add marker.
removeMarkerFromMapLayerContainerDiv: function(marker)
Remove marker.
setVisibility: function(visibility)
Hide or show markers when the layer visibility is changed.
isClusterStrategyActive: function()
Return true if there is an active maker2 clustering strategy on the layer.
Instances of this class represent bounding boxes.
Deprecated.
Close