public void removeLayer(Layer layer){
  if (layer != null && layer.isRemovable()) {
    List<Layer> currentLayers=getLayerList();
    currentLayers.remove(layer);
    setLayerList(currentLayers);
  }
 else {
    if (layer != null) {
      logger.warning("received command to remove " + layer.getName() + ", which has been designated as *NOT* removeable");
      throw new com.bbn.openmap.util.HandleError("LayerHandler commanded to delete a layer (" + layer.getName() + ") that is not removeable");
    }
  }
}

public void removeLayer ( Layer layer ) { if ( layer != null && layer . isRemovable ( ) ) { List < Layer > currentLayers = getLayerList ( ) ; currentLayers . remove ( layer ) ; setLayerList ( currentLayers ) ; } else { if ( layer != null ) { logger . warning ( "received command to remove " + layer . getName ( ) + ", which has been designated as *NOT* removeable" ) ; throw new com . bbn . openmap . util . HandleError ( "LayerHandler commanded to delete a layer (" + layer . getName ( ) + ") that is not removeable" ) ; } } }
remove a layer from the list of potentials .
