don't re-append the geometry node if it is already there, a regression is fixed with this patch, r=ahocevar (Closes

#1066)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@8766 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
pgiraud
2009-01-26 14:54:16 +00:00
parent e6b48e3dd8
commit be82c1ef6e

View File

@@ -525,12 +525,19 @@ OpenLayers.Renderer.Elements = OpenLayers.Class(OpenLayers.Renderer, {
// place it. Note that this operation is O(log(n)). If there's a
// performance problem (when dragging, for instance) this is
// likely where it would be.
var insert = this.indexer ? this.indexer.insert(node) : null;
if(insert) {
this.root.insertBefore(node, insert);
if (this.indexer) {
var insert = this.indexer.insert(node);
if (insert) {
this.root.insertBefore(node, insert);
} else {
this.root.appendChild(node);
}
} else {
this.root.appendChild(node);
// if there's no indexer, simply append the node to root,
// but only if the node is a new one
if (node.parentNode !== this.root){
this.root.appendChild(node);
}
}
this.postDraw(node);