maplibre-gl-js icon indicating copy to clipboard operation
maplibre-gl-js copied to clipboard

Computed `pixelRatio` seems to be lower than ideal

Open zdila opened this issue 3 years ago • 4 comments

maplibre-gl-js version: 2.3.0

browser: Vivaldi

Steps to Trigger Behavior

  1. show raster map with MapLibre
  2. show the same raster map with Leaflet

Link to Demonstration

Leaflet: https://www.freemap.sk/#map=14/48.660611/20.539885&layers=X

MapLibre: https://www.freemap.sk/~martin/hikingmap/#style=outdoor&lat=48.66061100&lng=20.53988500&zoom=13.00&bearing=0.00&pitch=0.00&3d=false

Note that you must have good eye to spot the difference, but it is there.

Expected Behavior

Maps should be equally sharp

Actual Behavior

MapLibre map is slightly blurred. Explicitly setting pixelRatio to higher value fixes it.

Animated gif to see the difference: diff

MapLibre: image

Leaflet: image

zdila avatar Aug 30 '22 17:08 zdila

Just a side note, leaflet and maplibre uses a different zoom numbers (difference if 1 between them)

HarelM avatar Aug 30 '22 17:08 HarelM

Also the link for local. Isn't working good. This is not the first time. Please use a different link like jsbin, stackblitz etc instead.

HarelM avatar Aug 30 '22 17:08 HarelM

I apologize for the wrong link. I've fixed it.

zdila avatar Aug 30 '22 18:08 zdila

Just a side note, leaflet and maplibre uses a different zoom numbers (difference if 1 between them)

Then https://github.com/maplibre/maplibre-gl-js/issues/1589 is probably invalid and I missed it in the doc.

In any case it does not affect this issue.

zdila avatar Aug 30 '22 18:08 zdila