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:
@@ -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
|
// place it. Note that this operation is O(log(n)). If there's a
|
||||||
// performance problem (when dragging, for instance) this is
|
// performance problem (when dragging, for instance) this is
|
||||||
// likely where it would be.
|
// likely where it would be.
|
||||||
var insert = this.indexer ? this.indexer.insert(node) : null;
|
if (this.indexer) {
|
||||||
|
var insert = this.indexer.insert(node);
|
||||||
if(insert) {
|
if (insert) {
|
||||||
this.root.insertBefore(node, insert);
|
this.root.insertBefore(node, insert);
|
||||||
|
} else {
|
||||||
|
this.root.appendChild(node);
|
||||||
|
}
|
||||||
} else {
|
} 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);
|
this.postDraw(node);
|
||||||
|
|||||||
Reference in New Issue
Block a user