Now the layer is removed from the map when removed from the porject.