Skip to content

Commit 4c73779

Browse files
committed
【update】mapboxgl heatmaplayer 代码优化; review by songym
1 parent 6f89e7c commit 4c73779

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/mapboxgl/overlay/HeatMapLayer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ export class HeatMapLayer extends mapboxgl.Evented {
227227
this.rootCanvas.width = this.maxWidth = parseInt(mapCanvas.style.width);
228228
this.rootCanvas.height = this.maxHeight = parseInt(mapCanvas.style.height);
229229
this.canvasContext = this.rootCanvas.getContext('2d');
230-
let devicePixelRatio = window.devicePixelRatio || 1;
230+
const devicePixelRatio = window.devicePixelRatio || 1;
231231
devicePixelRatio !== 1 && this.canvasContext && this.canvasContext.scale(devicePixelRatio, devicePixelRatio);
232232

233233
CommonUtil.modifyDOMElement(this.rootCanvas, null, {x: 0, y: 0}, {w: this.maxWidth, h: this.maxHeight},
@@ -626,7 +626,7 @@ export class HeatMapLayer extends mapboxgl.Evented {
626626
this.rootCanvas.style.height = canvas.style.height;
627627
this.rootCanvas.width = this.maxWidth = parseInt(canvas.style.width);
628628
this.rootCanvas.height = this.maxHeight = parseInt(canvas.style.height);
629-
let devicePixelRatio = window.devicePixelRatio || 1;
629+
const devicePixelRatio = window.devicePixelRatio || 1;
630630
devicePixelRatio !== 1 && this.canvasContext && this.canvasContext.scale(devicePixelRatio, devicePixelRatio);
631631
this.refresh();
632632
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy