ol2 icon indicating copy to clipboard operation
ol2 copied to clipboard

Constant OpenLayers.INCHES_PER_UNIT[m] changed from 39.3701 to 39.37 since release 2.13

Open nakamura2000 opened this issue 8 years ago • 2 comments

Constant 'INCHES_PER_UNIT' has from 39.3701 to 39.37 since release 2.13 That change causes layer of meter unit to be displayed in slightly different position.

'INCHES_PER_UNIT' is defined in Util.js

https://github.com/openlayers/ol2/blob/master/lib/OpenLayers/Util.js

nakamura2000 avatar Sep 27 '16 09:09 nakamura2000

Does the explanation at the commit 893966dfae6e9f2e376e08eccbf6b4474de56cd7 help?

marcjansen avatar Sep 27 '16 10:09 marcjansen

Thank you for response.

I can not understand 893966d perfectly, but case when base layer is Web Mercator tile and map unit is meter and calculating scale by map.getScale(), you have to use international inch. OL 2.13.1 uses us survey inch.

Link below says map scale is calculated with 1/0.0254 (international inch 39.370078 ... )

https://msdn.microsoft.com/ja-jp/library/bb259689.aspx?lang=ja-jp

map scale = 1 : ground resolution * screen dpi / 0.0254 meters/inch

On the other hand, OpenLayers.Util.getScaleFromResolution() uses INCHES_PER_UNIT 'm' ( 39.37 : us survey inch)

nakamura2000 avatar Sep 28 '16 05:09 nakamura2000