Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Throw exception when adding layer with duplicate ID #7254

Closed

Description

@1ec5

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

Activity

  1. added
    Core
    on Dec 1, 2016
  2. self-assigned this
    on Dec 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Core

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions