addPersistentLayer method

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

Adds a persistent Layer to the current style. Persistent layers survive style reloads when the new style does not redefine the layer id.

Note: web has no persistent-layer concept in gl-js; the layer is added as a regular layer and will not survive a style reload.

Implementation

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