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}
{OpenLayers.Class} The class which will be used to instantiate a new Popup.
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}

popupClass

{OpenLayers.Class} The class which will be used to instantiate a new Popup.  Default is OpenLayers.Popup.AnchoredBubble.

Constructor

OpenLayers. Feature

Constructor for features.

Parameters

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

Returns

{OpenLayers.Feature}

Functions

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.

Returns

{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} Returns the created popup, which is also set as ‘popup’ property of this feature.  Will be of whatever type specified by this feature’s ‘popupClass’ property, but must be of type OpenLayers.Popup.

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.
Base class used to construct all other classes.
A popup is a small div that can opened and closed on the map.
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.