Ongoing cleanup and refactoring of maps.
This commit is contained in:
+16
-19
@@ -349,22 +349,21 @@ export class CoverScatter extends AdvancedScatter {
|
||||
this.debugGraphics.endFill()
|
||||
}
|
||||
|
||||
// if (this.cover) {
|
||||
// // The reference to the element handler needs to be stored,
|
||||
// // that we can remove it later on.
|
||||
// this._applyInitialCover = this._applyInitialCover.bind(this)
|
||||
// }
|
||||
if (this.cover) {
|
||||
// The reference to the element handler needs to be stored,
|
||||
// that we can remove it later on.
|
||||
this._applyInitialCover = this._applyInitialCover.bind(this)
|
||||
this.displayObject.on('added', this._applyInitialCover)
|
||||
this._applyInitialCover()
|
||||
}
|
||||
}
|
||||
|
||||
// _applyInitialCover() {
|
||||
// if (this.debug) console.log('ApplyInitialCover: ', parent)
|
||||
_applyInitialCover() {
|
||||
if (this.debug) console.log('ApplyInitialCover: ', parent)
|
||||
|
||||
// if (this.displayObject.parent)
|
||||
// this.forceCover(this.displayObject.parent.width, this.displayObject.parent.height)
|
||||
// else {
|
||||
// this.displayObject.on('added', eventHandler)
|
||||
// }
|
||||
// }
|
||||
if (this.displayObject.parent)
|
||||
this.forceCover(this.displayObject.parent.width, this.displayObject.parent.height)
|
||||
}
|
||||
|
||||
get boundaries() {
|
||||
if (this._boundaries) return this._boundaries
|
||||
@@ -487,8 +486,6 @@ export class CoverScatter extends AdvancedScatter {
|
||||
if (this.cover) {
|
||||
let minCoverScale = this.calculateMinCoverScale(this.parent.width, this.parent.height)
|
||||
if (scale < minCoverScale) {
|
||||
console.error('USE MIN COVER SCALE', minCoverScale, scale)
|
||||
|
||||
scale = minCoverScale
|
||||
}
|
||||
}
|
||||
@@ -546,10 +543,10 @@ export class MapObjectScatter extends CoverScatter {
|
||||
)
|
||||
super(displayObject, renderer, opts)
|
||||
|
||||
if (!renderer) {
|
||||
console.error('Renderer was not set!')
|
||||
return
|
||||
}
|
||||
// if (!renderer) {
|
||||
// console.error('Renderer was not set!')
|
||||
// return
|
||||
// }
|
||||
|
||||
this.cover = opts.cover
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user