# OpenLayers.Renderer.VML

Render vector features in browsers with VML capability. Construct a new VML renderer with the OpenLayers.Renderer.VML constructor.

Note that for all calculations in this class, we use (num | 0) to truncate a float value to an integer. This is done because it seems that VML doesn’t support float values.

#### Inherits from

- OpenLayers.Renderer.Elements

Summary

OpenLayers.Renderer.VML | Render vector features in browsers with VML capability.
Properties |
xmlns | {String} XML Namespace URN
symbolCache | {DOMElement} node holding symbols.
offset | {Object} Hash with “x” and “y” properties
Constructor |
OpenLayers.Renderer.VML | Create a new VML renderer.
Functions |
supported | Determine whether a browser supports this renderer.
setExtent | Set the renderer’s extent
setSize | Set the size of the drawing surface
getNodeType | Get the node type for a geometry and style
setStyle | Use to set all the style attributes to a VML node.
graphicRotate | If a point is to be styled with externalGraphic and rotation, VML fills cannot be used to display the graphic, because rotation of graphic fills is not supported by the VML implementation of Internet Explorer.
postDraw |
setNodeDimension | Get the geometry’s bounds, convert it to our vml coordinate system, then set the node’s position, size, and local coordinate system.
dashStyle |
createNode | Create a new node
nodeTypeCompare | Determine whether a node is of a given type
createRenderRoot | Create the renderer root
createRoot | Create the main root element
drawPoint | Render a point
drawCircle | Render a circle.
drawLineString | Render a linestring.
drawLinearRing | Render a linearring
DrawLine | Render a line.
drawPolygon | Render a polygon
drawRectangle | Render a rectangle
drawText | This method is only called by the renderer itself.
drawSurface |
moveRoot | moves this renderer’s root to a different renderer.
importSymbol | add a new symbol definition from the rendererer’s symbol hash
Constants |
OpenLayers.Renderer.VML.LABEL_SHIFT | {Object}

### Properties

### xmlns

{String} XML Namespace URN

### symbolCache

{DOMElement} node holding symbols. This hash is keyed by symbol name, and each value is a hash with a “path” and an “extent” property.

### offset

{Object} Hash with “x” and “y” properties

### Constructor

### OpenLayers.Renderer.VML

Create a new VML renderer.

#### Parameters

containerID | {String} The id for the element that contains the renderer

### Functions

### supported

> supported: function()

Determine whether a browser supports this renderer.

#### Returns

{Boolean} The browser supports the VML renderer

### setExtent

> setExtent: function( | extent,
> | resolutionChanged | )

Set the renderer’s extent

#### Parameters

extent | {OpenLayers.Bounds}
resolutionChanged | {Boolean}

#### Returns

{Boolean} true to notify the layer that the new extent does not exceed the coordinate range, and the features will not need to be redrawn.

### setSize

> setSize: function( | size | )

Set the size of the drawing surface

#### Parameters

size | {OpenLayers.Size} the size of the drawing surface

### getNodeType

> getNodeType: function( | geometry,
> | style | )

Get the node type for a geometry and style

#### Parameters

geometry | {OpenLayers.Geometry}
style | {Object}

#### Returns

{String} The corresponding node type for the specified geometry

### setStyle

> setStyle: function( | node,
> | style,
> | options,
> | geometry | )

Use to set all the style attributes to a VML node.

#### Parameters

node | {DOMElement} An VML element to decorate
style | {Object}
options | {Object} Currently supported options include ‘isFilled’ {Boolean} and ‘isStroked’ {Boolean}
geometry | {OpenLayers.Geometry}

### graphicRotate

> graphicRotate: function( | node,
> | xOffset,
> | yOffset,
> | style | )

If a point is to be styled with externalGraphic and rotation, VML fills cannot be used to display the graphic, because rotation of graphic fills is not supported by the VML implementation of Internet Explorer. This method creates a olv:imagedata element inside the VML node, DXImageTransform.Matrix and BasicImage filters for rotation and opacity, and a 3-step hack to remove rendering artefacts from the graphic and preserve the ability of graphics to trigger events. Finally, OpenLayers methods are used to determine the correct insertion point of the rotated image, because DXImageTransform.Matrix does the rotation without the ability to specify a rotation center point.

#### Parameters

node | {DOMElement}
xOffset | {Number} rotation center relative to image, x coordinate
yOffset | {Number} rotation center relative to image, y coordinate
style | {Object}

### postDraw

> postDraw: function( | node | )

#### Does some node postprocessing to work around browser issues

- Some versions of Internet Explorer seem to be unable to set fillcolor and strokecolor to “none” correctly before the fill node is appended to a visible vml node. This method takes care of that and sets fillcolor and strokecolor again if needed.
- In some cases, a node won’t become visible after being drawn. Setting style.visibility to “visible” works around that.

#### Parameters

node | {DOMElement}

### setNodeDimension

> setNodeDimension: function( | node,
> | geometry | )

Get the geometry’s bounds, convert it to our vml coordinate system, then set the node’s position, size, and local coordinate system.

#### Parameters

node | {DOMElement}
geometry | {OpenLayers.Geometry}

### dashStyle

> dashStyle: function( | style | )

#### Parameters

style | {Object}

#### Returns

{String} A VML compliant ‘stroke-dasharray’ value

### createNode

> createNode: function( | type,
> | id | )

Create a new node

#### Parameters

type | {String} Kind of node to draw
id | {String} Id for node

#### Returns

{DOMElement} A new node of the given type and id

