<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";
        mso-fareast-language:EN-GB;}
span.jskey1
        {mso-style-name:js_key1;
        color:blue;}
span.jsstr1
        {mso-style-name:js_str1;
        color:maroon;}
span.jsnum1
        {mso-style-name:js_num1;
        color:red;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>I really would like to display the contents of my local WMS in a form which the users are used to (i.e. square OS grids, rather than the ‘squashed’ appearance which comes from mapping the EPSG:4326 onto a flat-Earth projection in high latitudes).  I have found numerous examples of’ how to resolve this problem’, but none seem to have any effect on the distortion OR they result in no map being displayed at all.  I cannot connect directly to map servers on the web (spherical Mercator), because my system is an isolated network and the maps are supplied by the customer.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Salient extracts from the js code follow:<o:p></o:p></p><pre style='text-indent:-6.0pt;background:white'><span style='color:black;background:#F0F0F0'>        </span><span class=jskey1><span style='background:#F0F0F0'>var</span></span><span style='color:black;background:#F0F0F0'> map, options = { <o:p></o:p></span></pre><pre style='text-indent:-6.0pt;background:white'><span style='color:black;background:#F0F0F0'>                             projection: </span><span class=jskey1><span style='background:#F0F0F0'>new</span></span><span style='color:black;background:#F0F0F0'> OpenLayers.Projection(</span><span class=jsstr1><span style='background:#F0F0F0'>'EPSG:4326'</span></span><span style='color:black;background:#F0F0F0'>), </span><o:p></o:p></pre><pre style='text-indent:-6.0pt;background:white'><span style='color:black;background:#F0F0F0'>                             //displayProjection: new OpenLayers.Projection(‘EPSG:3574’),<o:p></o:p></span></pre><pre style='text-indent:-6.0pt;background:white'><span style='color:black;background:#F0F0F0'>                             //units: ‘m’,<o:p></o:p></span></pre><pre style='text-indent:-6.0pt;background:white'><span style='color:black;background:#F0F0F0'>                             //maxResolution: 156543.0339,<o:p></o:p></span></pre><pre style='text-indent:-6.0pt;background:white'><span style='color:black;background:#F0F0F0'>                             //maxExtent: new OpenLayers.Bounds(-20037508, -20037508, 20037508, 20037508)<o:p></o:p></span></pre><pre style='text-indent:-6.0pt;background:white'><span style='color:black;background:#F0F0F0'>                             zoom: </span><span class=jsnum1><span style='background:#F0F0F0'>14</span></span><o:p></o:p></pre><pre style='text-indent:-6.0pt;background:white'><span style='color:black;background:#F0F0F0'>                           };</span><o:p></o:p></pre><pre style='text-indent:-6.0pt;background:white'><span style='color:black;background:#F0F0F0'>        map = </span><span class=jskey1><span style='background:#F0F0F0'>new</span></span><span style='color:black;background:#F0F0F0'> OpenLayers.Map(</span><span class=jsstr1><span style='background:#F0F0F0'>'map'</span></span><span style='color:black;background:#F0F0F0'>, options);</span><o:p></o:p></pre><p class=MsoNormal style='text-indent:-6.0pt;background:white'><span style='font-size:10.0pt;font-family:"Courier New";color:black;background:#F0F0F0;mso-fareast-language:EN-GB'><o:p> </o:p></span></p><p class=MsoNormal style='text-indent:-6.0pt;background:white'><span style='font-size:10.0pt;font-family:"Courier New";color:black;background:#F0F0F0;mso-fareast-language:EN-GB'>        </span><span style='font-size:10.0pt;font-family:"Courier New";color:blue;background:#F0F0F0;mso-fareast-language:EN-GB'>var</span><span style='font-size:10.0pt;font-family:"Courier New";color:black;background:#F0F0F0;mso-fareast-language:EN-GB'> my50kLayer = </span><span style='font-size:10.0pt;font-family:"Courier New";color:blue;background:#F0F0F0;mso-fareast-language:EN-GB'>new</span><span style='font-size:10.0pt;font-family:"Courier New";color:black;background:#F0F0F0;mso-fareast-language:EN-GB'> OpenLayers.Layer.WMS( </span><span style='font-size:10.0pt;font-family:"Courier New";color:maroon;background:#F0F0F0;mso-fareast-language:EN-GB'>"OpenLayers WMS"</span><span style='font-size:10.0pt;font-family:"Courier New";color:black;background:#F0F0F0;mso-fareast-language:EN-GB'>, </span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-GB'><o:p></o:p></span></p><p class=MsoNormal style='text-indent:-6.0pt;background:white'><span style='font-size:10.0pt;font-family:"Courier New";color:black;background:#F0F0F0;mso-fareast-language:EN-GB'>                                                   </span><span style='font-size:10.0pt;font-family:"Courier New";color:maroon;background:#F0F0F0;mso-fareast-language:EN-GB'>"<a href="http://expdev2/cgi-bin/wms?">http://expdev2/cgi-bin/wms?</a>"</span><span style='font-size:10.0pt;font-family:"Courier New";color:black;background:#F0F0F0;mso-fareast-language:EN-GB'>, <o:p></o:p></span></p><p class=MsoNormal style='text-indent:-6.0pt;background:white'><span style='font-size:10.0pt;font-family:"Courier New";color:black;background:#F0F0F0;mso-fareast-language:EN-GB'>                                                   {<o:p></o:p></span></p><p class=MsoNormal style='text-indent:-6.0pt;background:white'><span style='font-size:10.0pt;font-family:"Courier New";color:black;background:#F0F0F0;mso-fareast-language:EN-GB'>                                                     layers: </span><span style='font-size:10.0pt;font-family:"Courier New";color:maroon;background:#F0F0F0;mso-fareast-language:EN-GB'>'UK_ASRP_1to50000'</span><span style='font-size:10.0pt;font-family:"Courier New";color:black;background:#F0F0F0;mso-fareast-language:EN-GB'>,</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-GB'><o:p></o:p></span></p><p class=MsoNormal style='text-indent:-6.0pt;background:white'><span style='font-size:10.0pt;font-family:"Courier New";color:black;background:#F0F0F0;mso-fareast-language:EN-GB'>                                                     format: </span><span style='font-size:10.0pt;font-family:"Courier New";color:maroon;background:#F0F0F0;mso-fareast-language:EN-GB'>'image/png'</span><span style='font-size:10.0pt;font-family:"Courier New";color:black;background:#F0F0F0;mso-fareast-language:EN-GB'>,</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-GB'><o:p></o:p></span></p><p class=MsoNormal style='text-indent:-6.0pt;background:white'><span style='font-size:10.0pt;font-family:"Courier New";color:black;background:#F0F0F0;mso-fareast-language:EN-GB'>                                                     </span><span style='font-size:10.0pt;font-family:"Courier New";color:green;background:#F0F0F0;mso-fareast-language:EN-GB'>//transparent: 'true',</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-GB'><o:p></o:p></span></p><p class=MsoNormal style='text-indent:-6.0pt;background:white'><span style='font-size:10.0pt;font-family:"Courier New";color:black;background:#F0F0F0;mso-fareast-language:EN-GB'>                                                    continuousWorld: true,</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-GB'><o:p></o:p></span></p><p class=MsoNormal style='text-indent:-6.0pt;background:white'><span style='font-size:10.0pt;font-family:"Courier New";color:black;background:#F0F0F0;mso-fareast-language:EN-GB'>                                                     attribution: </span><span style='font-size:10.0pt;font-family:"Courier New";color:maroon;background:#F0F0F0;mso-fareast-language:EN-GB'>"OS 1:50K"</span><span style='font-size:10.0pt;font-family:"Courier New";color:black;background:#F0F0F0;mso-fareast-language:EN-GB'>,</span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-GB'><o:p></o:p></span></p><p class=MsoNormal style='text-indent:-6.0pt;background:white'><span style='font-size:10.0pt;font-family:"Courier New";color:black;background:#F0F0F0;mso-fareast-language:EN-GB'>                                                   }); </span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-GB'><o:p></o:p></span></p><pre style='text-indent:-6.0pt;background:white'><span style='color:black;background:#F0F0F0'>        map.addLayers([my50kLayer]);</span><o:p></o:p></pre><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>As the code exists above, the displayed map works fine (apart from the squished grid rectangles).  Having adapted the ‘measure example’ from the OpenLayers examples page, I can measure from the map, and if the geodesic selection is made, the measurements are clearly correct (1Km across both dimensions of the OS grid).  With geodesic selection not clicked, the measurement across the map is approximately 1.5Km.  So the transforms and projections are clearly in sync.  But how do I stretch the maps in the ‘y’ direction so they appear equant (not squished vertically)?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Adding the displayProjection seems to do nothing.  Using any of the other options with my WMS, results in a blank map.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I have also plagiarised the polar-projections example from the OpenLayers example site, and replace the buttons with the following projections:<o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>var projectionOptions = <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>    {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>        'EPSG:4326':<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>        {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>            projection: new OpenLayers.Projection('EPSG:4326')<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>        },<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>        'EPSG:3857':<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>        {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>            projection: new OpenLayers.Projection('EPSG:3857'),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>            maxExtent: new OpenLayers.Bounds(-5505054, -5505054, 5505054, 5505054),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>            maxResolution: 5505054 / 128,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>            numZoomLevels: 18<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>        }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>    }; // end projectionOptions array<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>And I have applied the projections as per the example code (i.e. setProjection function was copied and is being called).  However, pressing EPSG:3857 button results in a blank map, and pressing EPSG:4326 after that, also results in a blank map (albeit with a white pair of tiles in the middle)!<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>Can anyone tell me whether it is possible to display a square grid for OS maps coming from an EPSG:4326 WMS?<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>Thank you.<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><b><span style='font-family:"Arial","sans-serif";color:black;mso-fareast-language:EN-GB'>Gary Smart PhD</span></b><span style='font-family:"Arial","sans-serif";color:black;mso-fareast-language:EN-GB'> – Software Engineer – ISR Systems<o:p></o:p></span></p><p class=MsoNormal><b><span style='font-family:"Arial","sans-serif";color:black;mso-fareast-language:EN-GB'>UTC AEROSPACE SYSTEMS<o:p></o:p></span></b></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:black;mso-fareast-language:EN-GB'>Malvern Hills Science Park, Geraldine Road, Malvern, WR14 3SZ<o:p></o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:black;mso-fareast-language:EN-GB'>Tel:</span></b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:black;mso-fareast-language:EN-GB'> (+44) 1684 899783<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:black;mso-fareast-language:EN-GB'><a href="mailto:gary.smart@utas.utc.com"><span style='color:blue'>gary.smart@utas.utc.com</span></a> <a href="http://www.utcaerospacesystems.com/"><span style='color:blue'>www.utcaerospacesystems.com</span></a><o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-GB'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Arial","sans-serif";color:black;mso-fareast-language:EN-GB'>CONFIDENTIALITY WARNING: This message may contain proprietary and/or privileged information of UTC Aerospace Systems and its affiliated companies. If you are not the intended recipient please 1) do not disclose, copy, distribute or use this message or its contents, 2) advise the sender by return e-mail, and 3) delete all copies (including all attachments) from your computer. Your co-operation is greatly appreciated.<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>