MapView.getMapScale() should take into account DPI

1385
1
04-28-2020 06:22 AM
Status: Open
MartinBoulanger
New Contributor II

Values returned by MapView.getMapScale() method are innacurate.

This method does not take into account DPI, OS settings or monitor sizes when returning values.

We would like an improved version of the method that would be consider these factors when computing the scale. 

Tags (3)
1 Comment
dotMorten_esri

Could you describe a bit more clearly what you're looking for? The MapScale property does take into account the system-reported DPI. Now that DPI value isn't necessarily correct (it usually isn't, and a user can even change the scaling factor in system settings), and there's not a good way to actually get that correct value programmatically. Just consider when you connect your laptop to a projector and duplicate your screen: You now have two very different DPIs for the same window, so which one should you use?
In any case you'd need to ask the user to go through a manual "calibration" process to calculate the difference between system-reported dpi and physical dpi. Once you've done that, you can just multiple the reported scale with this factor.
In practice map scale really doesn't make much sense until you're on printed paper. On the computer, the scale value is more of a relative term, used to handle scale dependencies etc across layers etc, and work across different devices in a similar manner.

Mobile phones for instance purposefully fudges the scaling factor even more, because they are generally used closer to you than a desktop pc and has much higher pixel density and therefore renders things smaller than their desktop counterparts, to fit more on the tiny screen while still being able to read it.