Generated JSDoc.
This commit is contained in:
@@ -1440,26 +1440,13 @@
|
||||
<article>
|
||||
<pre id="source-code" class="prettyprint source linenums"><code>import { Capabilities } from '../../capabilities.js'
|
||||
import { Points } from '../../utils.js'
|
||||
import { deepZoomTileCache } from './tile.js'
|
||||
import Tile from './tile.js'
|
||||
import { Tiles } from './tiles.js'
|
||||
|
||||
function isEven(n) {
|
||||
return n % 2 == 0
|
||||
}
|
||||
|
||||
|
||||
function printTileCacheInfos() {
|
||||
let references = new Map()
|
||||
let multiples = 0
|
||||
for (let [url, tiles] of deepZoomTileCache.entries()) {
|
||||
let count = tiles.size
|
||||
references.set(url, count)
|
||||
if (count > 1) {
|
||||
multiples += 1
|
||||
}
|
||||
}
|
||||
console.log({ multiples, references })
|
||||
}
|
||||
/**
|
||||
* A utility class that holds information typically provided by DZI files, i.e.
|
||||
* height and width of the overall image, overlap, and image type.
|
||||
@@ -1797,7 +1784,7 @@ export class DeepZoomImage extends PIXI.Container {
|
||||
world = null, // Defines the world bounds the images lives in
|
||||
highResolution = true,
|
||||
autoLoadTiles = true,
|
||||
preferWorker = false,
|
||||
useWorker = '',
|
||||
minimumLevel = 0,
|
||||
alpha = 1,
|
||||
app = window.app
|
||||
@@ -1808,12 +1795,13 @@ export class DeepZoomImage extends PIXI.Container {
|
||||
this.debug = debug
|
||||
this.shadow = shadow
|
||||
this.world = world
|
||||
this.preferWorker = preferWorker
|
||||
this.useWorker = useWorker
|
||||
this.resolution = highResolution
|
||||
? Math.round(window.devicePixelRatio)
|
||||
: 1
|
||||
this.alpha = alpha
|
||||
this.fastLoads = 0
|
||||
this.active = true
|
||||
this.autoLoadTiles = autoLoadTiles
|
||||
this.minimumLevel = minimumLevel
|
||||
this.quadTrees = new Map() // url as keys, TileQuadNodes as values
|
||||
@@ -2085,9 +2073,9 @@ export class DeepZoomImage extends PIXI.Container {
|
||||
}
|
||||
|
||||
worldBounds() {
|
||||
let viewBounds = this.app.scene.bounds
|
||||
let viewBounds = this.app.scene.bounds || this.app.scene.getBounds()
|
||||
// Using getBounds extends visible scope after loading tiles and leads
|
||||
// to excessive loading
|
||||
// to excessive loading. So we prefer bounds over getBounds()
|
||||
if (this.world != null) {
|
||||
let bounds = this.world.bounds
|
||||
let x = Math.max(-bounds.width, bounds.x)
|
||||
@@ -2467,6 +2455,9 @@ export class DeepZoomImage extends PIXI.Container {
|
||||
* @param {boolean} debug - log debug infos
|
||||
*/
|
||||
transformed(event) {
|
||||
if (!this.active) {
|
||||
return
|
||||
}
|
||||
let key = this.currentLevel.toString()
|
||||
let currentTiles = this.tileLayers[key]
|
||||
if (typeof currentTiles == 'undefined') {
|
||||
@@ -2489,7 +2480,7 @@ export class DeepZoomImage extends PIXI.Container {
|
||||
this.ensureTiles(this.currentLevel, event.about)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
let level = this.levelForScale(event.scale)
|
||||
let newLevel = Math.max(level, this.minimumLevel)
|
||||
if (newLevel != this.currentLevel) {
|
||||
@@ -2514,6 +2505,7 @@ export class DeepZoomImage extends PIXI.Container {
|
||||
* @memberof DeepZoomImage
|
||||
*/
|
||||
activate() {
|
||||
this.active = true
|
||||
this.destroyTilesAboveLevel(this.currentLevel)
|
||||
this.ensureTiles(this.currentLevel, null)
|
||||
//console.log("Activate Textures!", this.currentLevel)
|
||||
@@ -2525,35 +2517,19 @@ export class DeepZoomImage extends PIXI.Container {
|
||||
* @memberof DeepZoomImage
|
||||
*/
|
||||
deactivate() {
|
||||
this.active = false
|
||||
this.destroyAllTiles()
|
||||
Object.keys(this.tileLayers).forEach(key => {
|
||||
this.destroyTiles(key)
|
||||
})
|
||||
this.tileContainer.destroy({ children: true })
|
||||
printTileCacheInfos()
|
||||
}
|
||||
|
||||
throwFinished() {
|
||||
console.log("throwFinished")
|
||||
//console.log("throwFinished")
|
||||
let key = this.currentLevel.toString()
|
||||
let currentTiles = this.tileLayers[key]
|
||||
if (typeof currentTiles == 'undefined') {
|
||||
return
|
||||
}
|
||||
|
||||
this.ensureTiles(this.currentLevel)
|
||||
// let all = new Set()
|
||||
// for (let tile of currentTiles.children) {
|
||||
// all.add(tile.url)
|
||||
// }
|
||||
// let { centerCol, centerRow, needed } = this.neededTiles(currentTiles, this.currentLevel)
|
||||
// for (let [url, col, row] of needed) {
|
||||
// all.delete(url)
|
||||
// }
|
||||
// for (let url of all) {
|
||||
// currentTiles.destroyTileByUrl(url)
|
||||
// }
|
||||
// currentTiles.loader.loader.reset()
|
||||
}
|
||||
}
|
||||
</code></pre>
|
||||
@@ -2569,7 +2545,7 @@ export class DeepZoomImage extends PIXI.Container {
|
||||
|
||||
<footer class="content-size">
|
||||
<div class="footer">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.2</a> on Tue May 14 2019 14:29:52 GMT+0200 (Mitteleuropäische Sommerzeit)
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.2</a> on Wed Jul 10 2019 11:54:25 GMT+0200 (Mitteleuropäische Sommerzeit)
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user