Skip to content
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

Closed
1ec5 opened this issue Dec 1, 2016 · 0 comments
Closed

Throw exception when adding layer with duplicate ID #7254

1ec5 opened this issue Dec 1, 2016 · 0 comments
Assignees
Labels
Core The cross-platform C++ core, aka mbgl

Comments

@1ec5
Copy link
Contributor

1ec5 commented Dec 1, 2016

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”, and mbgl::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

@1ec5 1ec5 added the Core The cross-platform C++ core, aka mbgl label Dec 1, 2016
@ivovandongen ivovandongen self-assigned this Dec 1, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core The cross-platform C++ core, aka mbgl
Projects
None yet
Development

No branches or pull requests

2 participants