File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -117,15 +117,15 @@ export class MapvLayer {
117117 canvas . style . position = 'absolute' ;
118118 canvas . style . top = 0 + "px" ;
119119 canvas . style . left = 0 + "px" ;
120- canvas . width = parseInt ( this . map . getCanvas ( ) . style . width ) ;
121- canvas . height = parseInt ( this . map . getCanvas ( ) . style . height ) ;
122- canvas . style . width = this . map . getCanvas ( ) . style . width ;
123- canvas . style . height = this . map . getCanvas ( ) . style . height ;
124120 var global$2 = typeof window === 'undefined' ? { } : window ;
125121 var devicePixelRatio = this . devicePixelRatio = global$2 . devicePixelRatio ;
122+ canvas . width = parseInt ( this . map . getCanvas ( ) . style . width ) * devicePixelRatio ;
123+ canvas . height = parseInt ( this . map . getCanvas ( ) . style . height ) * devicePixelRatio ;
126124 if ( this . mapVOptions . context == '2d' ) {
127125 canvas . getContext ( this . mapVOptions . context ) . scale ( devicePixelRatio , devicePixelRatio ) ;
128126 }
127+ canvas . style . width = this . map . getCanvas ( ) . style . width ;
128+ canvas . style . height = this . map . getCanvas ( ) . style . height ;
129129 return canvas ;
130130 }
131131
Original file line number Diff line number Diff line change @@ -308,8 +308,11 @@ export class MapvRenderer extends BaseLayer {
308308 canvas . style . position = 'absolute' ;
309309 canvas . style . top = 0 + "px" ;
310310 canvas . style . left = 0 + "px" ;
311- canvas . width = parseInt ( this . map . getCanvas ( ) . style . width ) ;
312- canvas . height = parseInt ( this . map . getCanvas ( ) . style . height ) ;
311+ var global$2 = typeof window === 'undefined' ? { } : window ;
312+ var devicePixelRatio = this . canvasLayer . devicePixelRatio = global$2 . devicePixelRatio ;
313+ canvas . width = parseInt ( this . map . getCanvas ( ) . style . width ) * devicePixelRatio ;
314+ canvas . height = parseInt ( this . map . getCanvas ( ) . style . height ) * devicePixelRatio ;
315+
313316 canvas . style . width = this . map . getCanvas ( ) . style . width ;
314317 canvas . style . height = this . map . getCanvas ( ) . style . height ;
315318 }
You can’t perform that action at this time.
0 commit comments