Skip to content

Conversation

kirkedev
Copy link
Contributor

@kirkedev kirkedev commented May 3, 2013

Now that we can override Layer stamping with 786fadd I think it makes sense to access them with their id.

In my use case I'm using custom indexes (Backbone.Model.cid) to identify polygons, and this would be a convenient way to keep things in sync. For example, if a model is deleted I can remove the polygon from the map with removeLayer(model.cid).

If not, I can still use LayerGroup._layers[model.cid]

@mourner
Copy link
Member

mourner commented May 3, 2013

Good idea, thanks!

mourner added a commit that referenced this pull request May 3, 2013
hasLayer and removeLayer by id.
@mourner mourner merged commit c376354 into Leaflet:master May 3, 2013
mourner added a commit that referenced this pull request May 4, 2013
Extend #1642 to include FeatureGroups and lookup by id.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants