It seems like there is a bug in the implementation of the raster dem tile source. At least that's as far as I've been able to boil down the repro case so far.
The presence of any attribute except url, tileSize, tiles, bounds, encoding (or removing one of them) causes an update of the style's state when applying the same style again.
Seems like removing (i.e using parent's one) serialize() solves a problem.
mapbox-gl-js version: 2.1.1
map 'jumps' on setStyle()
https://codepen.io/bolatuly/pen/KKNQqaE
Thanks for the details @bolatuly , it seems like some option fields were newly added to the RasterDEMSourceSpecification but not reflected back in the serialized function. Could you confirm that this commit https://github.com/mapbox/mapbox-gl-js/commit/36495f137eef99d2de672738896e1b149c3fa7aa fixes your use case?
@karimnaaji why not just completly remove serialize function from RasterDEMTileSource? Base class of RasterDEMTileSource already has the same serialize function as you commited
@exe-dealer yes good point I did not notice! it can be entirely removed.
@karimnaaji thanks, it works now as expected
Closed via #10418
Most helpful comment
@karimnaaji why not just completly remove
serializefunction fromRasterDEMTileSource? Base class ofRasterDEMTileSourcealready has the sameserializefunction as you commited