Ok. I've modified the code this way (the red one):<div><br></div><div><div> <font class="Apple-style-span" face="'courier new', monospace">var opciones = {</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> projection:"EPSG:4230",</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> <font class="Apple-style-span" color="#FF0000">units:"dd",</font></font></div><div><font class="Apple-style-span" face="'courier new', monospace"> maxExtent:new OpenLayers.Bounds(-3,37,0,39)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> };</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> map = new OpenLayers.Map('map', opciones); </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"> var sigpac_layer = new OpenLayers.Layer.WMS(</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> "PNOA", </font></div><div><font class="Apple-style-span" face="'courier new', monospace"> "<a href="http://www.idee.es/wms/PNOA/PNOA">http://www.idee.es/wms/PNOA/PNOA</a>", </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> {</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> layers:"pnoa", </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> version:"1.1.1",</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> format:"image/png"</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> }, </font></div><div><font class="Apple-style-span" face="'courier new', monospace"> {</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> projection:"EPSG:4230"</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> });</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> map.addLayer(sigpac_layer);</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"> var mapserver_layer = new OpenLayers.Layer.WMS(</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> 'Murcia',</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> '<a href="http://localhost/cgi-bin/mapserv.exe">http://localhost/cgi-bin/mapserv.exe</a>',</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> {</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> map:'D:/Desarrollo/MapServer/datos/ms_murcia_qgis_shp.map',</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> layers:'arquetas_otros_planifrega,regulacion_ext_planifrega,conducciones_planifrega,regulacion_int_planifrega,tomas_planifrega,balsas_planifrega,bombeos_planifrega'</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> transparent:'true' </font></div><div><font class="Apple-style-span" face="'courier new', monospace"> }, </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> {</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> projection:"EPSG:4326",</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> units:"m"<font class="Apple-style-span" color="#FF0000">,</font></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><font class="Apple-style-span" color="#FF0000"> maxExtent:new OpenLayers.Bounds(548757,4138136,716640,4282922)</font></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> });</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> map.addLayer(mapserver_layer);</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"> map.addControl(new OpenLayers.Control.LayerSwitcher());</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> map.addControl(new OpenLayers.Control.MouseToolbar());</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> map.addControl(new OpenLayers.Control.MousePosition());</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> map.zoomToMaxExtent();</font></div><div><br></div><div><br></div><div>But I've recived the same result.</div><div><br></div><div>
Thanks.</div><div><br></div><div><br></div><br><div class="gmail_quote">2009/11/12 Alexandre Dube <span dir="ltr"><<a href="mailto:adube@mapgears.com">adube@mapgears.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">Hi Toni,<br>
<br>
Your data projection is in meters, so you must set it in the OpenLayers.Map object as well. By default, it's in degrees [1]. Plus, the maxExtent should be in meters too (try using the one from your mapfile).<br>
<br>
If it's still not working, you can try watching the request built from OpenLayers in Firebug and see the response. There may more more clues there.<br>
<br>
Best of luck,<br>
<br>
Alexandre<br>
<br>
[1] <a href="http://dev.openlayers.org/releases/OpenLayers-2.8/doc/apidocs/files/OpenLayers/Map-js.html#OpenLayers.Map.units" target="_blank">http://dev.openlayers.org/releases/OpenLayers-2.8/doc/apidocs/files/OpenLayers/Map-js.html#OpenLayers.Map.units</a><br>
<br>
Toni Ramiro wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5">
I'm new to this and I've encountered a problem.<br>
<br>
I defined the following code to load one layer with OpenLayers<br>
<br>
var opciones = {<br>
projection:"EPSG:4230",<br>
maxExtent:new OpenLayers.Bounds(-3,37,0,39)<br>
};<br>
map = new OpenLayers.Map('map', opciones); <br>
var sigpac_layer = new OpenLayers.Layer.WMS(<br>
"PNOA", "<a href="http://www.idee.es/wms/PNOA/PNOA" target="_blank">http://www.idee.es/wms/PNOA/PNOA</a>", {<br>
layers:"pnoa", version:"1.1.1",<br>
format:"image/png"<br>
}, {<br>
projection:"EPSG:4230",<br>
units:"m"<br>
});<br>
map.addLayer(sigpac_layer);<br>
<br>
var mapserver_layer = new OpenLayers.Layer.WMS(<br>
'Murcia',<br>
'<a href="http://localhost/cgi-bin/mapserv.exe" target="_blank">http://localhost/cgi-bin/mapserv.exe</a>',<br>
{<br>
map:'D:/Desarrollo/MapServer/datos/ms_murcia_qgis_shp.map',<br>
layers:'arquetas_otros_planifrega',<br>
transparent:'true'<br>
}, {<br>
projection:"EPSG:4326",<br>
units:"m"<br>
});<br>
map.addLayer(mapserver_layer);<br>
<br>
map.addControl(new OpenLayers.Control.LayerSwitcher());<br>
map.addControl(new OpenLayers.Control.MouseToolbar());<br>
map.addControl(new OpenLayers.Control.MousePosition());<br>
map.zoomToMaxExtent();<br>
<br>
My MapServer project is as follows:<br>
<br>
MAP<br>
NAME Murcia<br>
SIZE 800 600<br>
UNITS METERS<br>
<br>
EXTENT 544061.905938 4135608.106250 720849.906562 4288074.143750<br>
CONFIG PROJ_LIB "D:\Desarrollo\MapServer\proj\nad\"<br>
PROJECTION<br>
'proj=longlat'<br>
'ellps=WGS84'<br>
'datum=WGS84'<br>
'no_defs'<br>
''<br>
END<br>
<br>
IMAGECOLOR 192 192 192<br>
IMAGEQUALITY 95<br>
IMAGETYPE png<br>
OUTPUTFORMAT<br>
NAME png<br>
DRIVER 'GD/PNG'<br>
MIMETYPE 'image/png'<br>
EXTENSION 'png'<br>
END<br>
<br>
LEGEND<br>
IMAGECOLOR 255 255 255<br>
STATUS ON<br>
KEYSIZE 18 12<br>
LABEL<br>
TYPE BITMAP<br>
SIZE MEDIUM<br>
COLOR 0 0 89<br>
END<br>
END<br>
<br>
WEB<br>
IMAGEPATH 'C:/Inetpub/tmp/'<br>
IMAGEURL '/tmp/'<br>
<br>
METADATA<br>
'wms_title' 'Murcia'<br></div></div>
'wms_onlineresource' '<a href="http://localhost/cgi-bin/mapserv.exe?map=D:/Desarrollo/MapServer/datos/ms_murcia_qgis_shp.map&" target="_blank">http://localhost/cgi-bin/mapserv.exe?map=D:/Desarrollo/MapServer/datos/ms_murcia_qgis_shp.map&</a> <<a href="http://localhost/cgi-bin/mapserv.exe?map=D:/Desarrollo/MapServer/datos/ms_murcia_qgis_shp.map&" target="_blank">http://localhost/cgi-bin/mapserv.exe?map=D:/Desarrollo/MapServer/datos/ms_murcia_qgis_shp.map&</a>>'<div>
<div></div><div class="h5"><br>
'wms_srs' 'EPSG:4326'<br>
END<br>
<br>
END<br>
LAYER<br>
NAME 'arquetas_otros_planifrega'<br>
TYPE POINT<br>
DATA 'D:\Desarrollo\MapServer\datos\CapasDePrueba\arquetas_otros_planifrega.shp'<br>
METADATA<br>
'wms_title' 'arquetas_otros_planifrega'<br>
END<br>
STATUS DEFAULT<br>
TRANSPARENCY 100<br>
PROJECTION<br>
'proj=longlat'<br>
'ellps=WGS84'<br>
'datum=WGS84'<br>
'no_defs'<br>
''<br>
END<br>
CLASS<br>
NAME 'arquetas_otros_planifrega' STYLE<br>
SYMBOL 'CIRCLE' SIZE 2 OUTLINECOLOR 0 0 0<br>
COLOR 31 2 3<br>
END<br>
END<br>
END<br>
<br>
SYMBOL<br>
NAME 'CIRCLE'<br>
TYPE ellipse<br>
FILLED true<br>
POINTS<br>
1 1<br>
END<br>
END END<br>
<br>
The result is that the OpenLayers 'Murcia' layer shows no data, and if left alone in the project only shows a gray background.<br>
<br>
I've tried the same using QGis WMS client to Mapserver and shows the data.<br>
<br>
żDo anybody knows how to solve the problem?<br>
<br>
Thanks a lot.<br>
<br>
-- <br>
Saludos,<br>
Toni Ramiro<br></div></div><div class="im">
<<a href="mailto:anrapas@gmail.com" target="_blank">anrapas@gmail.com</a> <mailto:<a href="mailto:anrapas@gmail.com" target="_blank">anrapas@gmail.com</a>>><br>
<<a href="mailto:aramiro151r@cv.gva.es" target="_blank">aramiro151r@cv.gva.es</a> <mailto:<a href="mailto:aramiro151r@cv.gva.es" target="_blank">aramiro151r@cv.gva.es</a>>><br>
------------------------------------------------------------------------<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>
</div></blockquote><font color="#888888">
<br>
<br>
-- <br>
Alexandre Dubé<br>
Mapgears<br>
<a href="http://www.mapgears.com" target="_blank">www.mapgears.com</a><br>
<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Saludos,<br> Toni Ramiro<br> <<a href="mailto:anrapas@gmail.com">anrapas@gmail.com</a>><br> <<a href="mailto:aramiro151r@cv.gva.es">aramiro151r@cv.gva.es</a>><br>
</div>