addLayer method

Future<void> addLayer(
  1. Layer layer, [
  2. LayerPosition? position
])

Adds a Layer to the current style. Serializes the layer to JSON and forwards to StylePlatformInterface.addStyleLayer.

Implementation

Future<void> addLayer(Layer layer, [LayerPosition? position]) async {
  final encoded = await layer.encode();
  return _impl.addStyleLayer(encoded, null);
}