[OpenLayers-Users] Deleting a Vector Layer - How?

Bill Thoen bthoen at gisnet.com
Tue Aug 12 16:10:46 EDT 2008


I need to get rid of a vector layer and all of its contents, but I'm not 
sure of the syntax. When I try:

  if (myLayer != null) {
    map.removeLayer( myLayer );
    myLayer.vector.destroyFeatures();
    myLayer.vector.destroy();
}

it seems to die on  'myLayer.vector.destroyFeatures();' How should I do 
this?

- Bill Thoen

 





More information about the Users mailing list