<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><font style="font-size:10pt;" color="#366092" face="Arial" size="2">Hola Luis,<br><br>I <font style="font-size: 10pt;" size="2"><font style="font-size: 10pt;" size="2"><font style="font-size: 10pt;" size="2">work with mapserver instead of geoserver, so not sure if <font style="font-size: 10pt;" size="2">yz <font style="font-size: 10pt;" size="2">can be the problem<font style="font-size: 10pt;" size="2">. I <font style="font-size: 10pt;" size="2">th<font style="font-size: 10pt;" size="2">ink <font style="font-size: 10pt;" size="2">you have to test first getting the map without layers, since <font style="font-size: 10pt;" size="2">you<font style="font-size: 10pt;" size="2">'re working only with 90091<font style="font-size: 10pt;" size="2">3<font style="font-size: 10pt;" size="2">, just <font style="font-size: 10pt;" size="2">plot the OSM <font style="font-size: 10pt;" size="2">baselayer first in OL, if that works then <font style="font-size: 10pt;" size="2">put things above<font style="font-size: 10pt;" size="2">, ie<font style="font-size: 10pt;" size="2">. <font style="font-size: 10pt;" size="2">your geoserver layers.<br><br><font style="font-size: 10pt;" size="2">Salu2,<br><br><font style="font-size: 10pt;" size="2">Gery</font></font> </font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font><br id="FontBreak"></font><br><br><font style="font-size:10pt" color="#1F497D" face="Arial" size="2"><br>__________________________________________________________________________________________<br>Piensa en el medio ambie<font style="" face="Arial">nte - mantenlo en la pantalla. NO lo imprimas si NO es necesario.</font></font><font style="font-size:10pt" color="#1F497D" face="Arial" size="2"><br></font><font style="font-size:10pt" color="#1F497D" face="Arial" size="2">Think green - keep it on the screen. Do NOT print if it is NOT necessary.</font><font style="font-size:10pt" color="#1F497D" face="Arial" size="2"><br></font><font style="font-size:10pt" color="#1F497D" face="Arial" size="2"><span id="ecxresult_box" class="ecxshort_text" lang="de"><span class="ecxhps">Denken Sie an</span> <span class="ecxhps">die Umwelt</span></span></font><font style="font-size:10pt" color="#1F497D" face="Arial" size="2"><span id="ecxresult_box" lang="de"><span class="ecxhps"></span> <span class="ecxhps">-</span> <span class="ecxhps">bewahren Sie es</span> <span class="ecxhps">auf dem Bildschirm.</span> <span class="ecxhps">Drucken Sie es NICHT</span><span>, wenn</span> <span class="ecxhps">es NICHT notwendig ist</span><span>.</span></span></font><br><br><br><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">Date: Sat, 2 Mar 2013 11:11:47 +0100<br>From: luis.miguel.royo@gmail.com<br>To: openlayers-users@lists.osgeo.org<br>Subject: [OpenLayers-Users] Problem Geoserver Layer<br><br>
Hi everyone,<br>
<br>
I'm new with openlayers, and i'm trying to create a new map with one
layer served with Geoserver, but i'm getting some problems.<br>
<br>
This is the code:<br>
<br>
<font face="FreeMono"><small>"//Definimos la variable map<br>
var map;<br>
function init() {<br>
//Opciones<br>
var options = {<br>
projection: new
OpenLayers.Projection("EPGS:900913"),<br>
units: "m"
<br>
<br>
};<br>
<br>
//Creamos un nuevo objeto map en el div con el id = map<br>
map = new OpenLayers.Map('map',options);<br>
<br>
var mapnik = new OpenLayers.Layer.OSM();<br>
<br>
<br>
<br>
//Añadir capa Geoserver Pruebas<br>
var prueba = new OpenLayers.Layer.WMS(<br>
"Test:comarca - Tiled",
<a class="ecxmoz-txt-link-rfc2396E" href="http://localhost:8080/geoserver/Test/wms" target="_blank">"http://localhost:8080/geoserver/Test/wms"</a>,<br>
{<br>
LAYERS: 'Test:comarca',<br>
format: 'img/png'<br>
},<br>
{ <br>
isBaseLayer: false,<br>
yx : {'EPSG:900913' : false}<br>
} <br>
);<br>
<br>
<br>
// Añadir la capa al mapa<br>
map.addLayer(mapnik);<br>
<br>
map.addLayer(prueba);<br>
<br>
<br>
//Poner el centro del mapa en estas coordenadas.<br>
map.setCenter(new
OpenLayers.LonLat(-412267.21675,4926706.34959),6);<br>
<br>
<br>
<br>
//Controles<br>
map.addControl(new
OpenLayers.Control.LayerSwitcher()); <br>
map.addControl (new OpenLayers.Control.MousePosition
());<br>
map.addControl( new OpenLayers.Control.ScaleLine());<br>
}</small>"</font><br>
<br>
But Firebug show me this error: <br>
<br>
<small><font face="FreeMono">TypeError: a is null<br>
<a class="ecxmoz-txt-link-freetext" href="http://localhost/arqueoserver3/OpenLayers-2.12/OpenLayers.js" target="_blank">http://localhost/arqueoserver3/OpenLayers-2.12/OpenLayers.js</a><br>
Line 467</font></small><br>
<br>
What I'm doing wrong? Probably is something stupid, but i can't see
it. <br>
<br>
Thanks.<br>
<pre class="ecxmoz-signature">--
Luís Miguel Royo Pérez
</pre>
<br>_______________________________________________
Users mailing list
Users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users</div> </div></body>
</html>