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.
OpenLayers. | 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. | 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. |
moveRoot | moves this renderer’s root to a different renderer. |
importSymbol | add a new symbol definition from the rendererer’s symbol hash |
Constants | |
OpenLayers. | {Object} |
setExtent: function( extent, resolutionChanged )
Set the renderer’s extent
extent | {OpenLayers.Bounds} |
resolutionChanged | {Boolean} |
{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: function( size )
Set the size of the drawing surface
size | {OpenLayers.Size} the size of the drawing surface |
getNodeType: function( geometry, style )
Get the node type for a geometry and style
geometry | {OpenLayers.Geometry} |
style | {Object} |
{String} The corresponding node type for the specified geometry
setStyle: function( node, style, options, geometry )
Use to set all the style attributes to a VML node.
node | {DOMElement} An VML element to decorate |
style | {Object} |
options | {Object} Currently supported options include ‘isFilled’ {Boolean} and ‘isStroked’ {Boolean} |
geometry | {OpenLayers.Geometry} |
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.
node | {DOMElement} |
xOffset | {Number} rotation center relative to image, x coordinate |
yOffset | {Number} rotation center relative to image, y coordinate |
style | {Object} |
postDraw: function( node )
node | {DOMElement} |
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.
node | {DOMElement} |
geometry | {OpenLayers.Geometry} |
drawPoint: function( node, geometry )
Render a point
node | {DOMElement} |
geometry | {OpenLayers.Geometry} |
{DOMElement} or false if the point could not be drawn
drawCircle: function( node, geometry, radius )
Render a circle. Size and Center a circle given geometry (x,y center) and radius
node | {DOMElement} |
geometry | {OpenLayers.Geometry} |
radius | {float} |
{DOMElement} or false if the circle could not ne drawn
drawLineString: function( node, geometry )
Render a linestring.
node | {DOMElement} |
geometry | {OpenLayers.Geometry} |
{DOMElement}
drawLinearRing: function( node, geometry )
Render a linearring
node | {DOMElement} |
geometry | {OpenLayers.Geometry} |
{DOMElement}
Render a line.
node | {DOMElement} |
geometry | {OpenLayers.Geometry} |
closeLine | {Boolean} Close the line? (make it a ring?) |
{DOMElement}
drawPolygon: function( node, geometry )
Render a polygon
node | {DOMElement} |
geometry | {OpenLayers.Geometry} |
{DOMElement}
drawRectangle: function( node, geometry )
Render a rectangle
node | {DOMElement} |
geometry | {OpenLayers.Geometry} |
{DOMElement}
drawText: function( featureId, style, location )
This method is only called by the renderer itself.
featureId | {String} style - |
location | {OpenLayers.Geometry.Point} |
moveRoot: function( renderer )
moves this renderer’s root to a different renderer.
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 |
{Boolean} true if successful, false otherwise
Determine whether a browser supports this renderer.
supported: function()
Set the renderer’s extent
setExtent: function( extent, resolutionChanged )
Set the size of the drawing surface
setSize: function( size )
Get the node type for a geometry and style
getNodeType: function( geometry, style )
Use to set all the style attributes to a VML node.
setStyle: function( node, style, options, geometry )
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.
graphicRotate: function( node, xOffset, yOffset, style )
postDraw: function( node )
Get the geometry’s bounds, convert it to our vml coordinate system, then set the node’s position, size, and local coordinate system.
setNodeDimension: function( node, geometry )
dashStyle: function( style )
Create a new node
createNode: function( type, id )
Determine whether a node is of a given type
nodeTypeCompare: function( node, type )
Create the renderer root
createRenderRoot: function()
Create the main root element
createRoot: function( suffix )
Render a point
drawPoint: function( node, geometry )
Render a circle.
drawCircle: function( node, geometry, radius )
Render a linestring.
drawLineString: function( node, geometry )
Render a linearring
drawLinearRing: function( node, geometry )
Render a polygon
drawPolygon: function( node, geometry )
Render a rectangle
drawRectangle: function( node, geometry )
This method is only called by the renderer itself.
drawText: function( featureId, style, location )
moves this renderer’s root to a different renderer.
moveRoot: function( renderer )
add a new symbol definition from the rendererer’s symbol hash
importSymbol: function ( graphicName )