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.

Properties

geometry

attributes

style

{Object}

url

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

modified

{Object} An object with the originals of the geometry and attributes of the feature, if they were changed. Currently this property is only read by OpenLayers.Format.WFST.v1, and written by OpenLayers.Control.ModifyFeature, which sets the geometry property. Applications can set the originals of modified attributes in the attributes property. Note that applications have to check if this object and the attributes property is already created before using it. After a change made with ModifyFeature, this object could look like

{
geometry: >Object
}

When an application has made changes to feature attributes, it could have set the attributes to something like this:

{
attributes: {
myAttribute: "original"
}
}

Note that OpenLayers.Format.WFST.v1 only checks for truthy values in modified.geometry and the attribute names in modified.attributes, but it is recommended to set the original values (and not just true) as attribute value, so applications could use this information to undo changes.

{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”. Default is “cm”.

labelXOffset

{Number} Pixel offset along the positive x axis for displacing the label. Not supported by the canvas renderer.

labelYOffset

{Number} Pixel offset along the positive y axis for displacing the label. Not supported by the canvas renderer.

labelSelect

{Boolean} If set to true, labels will be selectable using SelectFeature or similar controls. Default is false.

labelOutlineColor

{String} The color of the label outline. Default is ‘white’. Only supported by the canvas & SVG renderers.

labelOutlineWidth

{Number} The width of the label outline. Default is 3, set to 0 or null to disable. Only supported by the canvas & SVG renderers.

fontColor

{String} The font color for the label, to be provided like CSS.

fontOpacity

{Number} Opacity (0-1) for the label

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.

fontStyle

{String} The font style 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.