Hierarchy (View Summary)

Constructors

  • Constructor: OpenLayers.Feature Constructor for features.

    Parameters: layer - {<OpenLayers.Layer>} lonlat - {<OpenLayers.LonLat>} data - {Object}

    Returns: {<OpenLayers.Feature>}

    Parameters

    Returns Feature

Properties

data: null | Record<string, any>

Property: data {Object}

id: string

Property: id {String}

layer: null | Layer

Property: layer {<OpenLayers.Layer>}

lonlat: null | LonLat

Property: lonlat {<OpenLayers.LonLat>}

marker: null | Marker

Property: marker {<OpenLayers.Marker>}

popup: null | Popup

Property: popup {<OpenLayers.Popup>}

Methods

  • Method: createMarker 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.

         Note - this.marker is set to return value
    

    Returns Marker

  • Method: createPopup 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

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

    Parameters

    • closeBox: boolean

    Returns Popup

  • Method: destroy nullify references to prevent circular references and memory leaks

    Returns void

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

    Returns void

  • Method: destroyPopup 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

    Returns void

  • Method: onScreen

    Returns: {Boolean} Whether or not the feature is currently visible on screen (based on its 'lonlat' property)

    Returns boolean