+ public static long getScaleFromResolution(long resolution) {
+ // see https://gis.stackexchange.com/questions/242424/how-to-get-map-units-to-find-current-scale-in-openlayers
+ final double INCHES_PER_UNIT = 39.37;// m
+ // final double INCHES_PER_UNIT = 4374754;// dd
+ final long DOTS_PER_INCH = 72;
+ return Math.round(INCHES_PER_UNIT * DOTS_PER_INCH * resolution);
+ }
+