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
OpenLayers.Feature.VectorVector features use the OpenLayers.Geometry classes as geometry description.
Properties
geometry{OpenLayers.Geometry}
attributes{Object} This object holds arbitrary properties that describe the feature.
style{Object}
Constructor
OpenLayers.Feature.VectorCreate a vector feature.
Constants
OpenLayers.Feature.Vector.styleOpenLayers features can have a number of style attributes.

Properties

attributes

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

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.

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

Symbolizer properties

fill{Boolean} Set to false if no fill is desired.
fillColor{String} Hex fill color.  Default is “#ee9900”.
fillOpacity{Number} Fill opacity (0-1).  Default is 0.4
stroke{Boolean} Set to false if no stroke is desired.
strokeColor{String} Hex stroke color.  Default is “#ee9900”.
strokeOpacity{Number} Stroke opacity (0-1).  Default is 1.
strokeWidth{Number} Pixel stroke width.  Default is 1.
strokeLinecap{String} Stroke cap type.  Default is “round”.  [butt | round | square]
strokeDashstyle{String} Stroke dash style.  Default is “solid”.  [dot | dash | dashdot | longdash | longdashdot | solid]
graphic{Boolean} Set to false if no graphic is desired.
pointRadius{Number} Pixel point radius.  Default is 6.
pointerEvents{String} Default is “visiblePainted”.
cursor{String} Default is “”.
externalGraphic{String} Url to an external graphic that will be used for rendering points.
graphicWidth{Number} Pixel width for sizing an external graphic.
graphicHeight{Number} Pixel height for sizing an external graphic.
graphicOpacity{Number} Opacity (0-1) for an external graphic.
graphicXOffset{Number} Pixel offset along the positive x axis for displacing an external graphic.
graphicYOffset{Number} Pixel offset along the positive y axis for displacing an external graphic.
graphicZIndex{Number} The integer z-index value to use in rendering.
graphicName{String} Named graphic to use when rendering points.  Supported values include “circle” (default), “square”, “star”, “x”, “cross”, “triangle”.
graphicTitle{String} Tooltip for an external graphic.  Only supported in Firefox and Internet Explorer.
backgroundGraphic{String} Url to a graphic to be used as the background under an externalGraphic.
backgroundGraphicZIndex{Number} The integer z-index value to use in rendering the background graphic.
backgroundXOffset{Number} The x offset (in pixels) for the background graphic.
backgroundYOffset{Number} The y offset (in pixels) for the background graphic.
backgroundHeight{Number} The height of the background graphic.  If not provided, the graphicHeight will be used.
backgroundWidth{Number} The width of the background width.  If not provided, the graphicWidth will be used.
label{String} The text for an optional label.  For browsers that use the canvas renderer, this requires either fillText or mozDrawText to be available.
labelAlign{String} Label alignment.  This specifies the insertion point relative to the text.  It is a string composed of two characters.  The first character is for the horizontal alignment, the second for the vertical alignment.  Valid values for horizontal alignment: “l”=left, “c”=center, “r”=right.  Valid values for vertical alignment: “t”=top, “m”=middle, “b”=bottom.  Example values: “lt”, “cm”, “rb”.  The canvas renderer does not support vertical alignment, it will always use “b”.
fontColor{String} The font color for the label, to be provided like CSS.
fontFamily{String} The font family for the label, to be provided like in CSS.
fontSize{String} The font size for the label, to be provided like in CSS.
fontWeight{String} The font weight for the label, to be provided like in CSS.
display{String} Symbolizers will have no effect if display is set to “none”.  All other values have no effect.
A Geometry is a description of a geographic object.
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.
Close