<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;"><div>Neelesh,</div><div><br></div><div>You need to set your map projection to match your basemap. You need to set it to spherical mercator.</div><div><br></div><div><pre style="white-space: pre-wrap; font-size: 12.8px; padding: 5px; overflow: auto; width: auto; max-height: 600px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; word-wrap: normal; background-color: rgb(238, 238, 238);"> PROJECTION
"init=epsg:3857"
END</pre></div><div><br></div><div>Mike</div><div><br></div><div><div><div><div>----</div><div>Michael Smith</div></div><div>US Army Corps</div><div>Remote Sensing GIS/Center</div><div>michael.smith@usace.army.mil</div><div><br></div></div></div><span id="OLK_SRC_BODY_SECTION"><div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style="font-weight:bold">From: </span> mapserver-users <<a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a>> on behalf of Neelesh Nirmal <<a href="mailto:neelesh.iiita@gmail.com">neelesh.iiita@gmail.com</a>><br><span style="font-weight:bold">Date: </span> Tuesday, November 17, 2015 at 5:37 AM<br><span style="font-weight:bold">To: </span> <<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>><br><span style="font-weight:bold">Subject: </span> [mapserver-users] WMS Layer provided by MapSever rendering incorrectly in ol3.<br></div><div><br></div><blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;"><div dir="ltr"><span style="font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; line-height: 19.5px;">I have created a map using OpenLayers3 which contains two layers. First layer is Open Street Map Layer and the second one is WMS layer provided by the Map Server.</span><br style="font-size:12.8px"><div style="font-size:12.8px"><font face="Arial,Helvetica Neue,Helvetica,sans-serif"><span style="font-size:15px;line-height:19.5px"><b>Problem-</b></span></font><span style="font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; line-height: 19.5px;">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><a href="http://i.stack.imgur.com/Ac8xR.png" rel="nofollow" target="_blank" style="color:rgb(12,101,165);font-size:15px;font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.5px">this snapshot</a><span style="font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; line-height: 19.5px;"> of the maps for more clarification. In the snapshot top layer is wms layer provided by map server.</span></div><p style="font-size:12.8px;clear:both"><a href="http://i.stack.imgur.com/Ac8xR.png" target="_blank" style="margin-left:1em;margin-right:1em"><img src="http://i.stack.imgur.com/Ac8xR.png" border="0" width="320" height="180" class=""></a></p><p style="font-size:12.8px;clear:both"><br></p><p style="font-size:15px;clear:both;font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.5px">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).</p><p style="font-size:15px;clear:both;font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.5px"><br></p><p style="font-size:15px;clear:both;font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.5px">This is the code that i'm using to consume wms service.</p><p style="font-size:15px;clear:both;font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.5px"><br></p><pre style="white-space:pre-wrap;font-size:12.8px;padding:5px;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;color:rgb(57,51,24);word-wrap:normal;background-color:rgb(238,238,238)"><code style="font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit"><span style="color:rgb(0,0,139)">var</span><span style="color:rgb(0,0,0)"> layer </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(0,0,139)">new</span><span style="color:rgb(0,0,0)"> ol</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(0,0,0)">layer</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(43,145,175)">Image</span><span style="color:rgb(0,0,0)">({</span><span style="color:rgb(0,0,0)">
source</span><span style="color:rgb(0,0,0)">:</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(0,0,139)">new</span><span style="color:rgb(0,0,0)"> ol</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(0,0,0)">source</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(43,145,175)">ImageWMS</span><span style="color:rgb(0,0,0)">({</span><span style="color:rgb(0,0,0)">
url</span><span style="color:rgb(0,0,0)">:</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(128,0,0)">'<a href="http://localhost:19090/rasters/world/wms" target="_blank">http://localhost:19090/rasters/world/wms</a>'</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,0)">
</span><span style="color:rgb(0,0,139)">params</span><span style="color:rgb(0,0,0)">:</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(0,0,0)">{</span><span style="color:rgb(0,0,0)">
</span><span style="color:rgb(128,0,0)">'LAYERS'</span><span style="color:rgb(0,0,0)">:</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(128,0,0)">'world'</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,0)">
</span><span style="color:rgb(128,0,0)">'mode'</span><span style="color:rgb(0,0,0)">:</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(128,0,0)">'map'</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,0)">
</span><span style="color:rgb(0,0,0)">},</span><span style="color:rgb(0,0,0)">
serverType</span><span style="color:rgb(0,0,0)">:</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(128,0,0)">'mapserver'</span><span style="color:rgb(0,0,0)">
</span><span style="color:rgb(0,0,0)">})</span><span style="color:rgb(0,0,0)"></span><span style="color:rgb(0,0,0)">});</span></code></pre><div style="font-size:12.8px;border:1px solid rgb(187,187,187);word-wrap:break-word;background-color:rgb(250,250,250)"><code><div></div></code></div><p style="font-size:15px;clear:both;font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.5px"><br></p><p style="font-size:15px;clear:both;font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.5px"><a href="http://pastebin.com/AWWWyBLE" rel="nofollow" target="_blank" style="color:rgb(12,101,165)">This</a> is my map file.</p><p style="font-size:15px;clear:both;font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.5px"><br></p><pre style="white-space:pre-wrap;font-size:12.8px;padding:5px;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;word-wrap:normal;background-color:rgb(238,238,238)"> MAP
NAME "world"
CONFIG "MS_ERRORFILE" "/home/neelesh/Projects/georbis/data/logs/mapservice_errors.log"
CONFIG "PROJ_LIB" "/home/neelesh/Projects/georbis/deps/proj.4-master/share/proj"
CONFIG "ON_MISSING_DATA" "LOG"
DEBUG 5
EXTENT -180.000 -90.000 180.000 90.000
SHAPEPATH "/home/neelesh/Projects/georbis/data/service_data/data/wms"
IMAGECOLOR 255 255 255
SIZE 1350 675
WEB
METADATA
"wms_title" "Georbis WMS Server"
"wms_author" "VizExperts"
"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>?"
"wms_enable_request" "*"
"wms_srs" "epsg:4326"
"wms_feature_info_mime_type" "text/html"
"wms_format" "image/jpg"
END
END
PROJECTION
"init=epsg:4326"
END
LAYER
NAME world
TYPE RASTER
DATA "world.tif"
METADATA
"wms_title" "BlueWorld Map"
"wms_srs" "epsg:4326"
"wms_server_version" "1.1.1"
END
PROJECTION
"init=epsg:4326"
END
END
END</pre><div style="font-size:12.8px;border:1px solid rgb(187,187,187);word-wrap:break-word;background-color:rgb(250,250,250)"><code><div></div></code></div><p style="font-size:15px;clear:both;font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.5px"><br>I tried <strong><em>ol.view.fit</em></strong> method to fit the layer to its container but the value of <strong><em>layer.getExtent()</em></strong> for the layer is undefined.</p><p style="font-size:15px;clear:both;font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.5px">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.</p><p style="font-size:15px;clear:both;font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.5px">Pleas help me to find out what is wrong. is there any problem with wms request format or the map file?</p></div>
_______________________________________________
mapserver-users mailing list
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a></blockquote></span></body></html>