Add layers and sources (e.g., GeoJSON, images) to the map in real time. This will allow you to
dynamically change a map’s style in response to user interaction and context.
Sample use case 1: You want to add extra layers with building plans from your custom source.
Sample use case 2: You want to dynamically modify source parameters (e.g., a URL).
To create a layer and dynamically add it to the style:
Layer layer =LayerFactory.createLayer(layerJson)
tomtomMap.getStyleSettings().addLayer(layer);
val layer = LayerFactory.createLayer(layerJson)
tomtomMap.styleSettings.addLayer(layer)
To create a GeoJSON source and dynamically add it to the style: