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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user