<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=iso-8859-1">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
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;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.5pt;
        font-family:Consolas;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:Consolas;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</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 bgcolor=white lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Hello Attila,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I posted the item below to the OpenLayers forum regarding a
similar problem.  As noted in the posting, if the overlay is not visible by
default the initial placement of the layer is off.  However, any map move that
fetches the data again fixes the problem.  I have received no answers to the
posting nor have I figured it out myself yet.  This posting includes the map
file and the OpenLayers example.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>In addition to what is in the posting below, you need to include
the Google projection (900913) definition in the PROJ4 data file.  Information
on that can be found  at this posting:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>                <a
href="http://lists.osgeo.org/pipermail/mapserver-users/2008-August/057291.html">http://lists.osgeo.org/pipermail/mapserver-users/2008-August/057291.html</a><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>If you are using PostGIS, you will need to do both items 1 and  2. 
If you are not using PostGIS, then I believe you only need item 1.  Also,
thanks to Paul Ramsey, if you add the Google projection definition to the top
of the PROJ4 epsg file (as well as the definitions of the other
projections/coordinate systems you are using) MapServer will make your map
faster.  (Thanks Paul, this make a perceptible difference!).<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I hope this helps,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Best regards,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>-Linc<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoPlainText>--- OpenLayers Posting ---<o:p></o:p></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoPlainText>Using an overlay layer projected by MS
(OpenLayer.MapServer object) to Google (and Virtual Earth, EPSG 900913), if the
overlay layer is initially visible (visibility: true) then the overlay layer is
correctly placed.  If the initial visibility is false, then upon the first
fetch of the layer, it is NOT correctly placed.  However, any subsequent map
navigation that causes a fetch of the data correctly places the overlay layer. 
This behavior is consistent using the layer switcher control and manually
turning the layer on and off (not including the layer switcher control).<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>The relevant portions of code are below.  Sorry it is a
bit long, but it is needed for completeness.<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>Hopefully this is a newbie error on my part.  <o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>Any ideas?<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>Thanks,<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>-Linc<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>MS Map File Fragment...<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>  PROJECTION<o:p></o:p></p>

<p class=MsoPlainText>            &quot;init=epsg:900913&quot;  #Google<o:p></o:p></p>

<p class=MsoPlainText>  END #end projection<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>  LAYER<o:p></o:p></p>

<p class=MsoPlainText>            NAME &quot;senate&quot;<o:p></o:p></p>

<p class=MsoPlainText>            connectiontype postgis<o:p></o:p></p>

<p class=MsoPlainText>            connection &quot;user=xxxx password=xxxx
dbname=xxxx host=xxxx port=xxxx&quot;<o:p></o:p></p>

<p class=MsoPlainText>            data &quot;geom from s17s0036_shapes&quot;<o:p></o:p></p>

<p class=MsoPlainText>            PROJECTION<o:p></o:p></p>

<p class=MsoPlainText>                  &quot;init=epsg:4269&quot;<o:p></o:p></p>

<p class=MsoPlainText>            END #end projection<o:p></o:p></p>

<p class=MsoPlainText>            TYPE polygon<o:p></o:p></p>

<p class=MsoPlainText>            STATUS OFF<o:p></o:p></p>

<p class=MsoPlainText>            CLASS<o:p></o:p></p>

<p class=MsoPlainText>                  STYLE<o:p></o:p></p>

<p class=MsoPlainText>                        OUTLINECOLOR 0 255 0<o:p></o:p></p>

<p class=MsoPlainText>                        WIDTH 3<o:p></o:p></p>

<p class=MsoPlainText>                  END #end style<o:p></o:p></p>

<p class=MsoPlainText>            END #end class<o:p></o:p></p>

<p class=MsoPlainText>  END #end layer<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>  LAYER<o:p></o:p></p>

<p class=MsoPlainText>            NAME &quot;senate_go&quot;<o:p></o:p></p>

<p class=MsoPlainText>            connectiontype postgis<o:p></o:p></p>

<p class=MsoPlainText>            connection &quot;user=xxx password=xxx
dbname=xxx host=xxx port=xxx&quot;<o:p></o:p></p>

