<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Very very thanks. <br>It worked fine.<br>but one strange point: Why they don't easily compute this maxRsolution in their lib using with of map element (instead of supposing all map elements to be in 256*256 size)?<br>Anyway, your helpful point is totally appreciated. <br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Arnd Wippermann <arnd.wippermann@web.de><br><b><span style="font-weight: bold;">To:</span></b> Saka Royban <sakaroyban@yahoo.com><br><b><span style="font-weight: bold;">Cc:</span></b> users@openlayers.org<br><b><span style="font-weight:
bold;">Sent:</span></b> Thu, June 9, 2011 1:59:10 AM<br><b><span style="font-weight: bold;">Subject:</span></b> AW: [mapserver-users] Problem in extent using openlayers withMapserver<br></font><br>
<meta http-equiv="x-dns-prefetch-control" content="off">
<style type="text/css">DIV {
MARGIN:0px;}
</style>
<div dir="ltr" align="left"><span class="358181521-08062011"><font color="#0000ff" face="Arial" size="2">when you request MapServer via Url, then Mapserver delivers
the image as defined by the mapfile (extent, imagesize) => resolution =
0.45.</font></span></div>
<div dir="ltr" align="left"><span class="358181521-08062011"><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span class="358181521-08062011"><font color="#0000ff" face="Arial" size="2">If you request MapServer via OpenLayers.WMS, then the
mapoptions are the point. By default is the maxResolution = 1.40625 and the
other resolutions are maxResolution/2^zoom. (1.40625 , 0.703125, 0.3515625,
...)</font></span></div>
<div dir="ltr" align="left"><span class="358181521-08062011"><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div>map.zoomToMaxExtent() uses the re<span class="358181521-08062011">s</span>olution = <font face="Arial">0.703125, because that is the best resolution to display maxExtent (-180,-90,180,90). For the next resolution the map would not display in whole.</font></div>
<div><font face="Arial"><font color="#0000ff"><font size="2"></font></font></font> </div>
<div><font face="Arial"><font color="#0000ff"><font size="2">Y<span class="358181521-08062011">ou can set maxResolution=0.45 in the mapoptions.
Then the layer should fill the whole map.</span></font></font></font></div>
<div><font face="Arial"><font color="#0000ff"><font size="2"><span class="358181521-08062011"></span></font></font></font> </div>
<div><font face="Arial"><font color="#0000ff"><font size="2"><span class="358181521-08062011">Arnd</span></font></font></font></div>
<div><br><br></div>
<div dir="ltr" class="OutlookMessageHeader" align="left" lang="de">
<hr tabindex="-1">
<font face="Tahoma" size="2"><b>Von:</b> mapserver-users-bounces@lists.osgeo.org
[mailto:mapserver-users-bounces@lists.osgeo.org] <b>Im Auftrag von </b>Saka
Royban<br><b>Gesendet:</b> Mittwoch, 8. Juni 2011 15:10<br><b>An:</b>
MapServer<br><b>Betreff:</b> Re: [mapserver-users] Problem in extent using
openlayers withMapserver<br></font><br></div>
<div></div>
<div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
<div><br></div>
<div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br>
<div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Tahoma" size="2">----- Forwarded Message ----<br><b><span style="font-weight: bold;">From:</span></b> Saka Royban
<sakaroyban@yahoo.com><br><b><span style="font-weight: bold;">To:</span></b> Stephen Woodbridge
<woodbri@swoodbridge.com><br><b><span style="font-weight: bold;">Sent:</span></b> Wed, June 8, 2011 5:38:17
PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re:
[mapserver-users] Problem in extent using openlayers with
Mapserver<br></font><br>
<div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
<div>Thanks stephen for ur help (and sorry for bit abit latency in
reply)<br>I've already tried that, i.e. constructing map object without any
argument but no result.<br>In fact, in first step i created map without any
extra argument and faced that problem and after that i added some arguments to
maybe solve the problem.<br>Any idea now?<br></div>
<div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br>
<div style="font-family: arial,helvetica,sans-serif; font-size: 13px;"><font face="Tahoma" size="2">
<hr size="1">
<b><span style="font-weight: bold;">From:</span></b> Stephen Woodbridge
<woodbri@swoodbridge.com><br><b><span style="font-weight: bold;">To:</span></b>
mapserver-users@lists.osgeo.org<br><b><span style="font-weight: bold;">Sent:</span></b> Sat, June 4, 2011 10:04:29
PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re:
[mapserver-users] Problem in extent using openlayers with
Mapserver<br></font><br>try just using:<br><br>map = new OpenLayers.Map( 'map'
);<br><br>-Steve<br><br>On 6/4/2011 1:21 PM, Saka Royban wrote:<br>> Hi
all.<br>> I've really got stuck in this problem and need some help as i'm a
newbie<br>> using openlayers with mapserver.<br>> In mapfile i've set
output to be:<br>> EXTENT -180 -90 180 90 # Geographic<br>> SIZE 800
400<br>> IMAGECOLOR 128 128 255<br>><br>> when i request mapserver
through URL, i recieve a complete 800*400<br>> image, but when i use
openlayers i get a 800*400 image which original<br>> map fills 512*256 of the
center and other pixels are filled with IMAGECOLOR.<br>> this is my
code:<br>> map = new OpenLayers.Map( 'map',{'tileSize': new<br>>
OpenLayers.Size(400,400)} );<br>> layer = new OpenLayers.Layer.MapServer(
"World Map",<br><span><span><span>> "<a target="_blank" href="http://localhost/cgi-bin/mapserv.exe">http://localhost/cgi-bin/mapserv.exe</a>",
{map:</span></span></span><br>> '/ms4w/apps/ms101/htdocs/ms101.map',layers:
'world_poly', height: 400,<br>> width: 800}, {singleTile: true}
);<br>><br>> map.addLayer(layer);<br>>
map.zoomToMaxExtent();<br>><br>> I asked this question in openlayers
mailing list with no success. It<br>> sounds it is related to
mapserver.<br>> Any help would be greatly appreciated<br>><br>> Regards
(also sorry if my english is not very good)<br>><br>><br>><br>>
_______________________________________________<br>> mapserver-users mailing
list<br>> <a rel="nofollow" ymailto="mailto:mapserver-users@lists.osgeo.org" target="_blank" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br><span><span><span>>
<a target="_blank" href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a></span></span></span><br><br>_______________________________________________<br>mapserver-users
mailing list<br><a rel="nofollow" ymailto="mailto:mapserver-users@lists.osgeo.org" target="_blank" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br><a rel="nofollow" target="_blank" href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br></div></div></div>
</div></div></div><meta http-equiv="x-dns-prefetch-control" content="on"></div></div>
</div></body></html>