DPI set is not the DPI send

464
2
11-10-2017 12:22 AM
ThibautDAVID
New Contributor

When we create a new MapImageLayer, the dpi send to the MapServer is not the one defined.
By default, the dpi is 96 but the one send to the http GET is 108.
(witch make our servers not sending the correct data)

To have the correct dpi send, we are obliged to set the dpi to (96*96)/108.

Why the dpi can't stay the same ? Why is it modified ?

Tags (3)
0 Kudos
2 Replies
ThibautDAVID
New Contributor

It depends of the zoom of the OS and Navigator.
It's good for me to find that, but it's still a problem : user can have the zoom he want, but the dpi must still the same for the MapServer.

0 Kudos
JackFanZhang
Occasional Contributor

For people like me who had the same question in 2022 or later, I found out the actual DPI parameter sent in the request is multiplied by the device screen DPI, which can be accessed by window.devicePixelRatio. For example, If you want to lock the DPI to 96 for all requests regardless the device screen DPI, then set the dpi to 96/window.devicePixelRatio.

0 Kudos