Features are combinations of geography and attributes. The ALKMaps.Feature class specifically combines a marker and a lonlat.
ALKMaps. | Features 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. | Constructor for features. |
Functions | |
destroy | nullify 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) |
createMarker | Based on the data associated with the Feature, create and return a marker object. |
destroyMarker | Destroys marker. |
createPopup | Creates a popup object created from the ‘lonlat’, ‘popupSize’, and ‘popupContentHTML’ properties set in this.data. |
destroyPopup | Destroys the popup created via createPopup. |
{<ALKMaps.Class>} The class which will be used to instantiate a new Popup. Default is ALKMaps.Popup.Anchored.
createMarker: function()
Based on the data associated with the Feature, create and return a marker object.
{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.
Note | this.marker is set to return value |
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.
Note | the 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 |
Note | this.popup is set to return value |
closeBox | {Boolean} create popup with closebox or not |
{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.
nullify references to prevent circular references and memory leaks
destroy: function()
{Boolean} Whether or not the feature is currently visible on screen (based on its ‘lonlat’ property)
onScreen:function()
Based on the data associated with the Feature, create and return a marker object.
createMarker: function()
Destroys marker.
destroyMarker: function()
Creates a popup object created from the ‘lonlat’, ‘popupSize’, and ‘popupContentHTML’ properties set in this.data.
createPopup: function( closeBox )
Destroys the popup created via createPopup.
destroyPopup: function()