addSymbolLayer method

Future<void> addSymbolLayer(
  1. String sourceId,
  2. String layerId,
  3. SymbolLayerProperties properties, {
  4. String? belowLayerId,
  5. String? sourceLayer,
  6. double? minzoom,
  7. double? maxzoom,
  8. dynamic filter,
  9. bool enableInteraction = true,
})

Add a symbol layer to the map with the given properties

Consider using addLayer for an unified layer api.

The returned Future completes after the change has been made on the platform side.

Setting belowLayerId adds the new layer below the given id. If enableInteraction is set the layer is considered for touch or drag events. sourceLayer is used to selected a specific source layer from Vector source. minzoom is the minimum (inclusive) zoom level at which the layer is visible. maxzoom is the maximum (exclusive) zoom level at which the layer is visible. filter determines which features should be rendered in the layer. Filters are written as expressions.

Implementation

Future<void> addSymbolLayer(
    String sourceId, String layerId, SymbolLayerProperties properties,
    {String? belowLayerId,
    String? sourceLayer,
    double? minzoom,
    double? maxzoom,
    dynamic filter,
    bool enableInteraction = true}) async {
  await _vietmapGLPlatform.addSymbolLayer(
    sourceId,
    layerId,
    properties.toJson(),
    belowLayerId: belowLayerId,
    sourceLayer: sourceLayer,
    minzoom: minzoom,
    maxzoom: maxzoom,
    filter: filter,
    enableInteraction: enableInteraction,
  );
}