Type Parameters

Hierarchy (View Summary)

Constructors

  • Constructor: OpenLayers.Feature.Vector Create a vector feature.

    Parameters: geometry - {<OpenLayers.Geometry>} The geometry that this feature represents. attributes - {Object} An optional object that will be mapped to the property. style - {Object} An optional style object.

    Type Parameters

    Parameters

    Returns Vector<T>

Properties

attributes: null | Record<string, any>

APIProperty: attributes {Object} This object holds arbitrary, serializable properties that describe the feature.

bounds: null | Bounds

Property: bounds {<OpenLayers.Bounds>} The box bounding that feature's geometry, that property can be set by an <OpenLayers.Format> object when deserializing the feature, so in most cases it represents an information set by the server.

cluster?: Vector<Geometry>[]
data: null | Record<string, any>

Property: data {Object}

fid: string

Property: fid {String}

geometry: T

APIProperty: geometry {<OpenLayers.Geometry>}

id: string

Property: id {String}

layer: null | Layer.Vector

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

renderIntent: string

Property: renderIntent {String} rendering intent currently being used

state: null | State

Property: state {String}

style: null | SymbolizerProperties

APIProperty: style {Object}

url: null | string

APIProperty: url {String} If this property is set it will be taken into account by {<OpenLayers.HTTP>} when upadting or deleting the feature.

Methods

  • Method: atPoint Determins whether the feature intersects with the specified location.

    Parameters: lonlat - {<OpenLayers.LonLat>|Object} OpenLayers.LonLat or an object with a 'lon' and 'lat' properties. toleranceLon - {float} Optional tolerance in Geometric Coords toleranceLat - {float} Optional tolerance in Geographic Coords

    Returns: {Boolean} Whether or not the feature is at the specified location

    Parameters

    • lonlat: LonLat | { lat: number; lon: number }
    • toleranceLon: number
    • toleranceLat: number

    Returns boolean

  • Method: clone Create a clone of this vector feature. Does not set any non-standard properties.

    Returns: {<OpenLayers.Feature.Vector>} An exact clone of this vector feature.

    Returns Vector

  • 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: getVisibility Determine whether the feature is displayed or not. It may not displayed because: - its style display property is set to 'none', - it doesn't belong to any layer, - the styleMap creates a symbolizer with display property set to 'none' for it, - the layer which it belongs to is not visible.

    Returns: {Boolean} The feature is currently displayed.

    Returns boolean

  • Method: move Moves the feature and redraws it at its new location

    Parameters: location - {<OpenLayers.LonLat> or <OpenLayers.Pixel>} the location to which to move the feature.

    Parameters

    Returns void

  • Method: onScreen

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

    Returns boolean