This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
Throw exception when adding layer with duplicate ID #7254
Labels
Core
The cross-platform C++ core, aka mbgl
Similar to #7011, we should throw an exception when adding a layer to the style whose ID is already in use by another layer in the style. The style specification describes the
id
property on a layer as “unique”, andmbgl::Map::getLayer()
relies on that fact.Alternatively, it would be possible to silently replace the existing layer that has a matching ID. But I’d prefer that we make the developer explicitly replace the layer, since reusing an ID is most likely an unintentional error.
/cc @ivovandongen @jfirebaugh
The text was updated successfully, but these errors were encountered: