Changeset 7944
- Timestamp:
- 09/04/08 04:31:05 (3 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Renderer/Elements.js
r7930 r7944 507 507 redrawNode: function(id, geometry, style, featureId) { 508 508 // Get the node if it's already on the map. 509 var currentNode = OpenLayers.Util.getElement(id); 510 511 // Create a new node, or use the current one if it's 512 // already there. 513 var newNode; 514 if (!currentNode) { 515 var nodeType = this.getNodeType(geometry, style); 516 newNode = this.createNode(nodeType, id); 517 } else { 518 newNode = currentNode; 519 } 509 var node = this.nodeFactory(id, this.getNodeType(geometry, style)); 520 510 521 511 // Set the data for the node, then draw it. 522 n ewNode._featureId = featureId;523 n ewNode._geometry = geometry;524 n ewNode._geometryClass = geometry.CLASS_NAME;525 n ewNode._style = style;526 527 var drawResult = this.drawGeometryNode(n ewNode, geometry, style);512 node._featureId = featureId; 513 node._geometry = geometry; 514 node._geometryClass = geometry.CLASS_NAME; 515 node._style = style; 516 517 var drawResult = this.drawGeometryNode(node, geometry, style); 528 518 if(drawResult === false) { 529 519 return false; 530 520 } 531 521 532 n ewNode = drawResult.node;522 node = drawResult.node; 533 523 534 524 // Insert the node into the indexer so it can show us where to … … 536 526 // performance problem (when dragging, for instance) this is 537 527 // likely where it would be. 538 var insert = this.indexer ? this.indexer.insert(n ewNode) : null;528 var insert = this.indexer ? this.indexer.insert(node) : null; 539 529 540 530 if(insert) { 541 this.root.insertBefore(n ewNode, insert);531 this.root.insertBefore(node, insert); 542 532 } else { 543 this.root.appendChild(n ewNode);544 } 545 546 this.postDraw(n ewNode);533 this.root.appendChild(node); 534 } 535 536 this.postDraw(node); 547 537 548 538 return drawResult.complete;
