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.
| OpenLayers. Feature. Vector | Vector features use the OpenLayers.Geometry classes as geometry description. |
| Properties | |
| fid | {String} |
| geometry | {OpenLayers.Geometry} |
| attributes | {Object} This object holds arbitrary properties that describe the feature. |
| state | {String} |
| style | {Object} |
| renderIntent | {String} rendering intent currently being used |
| Constructor | |
| OpenLayers. Feature. Vector | Create a vector feature. |
| Functions | |
| destroy | nullify references to prevent circular references and memory leaks |
| clone | Create a clone of this vector feature. |
| onScreen | Determine whether the feature is within the map viewport. |
| createMarker | |
| destroyMarker | |
| createPopup | |
| atPoint | Determins whether the feature intersects with the specified location. |
| destroyPopup | |
| move | Moves the feature and redraws it at its new location |
| toState | Sets the new state |
| Constants | |
| OpenLayers. Feature. Vector. style | OpenLayers features can have a number of style attributes. |
Create a vector feature.
| 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. |
clone: function ()
Create a clone of this vector feature. Does not set any non-standard properties.
{OpenLayers.Feature.Vector} An exact clone of this vector feature.
onScreen:function( boundsOnly )
Determine whether the feature is within the map viewport. This method tests for an intersection between the geometry and the viewport bounds. If a more effecient but less precise geometry bounds intersection is desired, call the method with the boundsOnly parameter true.
| boundsOnly | {Boolean} Only test whether a feature’s bounds intersects the viewport bounds. Default is false. If false, the feature’s geometry must intersect the viewport for onScreen to return true. |
{Boolean} The feature is currently visible on screen (optionally based on its bounds if boundsOnly is true).
createMarker: function()
| HACK | we need to decide if all vector features should be able to create markers |
{OpenLayers.Marker} For now just returns null
createPopup: function()
| HACK | we need to decide if all vector features should be able to create popups |
{OpenLayers.Popup} For now just returns null
atPoint: function( lonlat, toleranceLon, toleranceLat )
Determins whether the feature intersects with the specified location.
| lonlat | {OpenLayers.LonLat} |
| toleranceLon | {float} Optional tolerance in Geometric Coords |
| toleranceLat | {float} Optional tolerance in Geographic Coords |
{Boolean} Whether or not the feature is at the specified location
OpenLayers features can have a number of style attributes. The ‘default’ style will typically be used if no other style is specified. These styles correspond for the most part, to the styling properties defined by the SVG standard. Information on fill properties: http://www.w3.org- /TR- /SVG- /painting.html#FillProperties Information on stroke properties: http://www.w3.org- /TR- /SVG- /painting.html#StrokeProperties
nullify references to prevent circular references and memory leaks
destroy: function()
Create a clone of this vector feature.
clone: function ()
Determine whether the feature is within the map viewport.
onScreen:function( boundsOnly )
createMarker: function()
destroyMarker: function()
createPopup: function()
Determins whether the feature intersects with the specified location.
atPoint: function( lonlat, toleranceLon, toleranceLat )
destroyPopup: function()
Moves the feature and redraws it at its new location
move: function( location )
Sets the new state
toState: function( state )