Open lowswaplab opened 3 years ago
Oh wait, do not accept this PR yet. It looks like eye altitude is based on Mean Sea Level (or geoid height or something similar). For example, if you zoom in as far as you can on the Alps, eye altitude is set to 2km. Not 0m as I expected. Instead of using eye altitude alone, I need to calculate height above ground: eye altitude - terrain altitude.
Why do you not using lookAt.range instead of eye.altitude?
LookAt.range is a distance to surface (including terrain elevation) of point in screen center.
Done
I have compared this feature with Java and Android code bases. They use constant amount of decimal places, e.g. 4 or 6.
Why do we need this dynamic decimal places? Can we simply replace 2 with 6 for all case?
I did this because having 6 decimal places doesn't make sense when a pixel is only a decimal place or two wide...
Description of the Change
Scale latitude/longitude decimal places based on eye altitude. For example, if zoomed in really close, show latitude/longitude with 6 decimal places. If zoomed way out, only show 1 or 2 decimal places.
Why Should This Be In Core?
To improve display and accuracy of latitude/longitude display.
Benefits
Better display.
Potential Drawbacks
None.
Applicable Issues
None. But there are a few of hardcoded values in CoordinatesDisplayLayer that need to be taken care of (that were there prior to this PR). These hardcoded values appear to assume character width and other values.