OpenLayers.Control.TransformFeature

Control to transform features with a standard transformation box.

Inherits From

Summary
OpenLayers.Control.TransformFeatureControl to transform features with a standard transformation box.
Properties
geometryTypes{Array(String)} To restrict transformation to a limited set of geometry types, send a list of strings corresponding to the geometry class names.
layer{<OpenLayers.Layer.Vector>}
preserveAspectRatio{Boolean} set to true to not change the feature’s aspect ratio.
rotate{Boolean} set to false if rotation should be disabled.
feature{OpenLayers.Feature.Vector} Feature currently available for transformation.
renderIntent{String|Object} Render intent for the transformation box and handles.
rotationHandleSymbolizer{Object|String} Optional.
box{OpenLayers.Feature.Vector} The transformation box rectangle.
center{<OpenLayers.Geometry.Point>} The center of the feature bounds.
scale{Float} The scale of the feature, relative to the scale the time the feature was set.
ratio{Float} The ratio of the feature relative to the ratio the time the feature was set.
rotation{Integer} the current rotation angle of the box.
handles{Array(OpenLayers.Feature.Vector)} The 8 handles currently available for scaling/resizing.
rotationHandles{Array(OpenLayers.Feature.Vector)} The 4 rotation handles currently available for rotating.
dragControl{OpenLayers.Control.DragFeature}
irregular{Boolean} Make scaling/resizing work irregularly.
Constructor
OpenLayers.Control.TransformFeatureCreate a new transform feature control.
Functions
activateActivates the control.
deactivateDeactivates the control.
setMap
setFeaturePlace the transformation box on a feature and start transforming it.
unsetFeatureRemove the transformation box off any feature.
createBoxCreates the box with all handles and transformation handles.
createControlCreates a DragFeature control for this control.
drawHandlesDraws the handles to match the box.
transformFeatureTransforms the feature.
destroyTake care of things that are not handled in superclass.

Properties

geometryTypes

{Array(String)} To restrict transformation to a limited set of geometry types, send a list of strings corresponding to the geometry class names.

layer

{<OpenLayers.Layer.Vector>}

preserveAspectRatio

{Boolean} set to true to not change the feature’s aspect ratio.

rotate

{Boolean} set to false if rotation should be disabled.  Default is true.  To be passed with the constructor or set when the control is not active.

feature

{OpenLayers.Feature.Vector} Feature currently available for transformation.  Read-only, use setFeature to set it manually.

renderIntent

{String|Object} Render intent for the transformation box and handles.  A symbolizer object can also be provided here.

rotationHandleSymbolizer

{Object|String} Optional.  A custom symbolizer for the rotation handles.  A render intent can also be provided here.  Defaults to

{
    stroke: false,
    pointRadius: 10,
    fillOpacity: 0,
    cursor: "pointer"
}

box

{OpenLayers.Feature.Vector} The transformation box rectangle.  Read-only.

center

{<OpenLayers.Geometry.Point>} The center of the feature bounds.  Read-only.

scale

{Float} The scale of the feature, relative to the scale the time the feature was set.  Read-only, except for beforesetfeature listeners.

ratio

{Float} The ratio of the feature relative to the ratio the time the feature was set.  Read-only, except for beforesetfeature listeners.

rotation

{Integer} the current rotation angle of the box.  Read-only, except for beforesetfeature listeners.

handles

{Array(OpenLayers.Feature.Vector)} The 8 handles currently available for scaling/resizing.  Numbered counterclockwise, starting from the southwest corner.  Read-only.

rotationHandles

{Array(OpenLayers.Feature.Vector)} The 4 rotation handles currently available for rotating.  Numbered counterclockwise, starting from the southwest corner.  Read-only.

irregular

{Boolean} Make scaling/resizing work irregularly.  If true then dragging a handle causes the feature to resize in the direction of movement.  If false then the feature resizes symetrically about it’s center.

Constructor

OpenLayers.Control.TransformFeature

Create a new transform feature control.

Parameters

layer{<OpenLayers.Layer.Vector>} Layer that contains features that will be transformed.
options{Object} Optional object whose properties will be set on the control.

Functions

activate

activate: function()

Activates the control.

deactivate

deactivate: function()

Deactivates the control.

setMap

setMap: function(map)

Parameters

map{OpenLayers.Map}

setFeature

setFeature: function(feature,
initialParams)

Place the transformation box on a feature and start transforming it.  If the control is not active, it will be activated.

Parameters

feature{OpenLayers.Feature.Vector}
initialParams{Object} Initial values for rotation, scale or ratio.  Setting a rotation value here will cause the transformation box to start rotated.  Setting a scale or ratio will not affect the transormation box, but applications may use this to keep track of scale and ratio of a feature across multiple transforms.

unsetFeature

unsetFeature: function()

Remove the transformation box off any feature.  If the control is active, it will be deactivated first.

createBox

createBox: function()

Creates the box with all handles and transformation handles.

createControl

createControl: function()

Creates a DragFeature control for this control.

drawHandles

drawHandles: function()

Draws the handles to match the box.

transformFeature

transformFeature: function(mods)

Transforms the feature.

Parameters

mods{Object} An object with optional scale, ratio, rotation and center properties.

destroy

destroy: function()

Take care of things that are not handled in superclass.

Vector features use the OpenLayers.Geometry classes as geometry description.
The DragFeature control moves a feature with a drag of the mouse.
activate: function()
Activates the control.
deactivate: function()
Deactivates the control.
setMap: function(map)
setFeature: function(feature,
initialParams)
Place the transformation box on a feature and start transforming it.
unsetFeature: function()
Remove the transformation box off any feature.
createBox: function()
Creates the box with all handles and transformation handles.
createControl: function()
Creates a DragFeature control for this control.
drawHandles: function()
Draws the handles to match the box.
transformFeature: function(mods)
Transforms the feature.
destroy: function()
Take care of things that are not handled in superclass.
Controls affect the display or behavior of the map.
Instances of OpenLayers.Map are interactive maps embedded in a web page.
Close