<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=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 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:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
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
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
code
{mso-style-priority:99;
font-family:"Courier New";}
pre
{mso-style-priority:99;
mso-style-link:"HTML-esimuotoiltu Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.HTML-esimuotoiltuChar
{mso-style-name:"HTML-esimuotoiltu Char";
mso-style-priority:99;
mso-style-link:HTML-esimuotoiltu;
font-family:Consolas;
mso-fareast-language:FI;}
span.Shkpostityyli23
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 2.0cm 70.85pt 2.0cm;}
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="FI" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US">Don’t use mode=map because you want to read Mapserver as WMS. Make just a plain WMS layer like in view-source:http://dev.openlayers.org/examples/wms.html.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US">-Jukka Rahkonen-<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Neelesh Nirmal wrote:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.5pt;font-family:"Arial","sans-serif"">I have created a map using OpenLayers3 which contains two layers. First layer is Open Street Map Layer and the second one is
</span><span style="font-size:11.5pt;font-family:"Arial","sans-serif"">WMS layer provided by the Map Server.</span><o:p></o:p></p>
<div>
<p class="MsoNormal"><b><span style="font-size:11.5pt;font-family:"Arial","sans-serif"">Problem-</span></b><span style="font-size:11.5pt;font-family:"Arial","sans-serif"">When i'm rendering first layer it is rendering properly no issue. but when i'm rendering
the second layer(provide by map server) it renders incorrectly means it does not fit to its container and it is out of sync with the first layer in terms of location. See </span><span style="font-size:9.5pt"><a href="http://i.stack.imgur.com/Ac8xR.png" target="_blank"><span style="font-size:11.5pt;font-family:"Arial","sans-serif";color:#0C65A5">this
snapshot</span></a></span><span style="font-size:11.5pt;font-family:"Arial","sans-serif""> of the maps for more clarification. In the snapshot top layer is wms layer provided by map server.</span><span style="font-size:9.5pt"><o:p></o:p></span></p>
</div>
<p><span style="font-size:9.5pt"><a href="http://i.stack.imgur.com/Ac8xR.png" target="_blank"><span style="border:solid windowtext 1.0pt;padding:0cm;text-decoration:none"><img border="0" width="320" height="180" id="_x0000_i1025" src="cid:image001.jpg@01D1214F.8E861560" alt="Lähettäjä poisti kuvan."></span></a><o:p></o:p></span></p>
<p><span style="font-size:9.5pt"><o:p> </o:p></span></p>
<p style="line-height:14.65pt"><span style="font-size:11.5pt;font-family:"Arial","sans-serif"">Also when i'm zooming or moving the map then both layers work correctly but after a delay of few seconds the second layer(wms layer from map server) again switches
back to its initial position(Position that is shown in above attached snapshot).<o:p></o:p></span></p>
<p style="line-height:14.65pt"><span style="font-size:11.5pt;font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p style="line-height:14.65pt"><span style="font-size:11.5pt;font-family:"Arial","sans-serif"">This is the code that i'm using to consume wms service.<o:p></o:p></span></p>
<p style="line-height:14.65pt"><span style="font-size:11.5pt;font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<pre style="background:#EEEEEE;white-space:pre-wrap;max-height:600px;word-wrap:normal;overflow:auto"><code><span style="font-family:Consolas;color:darkblue">var</span></code><code><span style="font-family:Consolas;color:black"> layer = </span></code><code><span style="font-family:Consolas;color:darkblue">new</span></code><code><span style="font-family:Consolas;color:black"> ol.layer.</span></code><code><span style="font-family:Consolas;color:#2B91AF">Image</span></code><code><span style="font-family:Consolas;color:black">({<o:p></o:p></span></code></pre>
<pre style="background:#EEEEEE"><code><span style="font-family:Consolas;color:black"> source: </span></code><code><span style="font-family:Consolas;color:darkblue">new</span></code><code><span style="font-family:Consolas;color:black"> ol.source.</span></code><code><span style="font-family:Consolas;color:#2B91AF">ImageWMS</span></code><code><span style="font-family:Consolas;color:black">({<o:p></o:p></span></code></pre>
<pre style="background:#EEEEEE"><code><span style="font-family:Consolas;color:black"> url: </span></code><code><span style="font-family:Consolas;color:maroon">'<a href="http://localhost:19090/rasters/world/wms" target="_blank">http://localhost:19090/rasters/world/wms</a>'</span></code><code><span style="font-family:Consolas;color:black">,<o:p></o:p></span></code></pre>
<pre style="background:#EEEEEE"><code><span style="font-family:Consolas;color:black"> </span></code><code><span style="font-family:Consolas;color:darkblue">params</span></code><code><span style="font-family:Consolas;color:black">: {<o:p></o:p></span></code></pre>
<pre style="background:#EEEEEE"><code><span style="font-family:Consolas;color:black"> </span></code><code><span style="font-family:Consolas;color:maroon">'LAYERS'</span></code><code><span style="font-family:Consolas;color:black">: </span></code><code><span style="font-family:Consolas;color:maroon">'world'</span></code><code><span style="font-family:Consolas;color:black">,<o:p></o:p></span></code></pre>
<pre style="background:#EEEEEE"><code><span style="font-family:Consolas;color:black"> </span></code><code><span style="font-family:Consolas;color:maroon">'mode'</span></code><code><span style="font-family:Consolas;color:black">: </span></code><code><span style="font-family:Consolas;color:maroon">'map'</span></code><code><span style="font-family:Consolas;color:black">,<o:p></o:p></span></code></pre>
<pre style="background:#EEEEEE"><code><span style="font-family:Consolas;color:black"> },<o:p></o:p></span></code></pre>
<pre style="background:#EEEEEE"><code><span style="font-family:Consolas;color:black"> serverType: </span></code><code><span style="font-family:Consolas;color:maroon">'mapserver'</span></code><code><span style="font-family:Consolas;color:black"><o:p></o:p></span></code></pre>
<pre style="background:#EEEEEE"><code><span style="font-family:Consolas;color:black"> })<o:p></o:p></span></code></pre>
<pre style="background:#EEEEEE"><code><span style="font-family:Consolas;color:black">});</span></code><span style="font-size:9.5pt;font-family:Consolas;color:#393318"><o:p></o:p></span></pre>
<p style="line-height:14.65pt"><span style="font-size:11.5pt;font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p style="line-height:14.65pt"><span style="font-size:11.5pt;font-family:"Arial","sans-serif""><a href="http://pastebin.com/AWWWyBLE" target="_blank"><span style="color:#0C65A5">This</span></a> is my map file.<o:p></o:p></span></p>
<p style="line-height:14.65pt"><span style="font-size:11.5pt;font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<pre style="background:#EEEEEE;white-space:pre-wrap;max-height:600px;word-wrap:normal;overflow:auto"><span style="font-size:9.5pt;font-family:Consolas"> MAP<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> NAME "world"<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> CONFIG "MS_ERRORFILE" "/home/neelesh/Projects/georbis/data/logs/mapservice_errors.log"<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> CONFIG "PROJ_LIB" "/home/neelesh/Projects/georbis/deps/proj.4-master/share/proj"<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> CONFIG "ON_MISSING_DATA" "LOG"<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> DEBUG 5<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> EXTENT -180.000 -90.000 180.000 90.000<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> SHAPEPATH "/home/neelesh/Projects/georbis/data/service_data/data/wms"<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> IMAGECOLOR 255 255 255<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> SIZE 1350 675<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"><o:p> </o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> WEB<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> METADATA<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> "wms_title" "Georbis WMS Server"<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> "wms_author" "VizExperts"<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> "wms_onlineresource" "<a href="http://192.168.1.36:19090/rasters/world/wms" target="_blank">http://192.168.1.36:19090/rasters/world/wms</a>?"<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> "wms_enable_request" "*"<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> "wms_srs" "epsg:4326"<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> "wms_feature_info_mime_type" "text/html"<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> "wms_format" "image/jpg"<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> END<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> END<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"><o:p> </o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> PROJECTION<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> "init=epsg:4326"<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> END<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"><o:p> </o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> LAYER<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> NAME world<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> TYPE RASTER<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> DATA "world.tif"<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> METADATA<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> "wms_title" "BlueWorld Map"<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> "wms_srs" "epsg:4326"<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> "wms_server_version" "1.1.1"<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> END<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> PROJECTION<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> "init=epsg:4326"<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> END<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas"> END<o:p></o:p></span></pre>
<pre style="background:#EEEEEE"><span style="font-size:9.5pt;font-family:Consolas">END<o:p></o:p></span></pre>
<p style="line-height:14.65pt"><span style="font-size:11.5pt;font-family:"Arial","sans-serif""><br>
I tried <em><b><span style="font-family:"Arial","sans-serif"">ol.view.fit</span></b></em> method to fit the layer to its container but the value of <em><b><span style="font-family:"Arial","sans-serif"">layer.getExtent()</span></b></em> for the layer is undefined.<o:p></o:p></span></p>
<p style="line-height:14.65pt"><span style="font-size:11.5pt;font-family:"Arial","sans-serif"">Also layers are rendering perfectly in QGIS and when i'm using the same layer from geoserver instead of mapserver again it is working fine.<br>
<a href="http://stackoverflow.com/questions/33539777/wms-layer-provide-by-map-sever-rendering-incorrectly-in-ol3" target="_blank">This</a> is link to my stackoverflow post.<o:p></o:p></span></p>
<p style="line-height:14.65pt"><span style="font-size:11.5pt;font-family:"Arial","sans-serif"">Pleas help me to find out what is wrong. is there any problem with wms request format or the map file?<o:p></o:p></span></p>
</div>
</div>
</body>
</html>