diff --git a/src/mapboxgl/overlay/MapvLayer.js b/src/mapboxgl/overlay/MapvLayer.js index c79579cebc..bb434276d8 100644 --- a/src/mapboxgl/overlay/MapvLayer.js +++ b/src/mapboxgl/overlay/MapvLayer.js @@ -117,15 +117,15 @@ export class MapvLayer { canvas.style.position = 'absolute'; canvas.style.top = 0 + "px"; canvas.style.left = 0 + "px"; - canvas.width = parseInt(this.map.getCanvas().style.width); - canvas.height = parseInt(this.map.getCanvas().style.height); - canvas.style.width = this.map.getCanvas().style.width; - canvas.style.height = this.map.getCanvas().style.height; var global$2 = typeof window === 'undefined' ? {} : window; var devicePixelRatio = this.devicePixelRatio = global$2.devicePixelRatio; + canvas.width = parseInt(this.map.getCanvas().style.width)*devicePixelRatio; + canvas.height = parseInt(this.map.getCanvas().style.height)*devicePixelRatio; if (this.mapVOptions.context == '2d') { canvas.getContext(this.mapVOptions.context).scale(devicePixelRatio, devicePixelRatio); } + canvas.style.width = this.map.getCanvas().style.width; + canvas.style.height = this.map.getCanvas().style.height; return canvas; } diff --git a/src/mapboxgl/overlay/mapv/MapvRenderer.js b/src/mapboxgl/overlay/mapv/MapvRenderer.js index 9c927c560a..b904c4316b 100644 --- a/src/mapboxgl/overlay/mapv/MapvRenderer.js +++ b/src/mapboxgl/overlay/mapv/MapvRenderer.js @@ -308,8 +308,11 @@ export class MapvRenderer extends BaseLayer { canvas.style.position = 'absolute'; canvas.style.top = 0 + "px"; canvas.style.left = 0 + "px"; - canvas.width = parseInt(this.map.getCanvas().style.width); - canvas.height = parseInt(this.map.getCanvas().style.height); + var global$2 = typeof window === 'undefined' ? {} : window; + var devicePixelRatio = this.canvasLayer.devicePixelRatio = global$2.devicePixelRatio; + canvas.width = parseInt(this.map.getCanvas().style.width)*devicePixelRatio; + canvas.height = parseInt(this.map.getCanvas().style.height)*devicePixelRatio; + canvas.style.width = this.map.getCanvas().style.width; canvas.style.height = this.map.getCanvas().style.height; }
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: