Changing pixelRatio only seems to lower quality #3750
Replies: 4 comments
-
No, this is not the expected behavior of pixel ratio. |
Beta Was this translation helpful? Give feedback.
-
An image can look exactly the same on mobile and desktop if the aspect ratio remains the same. It just becomes bigger. That's what I'm also looking for in this library. We are planning to use this library to print wooden maps of sizes like half a meter and would like to show quite some details on it which are shown in the desktop version, but not on the mobile version if you zoom out to the same boundaries. If that is not possible, do you have other suggestions? |
Beta Was this translation helpful? Give feedback.
-
No, an image on desktop vs portrait mobile won't look the same in full screen mode due to different aspect ratio - this is an extreme example but it applies to more stubble cases. |
Beta Was this translation helpful? Give feedback.
-
I am currently using center and zoom and the map doesn't need to be fullscreen :) Are you aware of a method that will keep the bounds the same for desktop and mobile somehow by keeping the aspect ratio the same, but by having a different pixel size for both? I saw you mentioned that you had this same functionality built into your website in the first comment of the mentioned issue. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all, I'm in a very similar scenario as described in this issue. I want to be able to show the exact same map on any device if I enter the same coordinates and zoom level. I thought pixelRatio would be the way to go here, but that doesn't seem to work. The boundaries seem to stay the same, while the quality of the map lowers. Is there anyone who can help me out? Also see codesandbox below.
maplibre-gl-js version: 2.4.0
browser: Chrome v115
Steps to Trigger Behavior
Link to Demonstration
https://codesandbox.io/s/flamboyant-kare-xdssym?file=/src/index.js
Expected Behavior
I might be wrong, but I would expect the boundaries of the map to change because the pixel density changes while the map container size stays the same.
Actual Behavior
The boundaries stay the same and the quality of the map lowers
Beta Was this translation helpful? Give feedback.
All reactions