OpenLayers. Feature. Vector

Vector features use the OpenLayers.Geometry classes as geometry description.  They have an ‘attributes’ property, which is the data object, and a ‘style’ property, the default values of which are defined in the OpenLayers.Feature.Vector.style objects.

Inherits from

Summary
Vector features use the OpenLayers.Geometry classes as geometry description.
{String}
{Object} This object holds arbitrary properties that describe the feature.
{String}
{Object}
Create a vector feature.
nullify references to prevent circular references and memory leaks
Create a clone of this vector feature.
Determins whether the feature intersects with the specified location.
Sets the new state
OpenLayers features can have a number of style attributes.

Properties

fid

{String}

attributes

{Object} This object holds arbitrary properties that describe the feature.

state

{String}

style

{Object}

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 attributes property.
style{Object} An optional style object.

Functions

destroy

destroy: function()

nullify references to prevent circular references and memory leaks

clone

clone: function ()

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.

onScreen

onScreen:function()
HACKwe need to rewrite this for non-point geometry

Returns

{Boolean} For now just returns null

createMarker

createMarker: function()
HACKwe need to decide if all vector features should be able to create markers

Returns

{OpenLayers.Marker} For now just returns null

destroyMarker

destroyMarker: function()
HACKwe need to decide if all vector features should be able to delete markers

If user overrides the createMarker() function, s/he should be able to also specify an alternative function for destroying it

createPopup

createPopup: function()
HACKwe need to decide if all vector features should be able to create popups

Returns

{OpenLayers.Popup} For now just returns null

atPoint

atPoint: function(lonlat,
toleranceLon,
toleranceLat)

Determins whether the feature intersects with the specified location.

Parameters

lonlat{OpenLayers.LonLat}
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

destroyPopup

destroyPopup: function()
HACKwe need to decide if all vector features should be able to delete popups

toState

toState: function(state)

Sets the new state

Parameters

state{String}

Constants

OpenLayers. Feature. Vector. style

OpenLayers features can have a number of style attributes.  The ‘default’ style will typically be used if no other style is specified.

Default style properties

  • fillColor: “#ee9900”,
  • fillOpacity: 0.4,
  • hoverFillColor: “white”,
  • hoverFillOpacity: 0.8,
  • strokeColor: “#ee9900”,
  • strokeOpacity: 1,
  • strokeWidth: 1,
  • strokeLinecap: “round”,
  • hoverStrokeColor: “red”,
  • hoverStrokeOpacity: 1,
  • hoverStrokeWidth: 0.2,
  • pointRadius: 6,
  • hoverPointRadius: 1,
  • hoverPointUnit: “%”,
  • pointerEvents: “visiblePainted”

Other style properties that have no default values

  • externalGraphic,
  • graphicWidth,
  • graphicHeight,
  • graphicOpacity
  • graphicXOffset
  • graphicYOffset
A Geometry is a description of a geographic object.
destroy: function()
nullify references to prevent circular references and memory leaks
clone: function ()
Create a clone of this vector feature.
onScreen:function()
createMarker: function()
destroyMarker: function()
createPopup: function()
atPoint: function(lonlat,
toleranceLon,
toleranceLat)
Determins whether the feature intersects with the specified location.
destroyPopup: function()
toState: function(state)
Sets the new state
OpenLayers features can have a number of style attributes.
Features are combinations of geography and attributes.
{Object} This object holds arbitrary properties that describe the feature.
Create a vector feature.
Instances of OpenLayers.Marker are a combination of a OpenLayers.LonLat and an OpenLayers.Icon.
A popup is a small div that can opened and closed on the map.
This class represents a longitude and latitude pair