addLayer method

Future<void> addLayer(
  1. String sourceId,
  2. String layerId,
  3. LayerProperties properties, {
  4. String? belowLayerId,
  5. bool enableInteraction = true,
  6. String? sourceLayer,
})

Implementation

Future<void> addLayer(
    String sourceId, String layerId, LayerProperties properties,
    {String? belowLayerId,
    bool enableInteraction = true,
    String? sourceLayer}) async {
  if (properties is FillLayerProperties) {
    addFillLayer(sourceId, layerId, properties,
        belowLayerId: belowLayerId, sourceLayer: sourceLayer);
  } else if (properties is LineLayerProperties) {
    addLineLayer(sourceId, layerId, properties,
        belowLayerId: belowLayerId, sourceLayer: sourceLayer);
  } else if (properties is SymbolLayerProperties) {
    addSymbolLayer(sourceId, layerId, properties,
        belowLayerId: belowLayerId, sourceLayer: sourceLayer);
  } else if (properties is CircleLayerProperties) {
    addCircleLayer(sourceId, layerId, properties,
        belowLayerId: belowLayerId, sourceLayer: sourceLayer);
  } else if (properties is RasterLayerProperties) {
    addRasterLayer(sourceId, layerId, properties,
        belowLayerId: belowLayerId, sourceLayer: sourceLayer);
  } else if (properties is HillshadeLayerProperties) {
    addHillshadeLayer(sourceId, layerId, properties,
        belowLayerId: belowLayerId, sourceLayer: sourceLayer);
  } else {
    throw UnimplementedError("Unknown layer type $properties");
  }
}