<p class=MsoPlainText>            data &quot;geom from s17s0036_go&quot;<o:p></o:p></p>

<p class=MsoPlainText>            PROJECTION<o:p></o:p></p>

<p class=MsoPlainText>                  &quot;init=epsg:900913&quot;<o:p></o:p></p>

<p class=MsoPlainText>            END #end projection<o:p></o:p></p>

<p class=MsoPlainText>            TYPE polygon<o:p></o:p></p>

<p class=MsoPlainText>            STATUS OFF<o:p></o:p></p>

<p class=MsoPlainText>            #MINSCALE 7000000<o:p></o:p></p>

<p class=MsoPlainText>            CLASS<o:p></o:p></p>

<p class=MsoPlainText>                  STYLE<o:p></o:p></p>

<p class=MsoPlainText>                        OUTLINECOLOR 255 0 0<o:p></o:p></p>

<p class=MsoPlainText>                        WIDTH 3<o:p></o:p></p>

<p class=MsoPlainText>                  END #end style<o:p></o:p></p>

<p class=MsoPlainText>            END #end class<o:p></o:p></p>

<p class=MsoPlainText>  END #end layer<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>900913 projection defined to PROJ4 and PostGIS per Subha
Ramakrishnan's MapServer posting of last week.<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>I used the OpenLayers Google Overlay example.  I&#8217;m
a newbie so it's not real pretty....  In this code, I was trying to see if the
layer switcher control was the issue so I did not include it and manually
toggled layer visibility.<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>    &lt;script type=&quot;text/javascript&quot;&gt;<o:p></o:p></p>

<p class=MsoPlainText>        var map;<o:p></o:p></p>

<p class=MsoPlainText>                        var senate;<o:p></o:p></p>

<p class=MsoPlainText>                        var senate_go;<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>        function init() {<o:p></o:p></p>

<p class=MsoPlainText>                              <o:p></o:p></p>

<p class=MsoPlainText>                              map = new
OpenLayers.Map('map', <o:p></o:p></p>

<p class=MsoPlainText>                                    {});<o:p></o:p></p>

<p class=MsoPlainText>                                          <o:p></o:p></p>

<p class=MsoPlainText>                              var gmap_r = new
OpenLayers.Layer.Google(&quot;Google Streets&quot;,<o:p></o:p></p>

<p class=MsoPlainText>                                          {projection:
&quot;EPSG:900913&quot;}<o:p></o:p></p>

<p class=MsoPlainText>                                          );<o:p></o:p></p>

<p class=MsoPlainText>                              <o:p></o:p></p>

<p class=MsoPlainText>                              senate_go = new
OpenLayers.Layer.MapServer( &quot;State Senate Google&quot;,<o:p></o:p></p>

<p class=MsoPlainText>                                    &quot;<a
href="http://xxx/cgi-bin/mywms.exe">http://xxx/cgi-bin/mywms.exe</a>&quot;,
{map: 'wms_senate_go.map', layers: 'senate_go',<o:p></o:p></p>

<p class=MsoPlainText>                                    transparent: true,
sphericalMercator: true<o:p></o:p></p>

<p class=MsoPlainText>                                    }, <o:p></o:p></p>

<p class=MsoPlainText>                                    { visibility: true,
singleTile: true, opacity: 0.5 } );<o:p></o:p></p>

<p class=MsoPlainText>                              <o:p></o:p></p>

<p class=MsoPlainText>                              senate = new
OpenLayers.Layer.MapServer( &quot;State Senate&quot;,<o:p></o:p></p>

<p class=MsoPlainText>                                    &quot;<a
href="http://xxx/cgi-bin/mywms.exe">http://xxx/cgi-bin/mywms.exe</a>&quot;,
{map: 'wms_senate_go.map', layers: 'senate',<o:p></o:p></p>

<p class=MsoPlainText>                                    transparent: true,
sphericalMercator: true<o:p></o:p></p>

<p class=MsoPlainText>                                    }, <o:p></o:p></p>

<p class=MsoPlainText>                                    { visibility: true,
singleTile: true, opacity: 0.5 } );<o:p></o:p></p>

<p class=MsoPlainText>                                    <o:p></o:p></p>

<p class=MsoPlainText>           map.addLayers([gmap_r]);<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>                              map.zoomToExtent(new
OpenLayers.Bounds(-87.6, 24.3, -79.8, 31.1));<o:p></o:p></p>

<p class=MsoPlainText>                              <o:p></o:p></p>

<p class=MsoPlainText>                              document.getElementById('cb_senate').checked
= false;<o:p></o:p></p>

<p class=MsoPlainText>                              document.getElementById('cb_senate_go').checked
= false;<o:p></o:p></p>

<p class=MsoPlainText>        }<o:p></o:p></p>

