File tree 1 file changed +3
-2
lines changed
packages/maptalks/src/renderer/layer
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -418,7 +418,6 @@ const ImageGLRenderable = function <T extends MixinConstructor>(Base: T) {
418
418
* @param image
419
419
*/
420
420
loadTexture ( image : TileImageType , resized = false ) : TileImageTexture {
421
- const map = ( this as any ) . getMap ( ) ;
422
421
const gl = this . gl ;
423
422
let texture = image . texture ; // Create a texture object
424
423
if ( ! texture ) {
@@ -428,12 +427,14 @@ const ImageGLRenderable = function <T extends MixinConstructor>(Base: T) {
428
427
gl . bindTexture ( gl . TEXTURE_2D , texture ) ;
429
428
const genMipmap = this . layer . options [ 'mipmapTexture' ] ;
430
429
if ( genMipmap ) {
430
+ const map = ( this as any ) . getMap ( ) ;
431
+ const dpr = map . getDevicePixelRatio ( ) ;
431
432
if ( map . isMoving ( ) && map . getRenderer ( ) . isViewChanged ( ) ) {
432
433
gl . texParameteri ( gl . TEXTURE_2D , gl . TEXTURE_MIN_FILTER , gl . LINEAR_MIPMAP_LINEAR ) ;
433
434
} else {
434
435
gl . texParameteri ( gl . TEXTURE_2D , gl . TEXTURE_MIN_FILTER , gl . LINEAR ) ;
435
436
}
436
- if ( resized ) {
437
+ if ( dpr !== 1 || resized ) {
437
438
gl . texParameteri ( gl . TEXTURE_2D , gl . TEXTURE_MAG_FILTER , gl . LINEAR ) ;
438
439
} else {
439
440
gl . texParameteri ( gl . TEXTURE_2D , gl . TEXTURE_MAG_FILTER , gl . NEAREST ) ;
You can’t perform that action at this time.
0 commit comments