From a8c818d2b421c030ad6c2b1c302b463ef4a7ccd1 Mon Sep 17 00:00:00 2001 From: zhanghuibing Date: Fri, 18 May 2018 09:20:24 +0800 Subject: [PATCH] =?UTF-8?q?'=E4=BF=AE=E5=A4=8DmapvLayer=E5=9C=A8=E6=B5=8F?= =?UTF-8?q?=E8=A7=88=E5=99=A8=E7=BC=A9=E6=94=BE=E6=97=B6=E5=85=83=E7=B4=A0?= =?UTF-8?q?=E4=B8=BA=E6=AD=A2=E4=B8=8D=E6=AD=A3=E7=A1=AE=E9=97=AE=E9=A2=98?= =?UTF-8?q?'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mapboxgl/overlay/MapvLayer.js | 8 ++++---- src/mapboxgl/overlay/mapv/MapvRenderer.js | 7 +++++-- 2 files changed, 9 insertions(+), 6 deletions(-) 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; } 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