ALKMaps.Feature

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

Summary
ALKMaps.FeatureFeatures are combinations of geography and attributes.
Properties
layer{ALKMaps.Layer}
id{String}
lonlat{ALKMaps.LonLat}
data{Object}
marker{ALKMaps.Marker}
popupClass{<ALKMaps.Class>} The class which will be used to instantiate a new Popup.
popup{ALKMaps.Popup}
Constructor
ALKMaps.FeatureConstructor for features.
Functions
destroynullify references to prevent circular references and memory leaks
onScreen{Boolean} Whether or not the feature is currently visible on screen (based on its ‘lonlat’ property)
createMarkerBased on the data associated with the Feature, create and return a marker object.
destroyMarkerDestroys marker.
createPopupCreates a popup object created from the ‘lonlat’, ‘popupSize’, and ‘popupContentHTML’ properties set in this.data.
destroyPopupDestroys the popup created via createPopup.

Properties

id

{String}

data

{Object}

popupClass

{<ALKMaps.Class>} The class which will be used to instantiate a new Popup.  Default is ALKMaps.Popup.Anchored.

Constructor

ALKMaps.Feature

Constructor for features.

Parameters

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

Returns

{ALKMaps.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

{ALKMaps.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, ALKMaps.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.

Notethe returned popup object is ‘owned’ by the feature, so you cannot use the popup’s destroy method to discard the popup.  Instead, you must use the feature’s destroyPopup
Notethis.popup is set to return value

Parameters

closeBox{Boolean} create popup with closebox or not

Returns

{ALKMaps.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 ALKMaps.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
Deprecated.
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.
Close