OpenLayers. Feature

Features are combinations of geography and attributes.  The OpenLayers.Feature class specifically combines a marker and a lonlat.

Summary
Features are combinations of geography and attributes.
{String}
{Object}
Constructor for features.
nullify references to prevent circular references and memory leaks
{Boolean} Whether or not the feature is currently visible on screen (based on its ‘lonlat’ property)
Based on the data associated with the Feature, create and return a marker object.
Destroys marker.
Creates a popup object created from the ‘lonlat’, ‘popupSize’, and ‘popupContentHTML’ properties set in this.data.
Destroys the popup created via createPopup.

Properties

id

{String}

data

{Object}

Functions

OpenLayers. Feature

Constructor for features.

Parameters

layer{OpenLayers.Layer}
lonlat{OpenLayers.LonLat}
data{Object}

Return

{OpenLayers.Feature}

destroy

destroy: function()

nullify references to prevent circular references and memory leaks

onScreen

onScreen:function()

Returns

{Boolean} Whether or not the feature is currently visible on screen (based on its ‘lonlat’ property)

createMarker

createMarker: function()

Based on the data associated with the Feature, create and return a marker object.

Return

{OpenLayers.Marker} A Marker Object created from the ‘lonlat’ and ‘icon’ properties set in this.data.  If no ‘lonlat’ is set, returns null.  If no ‘icon’ is set, OpenLayers.Marker() will load the default image.

Notethis.marker is set to return value

destroyMarker

destroyMarker: function()

Destroys marker.  If user overrides the createMarker() function, s/he should be able to also specify an alternative function for destroying it

createPopup

createPopup: function(closeBox)

Creates a popup object created from the ‘lonlat’, ‘popupSize’, and ‘popupContentHTML’ properties set in this.data.  It uses this.marker.icon as default anchor.

If no ‘lonlat’ is set, returns null.  If no this.marker has been created, no anchor is sent.

Notethis.popup is set to return value

Parameters

closeBox{Boolean} create popup with closebox or not

Returns

{<OpenLayers.Popup.AnchoredBubble>}

destroyPopup

destroyPopup: function()

Destroys the popup created via createPopup.

As with the marker, if user overrides the createPopup() function, s/he should also be able to override the destruction

This class represents a longitude and latitude pair
Instances of OpenLayers.Marker are a combination of a OpenLayers.LonLat and an OpenLayers.Icon.
destroy: function()
nullify references to prevent circular references and memory leaks
onScreen:function()
{Boolean} Whether or not the feature is currently visible on screen (based on its ‘lonlat’ property)
createMarker: function()
Based on the data associated with the Feature, create and return a marker object.
destroyMarker: function()
Destroys marker.
createPopup: function(closeBox)
Creates a popup object created from the ‘lonlat’, ‘popupSize’, and ‘popupContentHTML’ properties set in this.data.
destroyPopup: function()
Destroys the popup created via createPopup.
Constructor for features.