<p class=MsoPlainText>                        <o:p></o:p></p>

<p class=MsoPlainText>                        function toggleLayer(layer) {<o:p></o:p></p>

<p class=MsoPlainText>                              if (layer == 'senate') {<o:p></o:p></p>

<p class=MsoPlainText>                                    if
(document.getElementById('cb_senate').checked) {map.addLayer(senate)}<o:p></o:p></p>

<p class=MsoPlainText>                                    else
{map.removeLayer(senate)}<o:p></o:p></p>

<p class=MsoPlainText>                              }<o:p></o:p></p>

<p class=MsoPlainText>                              else<o:p></o:p></p>

<p class=MsoPlainText>                                    if
(document.getElementById('cb_senate_go').checked) {map.addLayer(senate_go)}<o:p></o:p></p>

<p class=MsoPlainText>                                    else
{map.removeLayer(senate_go)}<o:p></o:p></p>

<p class=MsoPlainText>                        }<o:p></o:p></p>

<p class=MsoPlainText>    &lt;/script&gt;<o:p></o:p></p>

<p class=MsoPlainText>  &lt;/head&gt;<o:p></o:p></p>

<p class=MsoPlainText>  &lt;body onload=&quot;init()&quot;&gt;<o:p></o:p></p>

<p class=MsoPlainText>    &lt;h1 id=&quot;title&quot;&gt;OpenLayers Google
Example&lt;/h1&gt;<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>    &lt;div id=&quot;tags&quot;&gt;&lt;/div&gt;<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>    &lt;p&gt;<o:p></o:p></p>

<p class=MsoPlainText>        &lt;input id=&quot;cb_senate&quot;
type=&quot;checkbox&quot; value=&quot;senate&quot;
onclick=&quot;toggleLayer(this.value)&quot; /&gt; Senate (EPSG:4269) &lt;br&gt;<o:p></o:p></p>

<p class=MsoPlainText>        &lt;input id=&quot;cb_senate_go&quot;
type=&quot;checkbox&quot; value=&quot;senate_go&quot;
onclick=&quot;toggleLayer(this.value)&quot; /&gt; Senate (EPSG:900913)
&lt;br&gt;<o:p></o:p></p>

<p class=MsoPlainText>    &lt;/p&gt;<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>    &lt;div id=&quot;map&quot;&gt;&lt;/div&gt;<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>  &lt;/body&gt;<o:p></o:p></p>

<p class=MsoPlainText>&lt;/html&gt;<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:
"Tahoma","sans-serif";color:windowtext'>
mapserver-users-bounces@lists.osgeo.org
[mailto:mapserver-users-bounces@lists.osgeo.org] <b>On Behalf Of </b>Berényi
Attila<br>
<b>Sent:</b> Friday, August 29, 2008 9:21 AM<br>
<b>To:</b> _mapserver<br>
<b>Subject:</b> [mapserver-users] reprojection<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Dear
All,<br>
<br>
I have a lot of data in epsg:23700 (HD-72 EOV), and I try to display it as an
overlay over Google Map (epsg:900913) in Openlayers trough WMS. Theoretically
it is possible to do this but I have no success at all...Which projection
should I define in tha main MAP part? And in the LAYER part?<br>
Have anybody done something like this before? If yes, please help me.<br>
<br>
Thanks in advance,<br>
<br>
Attila Berényi</span> <o:p></o:p></p>

</div>

</body>

</html>