Every 2 seconds I create a new image source and a new layer for that source:
map.addSource("source_" + photo_id, {
"type": "image",
"url": photo_url,
"coordinates": [... ]
})
map.addLayer({
"id": "layer_" + photo_id,
"source": "source_" + photo_id,
"type": "raster",
"paint": {"raster-opacity": 0.6}
})
That means for every photo, a new layer is created. I was wondering, is it possible to add multiple photo sources on the same layer in order to avoid this multiple layer creation?
map.getSource('photoSource').updateImage(...)
won't work because I would like all the previous photos to also remain on the map
Basically my goal is to separate the photos on the map into groups, in order to be able later to remove a certain group of photos, and that would be possible with multiple sources in one layer.