0

我确实使用样式属性更改了一些功能样式(通过复选框):

var features = layer.features;

for( var i = 0; i < features.length; i++ ) {
  //features[i].style = { visibility: 'hidden' };
    features[i].style = 'none'; 
}

layer.redraw();

现在,如果我再次选中该框,它应该会再次显示,但没有任何反应!我试过了:

     features[i].style = 'block'; 
OR
     features[i].style = 'delete'; 

然后重绘图层..但这不起作用

任何想法 ?

4

1 回答 1

2

尝试这个:

// set style
    features[i].style = null;
// or
    features[i].style = {display:'none'};

// redraw feature
layer.drawFeature(features[i]);
于 2012-10-01T08:37:32.483 回答