I have created few layers with the help of mapbox studio and initialized the mapboxgl object with the style sheet link.
This has worked fine but now I want to refresh/re-assign the layer with some real new sources at client side.
I am using following code
mapBox.addSource('source-id', { type: 'geojson', data: mergedOverlaysGeoJson });
mapBox.addLayer({
"id": 'some-already-created-layer-id',
"source":'source-id',
"type" : "symbol"});
But its not working as expected, where expectations are :
Whatever properties I give to addLayer method, it should override the corresponding properties came through studio and it should retain the others
'id' of layer , 'source' of layer and 'type' of layer field are mandatory to detect the existing layer