pub fn add_layer(&mut self, layer: Layer) -> Result<(), Error> {
        if layer.layer.get_extent() != self.extent {
            return Err(Error::WrongExtent());
        }
        if self
            .vec_tile
            .get_layers()
            .iter()
            .any(|n| n.get_name() == layer.layer.get_name())
        {
            Err(Error::DuplicateName())
        } else {
            self.vec_tile.mut_layers().push(layer.layer);
            Ok(())
        }
    }
/// Add a layer.
///
/// * `layer` The layer.
///
/// Returns an error if:
/// * a layer with the same name already exists
/// * the layer extent does not match the tile extent
Add a layer.
`layer` The layer.

Returns an error if:
a layer with the same name already exists
the layer extent does not match the tile extent
Add a layer . ` layer ` The layer . Returns an error if : a layer with the same name already exists the layer extent does not match the tile extent
pub fn add_layer(&mut self, layer: Layer) -> Result<(), Error> {
        if layer.layer.get_extent() != self.extent {
            return Err(Error::WrongExtent());
        }
        if self
            .vec_tile
            .get_layers()
            .iter()
            .any(|n| n.get_name() == layer.layer.get_name())
        {
            Err(Error::DuplicateName())
        } else {
            self.vec_tile.mut_layers().push(layer.layer);
            Ok(())
        }
    }
pub fn add_layer ( & mut self , layer : Layer ) -> Result < ( ) , Error > { if layer . layer . get_extent ( ) != self . extent { return Err ( Error :: WrongExtent ( ) ) ; } if self . vec_tile . get_layers ( ) . iter ( ) . any ( | n | n . get_name ( ) == layer . layer . get_name ( ) ) { Err ( Error :: DuplicateName ( ) ) } else { self . vec_tile . mut_layers ( ) . push ( layer . layer ) ; Ok ( ( ) ) } }
Add a layer.
Add a layer .
&mut self
layer
Layer