Remove decorationsForId from DecorationManager

This commit is contained in:
Nathan Sobo
2017-03-03 06:01:23 -07:00
committed by Antonio Scandurra
parent 69d5b63e9d
commit fbf21e09d6

View File

@@ -8,7 +8,6 @@ class DecorationManager {
this.displayLayer = displayLayer
this.emitter = new Emitter()
this.decorationsById = {}
this.decorationsByMarker = new Map()
this.overlayDecorations = new Set()
this.layerDecorationsByMarkerLayer = new Map()
@@ -33,10 +32,6 @@ class DecorationManager {
return this.emitter.on('did-update-decorations', callback)
}
decorationForId (id) {
return this.decorationsById[id]
}
getDecorations (propertyFilter) {
let allDecorations = []
@@ -160,7 +155,6 @@ class DecorationManager {
}
decorationsForMarker.push(decoration)
if (decoration.isType('overlay')) this.overlayDecorations.add(decoration)
this.decorationsById[decoration.id] = decoration
this.observeDecoratedLayer(marker.layer)
this.emitDidUpdateDecorations()
this.emitter.emit('did-add-decoration', decoration)
@@ -203,7 +197,6 @@ class DecorationManager {
if (index > -1) {
decorations.splice(index, 1)
delete this.decorationsById[decoration.id]
this.emitter.emit('did-remove-decoration', decoration)
if (decorations.length === 0) {
delete this.decorationsByMarker.delete(marker)