diff --git a/lib/OpenLayers/Util.js b/lib/OpenLayers/Util.js index f4948edc37..a8c4a5de42 100644 --- a/lib/OpenLayers/Util.js +++ b/lib/OpenLayers/Util.js @@ -962,8 +962,8 @@ OpenLayers.INCHES_PER_UNIT = { 'inches': 1.0, 'ft': 12.0, 'mi': 63360.0, - 'm': 39.3701, - 'km': 39370.1, + 'm': 39.37, + 'km': 39370, 'dd': 4374754, 'yd': 36 }; diff --git a/tests/Format/WMSCapabilities/v1_1_1.html b/tests/Format/WMSCapabilities/v1_1_1.html index 0d044e480c..e3b0863624 100644 --- a/tests/Format/WMSCapabilities/v1_1_1.html +++ b/tests/Format/WMSCapabilities/v1_1_1.html @@ -340,7 +340,7 @@ // needed for the minScale/maxScale test, see below var dpi = OpenLayers.DOTS_PER_INCH; - OpenLayers.DOTS_PER_INCH = 90.71; + OpenLayers.DOTS_PER_INCH = 90.710230403857; var xml = document.getElementById("ogcsample").firstChild.nodeValue; var doc = new OpenLayers.Format.XML().read(xml); @@ -377,7 +377,7 @@ - corresponds to (RESOLUTION keyword in MAP file has value of 90.71): + corresponds to (RESOLUTION keyword in MAP file has value of 90.710230403857): MAXSCALE 250000 MINSCALE 1000 diff --git a/tests/Layer.html b/tests/Layer.html index 22935f7e3a..1c3db10577 100644 --- a/tests/Layer.html +++ b/tests/Layer.html @@ -400,13 +400,13 @@ [0.0012699126752168362, 0.0006349563376084181, 0.00031747816880420905], 0.00031747816880420905, 0.0012699126752168362 ], [ "1.18", null, {scales: [400000, 200000, 100000], units: "m"}, - [141.11103491115225, 70.55551745557612, 35.27775872778806], 35.27775872778806, 141.11103491115225 + [141.11139333389778, 70.55569666694889, 35.277848333474445], 35.277848333474445, 141.11139333389778 ], [ "1.19", null, {minScale: 400000, numZoomLevels: 3, units: "m"}, - [141.11103491115225, 70.55551745557612, 35.27775872778806], 35.27775872778806, 141.11103491115225 + [141.11139333389778, 70.55569666694889, 35.277848333474445], 35.277848333474445, 141.11139333389778 ], [ "1.20", null, {maxScale: 100000, numZoomLevels: 3, units: "m"}, - [141.11103491115225, 70.55551745557612, 35.27775872778806], 35.27775872778806, 141.11103491115225 + [141.11139333389778, 70.55569666694889, 35.277848333474445], 35.277848333474445, 141.11139333389778 ], [ "1.21", null, {numZoomLevels: 2}, // maxResolution calculated based on the projection's maxExtent here [1.40625, 0.703125], 0.703125, 1.40625 @@ -519,7 +519,7 @@ [0.0012699126752168362, 0.0006349563376084181, 0.00031747816880420905], 0.00031747816880420905, 0.0012699126752168362 ], [ "2.5.4", {units: "m"}, {scales: [400000, 200000, 100000]}, - [141.11103491115225, 70.55551745557612, 35.27775872778806], 35.27775872778806, 141.11103491115225 + [141.11139333389778, 70.55569666694889, 35.277848333474445], 35.277848333474445, 141.11139333389778 ], [ /* * Batch 2.6: minScale set in the layer options diff --git a/tests/Util.html b/tests/Util.html index 4a7507e451..3972d68d84 100644 --- a/tests/Util.html +++ b/tests/Util.html @@ -706,6 +706,12 @@ t.ok(OpenLayers.String.startsWith(id, "chicken"), "OpenLayers.Util.createUniqueID starts id correctly"); } + + function test_units(t) { + t.plan(2); + t.eq(OpenLayers.INCHES_PER_UNIT.m, OpenLayers.INCHES_PER_UNIT.Meter, 'Same inches per m and Meters'); + t.eq(OpenLayers.INCHES_PER_UNIT.km, OpenLayers.INCHES_PER_UNIT.Kilometer, 'Same inches per km and Kilometers'); + } function test_Util_normalizeScale(t) { t.plan(2); @@ -728,7 +734,7 @@ var scale = 1/150000000; var resolution = OpenLayers.Util.getResolutionFromScale(scale, 'm'); - t.eq(resolution.toFixed(6), "52916.638092", "Calculated correct resolution for " + scale); + t.eq(resolution.toFixed(6), "52916.772500", "Calculated correct resolution for " + scale); scale = 150000000; resolution = OpenLayers.Util.getResolutionFromScale(scale);