Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
joewdavies committed Jan 8, 2025
1 parent 31d4568 commit 6c45775
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 20 deletions.
14 changes: 4 additions & 10 deletions dist/gridviz.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/gridviz.min.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions src/core/GeoCanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class GeoCanvas {
const dy = tP.y - t.y
this.pan(dx * this.view.z, -dy * this.view.z)
} else {
// Throttling the zoom
// Zoom logic
handleZoom(e.sourceEvent, containerRect, f, offsetX, offsetY)
}
tP = t
Expand All @@ -123,7 +123,6 @@ export class GeoCanvas {
})
.on('end', (e) => {
// end of pan/zoom event
//console.log('zoom redraw')
this.redraw()
this.canvasSave = { c: null, dx: 0, dy: 0, f: 1 }

Expand Down
9 changes: 2 additions & 7 deletions src/dataset/TiledGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@ export class TiledGrid extends Dataset {
async getData(extGeo) {
if (!this.info) return this

// Capture the current zoom level
const currentZoom = this.map.geoCanvas.view.z
this.currentZoomLevel = currentZoom

// Create an AbortController for the current data request
this.abortController = new AbortController()
const signal = this.abortController.signal
Expand Down Expand Up @@ -143,7 +139,7 @@ export class TiledGrid extends Dataset {
this.cache[xT][yT] = 'loading'

tilePromises.push(
this.loadTile(xT, yT, currentZoom, signal)
this.loadTile(xT, yT, signal)
.then((tile) => {
this.cache[xT][yT] = tile

Expand All @@ -168,11 +164,10 @@ export class TiledGrid extends Dataset {
*
* @param {number} xT
* @param {number} yT
* @param {number} requestZoom
* @param {AbortSignal} signal
* @returns {Promise<any>}
*/
async loadTile(xT, yT, requestZoom, signal) {
async loadTile(xT, yT, signal) {
try {
const data = await csv(`${this.url}${xT}/${yT}.csv`, { signal })

Expand Down

0 comments on commit 6c45775

Please sign in to comment.