### nodeTypeCompare

> nodeTypeCompare: function( | node,
> | type | )

Determine whether a node is of a given type

#### Parameters

node | {DOMElement} An VML element
type | {String} Kind of node

#### Returns

{Boolean} Whether or not the specified node is of the specified type

### createRenderRoot

> createRenderRoot: function()

Create the renderer root

#### Returns

{DOMElement} The specific render engine’s root element

### createRoot

> createRoot: function( | suffix | )

Create the main root element

#### Parameters

suffix | {String} suffix to append to the id

#### Returns

{DOMElement}

### drawPoint

> drawPoint: function( | node,
> | geometry | )

Render a point

#### Parameters

node | {DOMElement}
geometry | {OpenLayers.Geometry}

#### Returns

{DOMElement} or false if the point could not be drawn

### drawCircle

> drawCircle: function( | node,
> | geometry,
> | radius | )

Render a circle. Size and Center a circle given geometry (x,y center) and radius

#### Parameters

node | {DOMElement}
geometry | {OpenLayers.Geometry}
radius | {float}

#### Returns

{DOMElement} or false if the circle could not ne drawn

### drawLineString

> drawLineString: function( | node,
> | geometry | )

Render a linestring.

#### Parameters

node | {DOMElement}
geometry | {OpenLayers.Geometry}

#### Returns

{DOMElement}

### drawLinearRing

> drawLinearRing: function( | node,
> | geometry | )

Render a linearring

#### Parameters

node | {DOMElement}
geometry | {OpenLayers.Geometry}

#### Returns

{DOMElement}

### DrawLine

Render a line.

#### Parameters

node | {DOMElement}
geometry | {OpenLayers.Geometry}
closeLine | {Boolean} Close the line? (make it a ring?)

#### Returns

{DOMElement}

### drawPolygon

> drawPolygon: function( | node,
> | geometry | )

Render a polygon

#### Parameters

node | {DOMElement}
geometry | {OpenLayers.Geometry}

#### Returns

{DOMElement}

### drawRectangle

> drawRectangle: function( | node,
> | geometry | )

Render a rectangle

#### Parameters

node | {DOMElement}
geometry | {OpenLayers.Geometry}

#### Returns

{DOMElement}

### drawText

> drawText: function( | featureId,
> | style,
> | location | )

This method is only called by the renderer itself.

#### Parameters

featureId | {String} style -
location | {OpenLayers.Geometry.Point}

### drawSurface

> drawSurface: function( | node,
> | geometry | )

#### Parameters

node | {DOMElement}
geometry | {OpenLayers.Geometry}

#### Returns

{DOMElement}

### moveRoot

> moveRoot: function( | renderer | )

moves this renderer’s root to a different renderer.

#### Parameters

renderer | {OpenLayers.Renderer} target renderer for the moved root
root | {DOMElement} optional root node. To be used when this renderer holds roots from multiple layers to tell this method which one to detach

#### Returns

{Boolean} true if successful, false otherwise

### importSymbol

> importSymbol: function ( | graphicName | )

add a new symbol definition from the rendererer’s symbol hash

#### Parameters

graphicName | {String} name of the symbol to import

#### Returns

{Object} | hash of {DOMElement} “symbol” and {Number} “size”

### Constants

### OpenLayers.Renderer.VML.LABEL_SHIFT

{Object}

> supported: function()

Determine whether a browser supports this renderer.

> setExtent: function( | extent,
> | resolutionChanged | )

Set the renderer’s extent

> setSize: function( | size | )

Set the size of the drawing surface

> getNodeType: function( | geometry,
> | style | )

Get the node type for a geometry and style

> setStyle: function( | node,
> | style,
> | options,
> | geometry | )

Use to set all the style attributes to a VML node.

> graphicRotate: function( | node,
> | xOffset,
> | yOffset,
> | style | )

If a point is to be styled with externalGraphic and rotation, VML fills cannot be used to display the graphic, because rotation of graphic fills is not supported by the VML implementation of Internet Explorer.

> postDraw: function( | node | )

> setNodeDimension: function( | node,
> | geometry | )

Get the geometry’s bounds, convert it to our vml coordinate system, then set the node’s position, size, and local coordinate system.

> dashStyle: function( | style | )

> createNode: function( | type,
> | id | )

Create a new node

> nodeTypeCompare: function( | node,
> | type | )

Determine whether a node is of a given type

> createRenderRoot: function()

Create the renderer root

> createRoot: function( | suffix | )

Create the main root element

> drawPoint: function( | node,
> | geometry | )

Render a point

> drawCircle: function( | node,
> | geometry,
> | radius | )

Render a circle.

> drawLineString: function( | node,
> | geometry | )

Render a linestring.

> drawLinearRing: function( | node,
> | geometry | )

Render a linearring

> drawPolygon: function( | node,
> | geometry | )

Render a polygon

> drawRectangle: function( | node,
> | geometry | )

Render a rectangle

> drawText: function( | featureId,
> | style,
> | location | )

This method is only called by the renderer itself.

> drawSurface: function( | node,
> | geometry | )

> moveRoot: function( | renderer | )

moves this renderer’s root to a different renderer.

> importSymbol: function ( | graphicName | )

add a new symbol definition from the rendererer’s symbol hash
Create a new VML renderer.
This is another virtual class in that it should never be instantiated by itself as a Renderer.
Instances of this class represent bounding boxes.
Instances of this class represent a width/height pair
A Geometry is a description of a geographic object.
Point geometry class.
This is the base class for all renderers.
Close