<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=843370322-09092009><FONT face=Arial
color=#0000ff size=2>Hi Paul,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843370322-09092009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=843370322-09092009><FONT face=Arial
color=#0000ff size=2>by default OpenLayers use EPSG:4326 for the map, if not
otherwise declared. The extent for the whole world are -180,-90,180,90 with a
resolution of 1.40. From your extent it seems, you want an other projection. So
you have to declare the projection in the map options.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843370322-09092009></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=843370322-09092009><FONT face=Arial
color=#0000ff size=2>Arnd</FONT> </SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843370322-09092009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left>
<HR tabIndex=-1>
</DIV>
<DIV dir=ltr align=left><FONT face=Tahoma size=2><B>Von:</B>
users-bounces@openlayers.org [mailto:users-bounces@openlayers.org] <B>Im Auftrag
von </B>Paul Curran<BR><B>Gesendet:</B> Mittwoch, 9. September 2009
22:20<BR><B>An:</B> Alexandre Dube<BR><B>Cc:</B>
users@openlayers.org<BR><B>Betreff:</B> Re: [OpenLayers-Users] Call Mapfile
layer with Openlayers whenstatus ON or OFF<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>Thanks for your responses</DIV>
<DIV> </DIV>
<DIV>I have now removed the map parameter as suggested. I am just trying to
display one layer correctly and i will then add my second layer when my
single layer looks right. </DIV>
<DIV> </DIV>
<DIV>My layer is now displaying tiled across the screen several times and
quite zoomed out, i cannot zoom in or out</DIV>
<DIV> </DIV>
<DIV>My code now looks as follows:</DIV>
<DIV> </DIV>
<DIV> var bounds = new OpenLayers.Bounds(0, 0,
660046, 1229782);<BR> var map, layer1,
layer2;<BR> var options = { maxExtent: bounds,
maxResolution: 600, numZoomLevels: 10};</DIV>
<DIV> <BR>
<BR> function
init(){<BR> map = new
OpenLayers.Map('map', options);</DIV>
<DIV> layer1 = new
OpenLayers.Layer.WMS("OpenLayers WMS",<BR> "<A
href="http://localhost/cgi-bin/mapserv.exe?mode=map&map=c:/ms4w/apps/openlayers-2.5/data/uk2.map">http://localhost/cgi-bin/mapserv.exe?mode=map&map=c:/ms4w/apps/openlayers-2.5/data/uk2.map</A>",
{ layers: "250" },<BR> { gutter: 15, minZoomLevel:
1, maxZoomLevel: 4 });</DIV>
<DIV>
map.addLayer(layer1);<BR>
<BR>
map.zoomToExtent(bounds);<BR>
map.setCenter(bounds);<BR>
map.zoomToMaxExtent();</DIV>
<DIV> map.addControl(new
OpenLayers.Control.PanZoomBar());<BR>
map.addControl(new
OpenLayers.Control.MousePosition());<BR> }</DIV>
<DIV> </DIV>
<DIV>Any more much much appreciatted</DIV>
<DIV> </DIV>
<DIV>Cheers<BR><BR></DIV>
<DIV class=gmail_quote>2009/9/9 Alexandre Dube <SPAN dir=ltr><<A
href="mailto:adube@mapgears.com">adube@mapgears.com</A>></SPAN><BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi
Paul,<BR><BR>You can copy the image url by right clicking on it and open it in
a new window. You'll see the request url constructed by OpenLayers and maybe
an error message from MapServer.<BR><BR>I noticed that you use the "map"
parameter. WMS has no such parameter so it should be part of your main url,
like below. Also, if you look in the OpenLayers/Layer/WMS.js code, you'll see
that this object takes 4 parameters, the 3e being the server-side "parameters"
and the 4th being the OpenLayers object "options". min/maxZoomLevel are not
parameters but OL options.
<DIV class=im><BR><BR>layer1 = new OpenLayers.Layer.WMS(<BR>"OpenLayers
WMS",<BR><BR></DIV>"<A
href="http://127.0.0.1/cgi-bin/mapserv.exe?map=/ms4w/apps/openlayers-2.5/data/uk2.map&"
target=_blank>http://127.0.0.1/cgi-bin/mapserv.exe?map=/ms4w/apps/openlayers-2.5/data/uk2.map&</A>",<BR>{
layers: "uk"},<BR><BR>{ gutter: 15, minZoomLevel: 1, maxZoomLevel: 4
}<BR>);<BR><BR><BR>If you still get pink tiles, copy the link in a new window
to see the error.<BR><BR>Regards,<BR><BR>Alexandre<BR><BR>Paul Curran
wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<DIV>
<DIV></DIV>
<DIV class=h5><BR>Hi<BR><BR>I can view my UK Layer via Mapserver with the
following url:
'ms4w/cgi-bin/mapserv.exe?mode=map&map=c:mapdirectory*&layer=uk'.*
The *&layer=uk *is calling my layer.<BR><BR>However I can’t find any
documentation on how to call the layer when viewing my map within
OpenLayers.<BR><BR>I am currently trying to call the layer like
this:<BR><BR>var map, layer1, layer2;<BR><BR>var options = { maxExtent:
bounds, maxResolution: 600, numZoomLevels: 10};<BR><BR>layer1 = new
OpenLayers.Layer.WMS("OpenLayers WMS",<BR><BR>"<A
href="http://127.0.0.1/cgi-bin/mapserv.exe"
target=_blank>http://127.0.0.1/cgi-bin/mapserv.exe</A>?", { layers: "uk",
map: '/ms4w/apps/openlayers-2.5/data/uk2.map',<BR><BR>minZoomLevel: 1,
maxZoomLevel: 4 },<BR><BR>{ gutter: 15 });<BR><BR>layer2 = new
OpenLayers.Layer.WMS("OpenLayers WMS",<BR><BR>"<A
href="http://127.0.0.1/cgi-bin/mapserv.exe"
target=_blank>http://127.0.0.1/cgi-bin/mapserv.exe</A>?", { layers: "250",
map: '/ms4w/apps/openlayers-2.5/data/uk2.map',<BR><BR>minZoomLevel: 5,
maxZoomLevel: 10},<BR><BR>{ gutter: 15 });<BR><BR>map.addLayer(uk,
250);<BR><BR>map.zoomToExtent(bounds);<BR><BR>map.setCenter(bounds);<BR><BR>map.zoomToMaxExtent();<BR><BR>However
I am just seeing pink tiles within OpenLayers.<BR><BR>Note: If my layers are
set to default within my Mapfile all my layers are displayed.<BR><BR>Thanks
for any help in
advance<BR><BR>Paul<BR><BR></DIV></DIV>------------------------------------------------------------------------<BR><BR>_______________________________________________<BR>Users
mailing list<BR><A href="mailto:Users@openlayers.org"
target=_blank>Users@openlayers.org</A><BR><A
href="http://openlayers.org/mailman/listinfo/users"
target=_blank>http://openlayers.org/mailman/listinfo/users</A><BR> <BR></BLOCKQUOTE><BR><BR>--
<BR>Alexandre Dubé<BR>Mapgears<BR><A href="http://www.mapgears.com/"
target=_blank>www.mapgears.com</A><BR><BR></BLOCKQUOTE></DIV><BR></BODY></HTML>