Add style property "display" to vector feature style. If display is "none" the feature won't be rendered and there's a DOM node for that feature it'll be removed. Commiting this on behalf of ahocevar. Thanks Andreas for the patch. r=crschmidt. (closes #1173).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@5541 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -122,17 +122,24 @@ OpenLayers.Renderer.Elements = OpenLayers.Class(OpenLayers.Renderer, {
|
||||
return;
|
||||
};
|
||||
|
||||
//first we create the basic node and add it to the root
|
||||
var nodeType = this.getNodeType(geometry, style);
|
||||
var node = this.nodeFactory(geometry.id, nodeType);
|
||||
node._featureId = featureId;
|
||||
node._geometryClass = geometry.CLASS_NAME;
|
||||
node._style = style;
|
||||
|
||||
//now actually draw the node, and style it
|
||||
node = this.drawGeometryNode(node, geometry);
|
||||
this.root.appendChild(node);
|
||||
this.postDraw(node);
|
||||
if (style.display != "none") {
|
||||
//first we create the basic node and add it to the root
|
||||
var nodeType = this.getNodeType(geometry, style);
|
||||
var node = this.nodeFactory(geometry.id, nodeType);
|
||||
node._featureId = featureId;
|
||||
node._geometryClass = geometry.CLASS_NAME;
|
||||
node._style = style;
|
||||
|
||||
//now actually draw the node, and style it
|
||||
node = this.drawGeometryNode(node, geometry);
|
||||
this.root.appendChild(node);
|
||||
this.postDraw(node);
|
||||
} else {
|
||||
node = OpenLayers.Util.getElement(geometry.id);
|
||||
if (node) {
|
||||
node.parentNode.removeChild(node);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user