Fixes and performance improvements to VML renderer problems with

externalGraphic, diligently filed, investigated, and fixed by The great and
powerful Oz, er, Andreas, who is becoming my new vector rendering hero. 
(Closes #1172) 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@5323 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-12-01 22:57:58 +00:00
parent a291ff04fb
commit 73fe6380c7
3 changed files with 73 additions and 57 deletions

View File

@@ -84,19 +84,20 @@ OpenLayers.Renderer.Elements = OpenLayers.Class(OpenLayers.Renderer, {
/**
* Method: getNodeType
* This function is in charge of asking the specific renderer which type
* of node to create for the given geometry. All geometries in an
* Elements-based renderer consist of one node and some attributes. We
* have the nodeFactory() function which creates a node for us, but it
* takes a 'type' as input, and that is precisely what this function
* tells us.
* of node to create for the given geometry and style. All geometries
* in an Elements-based renderer consist of one node and some
* attributes. We have the nodeFactory() function which creates a node
* for us, but it takes a 'type' as input, and that is precisely what
* this function tells us.
*
* Parameters:
* geometry - {<OpenLayers.Geometry>}
* style - {Object}
*
* Returns:
* {String} The corresponding node type for the specified geometry
*/
getNodeType: function(geometry) { },
getNodeType: function(geometry, style) { },
/**
* Method: drawGeometry
@@ -122,7 +123,7 @@ OpenLayers.Renderer.Elements = OpenLayers.Class(OpenLayers.Renderer, {
};
//first we create the basic node and add it to the root
var nodeType = this.getNodeType(geometry);
var nodeType = this.getNodeType(geometry, style);
var node = this.nodeFactory(geometry.id, nodeType);
node._featureId = featureId;
node._geometryClass = geometry.CLASS_NAME;
@@ -131,6 +132,7 @@ OpenLayers.Renderer.Elements = OpenLayers.Class(OpenLayers.Renderer, {
//now actually draw the node, and style it
node = this.drawGeometryNode(node, geometry);
this.root.appendChild(node);
this.postDraw(node);
},
/**
@@ -183,6 +185,16 @@ OpenLayers.Renderer.Elements = OpenLayers.Class(OpenLayers.Renderer, {
return this.setStyle(node, style, options, geometry);
},
/**
* Method: postDraw
* Things that have do be done after the geometry node is appended
* to its parent node. To be overridden by subclasses.
*
* Parameters:
* node - {DOMElement}
*/
postDraw: function(node) {},
/**
* Method: drawPoint
* Virtual function for drawing Point Geometry.