smas1 / geoext-viewer

Automatically exported from code.google.com/p/geoext-viewer
GNU General Public License v3.0
0 stars 0 forks source link

Print Preview scale wrong #167

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have a project in 27700 (British national grid). To get the area measurement 
and line measurement tools as well as the scale bar itself to be correct I 
needed to set "geodesic: false":

new OpenLayers.Control.ScaleLine({geodesic: false, maxWidth: 200}) 

However, when I go to print preview, the scale is extremely wrong, in the same 
sort of it way it was in the general application before I set "geodesic:false". 
I suspect this parameter isn't being transferred across properly.

Original issue reported on code.google.com by jonathan...@warwickshire.gov.uk on 25 Jan 2013 at 4:59

GoogleCodeExporter commented 9 years ago
Note: The scale in the final print appears to be correct. Its just the print 
preview dialog that has this issue.

Original comment by jonathan...@warwickshire.gov.uk on 25 Jan 2013 at 5:07

GoogleCodeExporter commented 9 years ago
A workaround for this is to include proj4js and an applicable definition for 
the SRS. I.e.:

    <script src="http://wppgeog3/libs/proj4js-1.1.0/lib/proj4js-compressed.js" type="text/javascript"></script>
    <script type="text/javascript">
        Proj4js.defs["EPSG:27700"] = "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +datum=OSGB36 +units=m +no_defs ";
        EPSG27700 = new OpenLayers.Projection( "EPSG:27700" );
    </script>

The question is - why is that needed for print preview scale but none of the 
other scales?

Original comment by jonathan...@warwickshire.gov.uk on 14 Feb 2013 at 5:35