Arjen,<br><br>This is what I use for British National Grid and it works fine.<br><br><br><div><span style="font-family: courier new,monospace;"><script
type="text/javascript"><br>var map;<br>function init() <br>{<br>var options =
{isBaseLayer:true,resolutions:[72,36,18,9.6,4.8,2.4,1.2,0.6,0.3,0.15,0.125],
maxExtent:new OpenLayers.Bounds(0,0,2000000,2000000),
maxResolution:'auto', units:'meters', projection:'EPSG:27700',
controls:[]};
<br>map
= new OpenLayers.Map( $('map'), options );<br>var layer0= new
OpenLayers.Layer.WMS('Mastermap',
'<a href="http://somewhere/script.asp?%27,%7Blayers:%27topo_area,carto_text" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://somewhere/script.asp?',{layers:'topo_area,carto_text</a>
', format:'image/jpeg'});<br><br>map.addLayers(layer0);
<br><br></span><span><span style="font-family: courier new,monospace;">map.setCenter(new OpenLayers.LonLat(543443,255213), 7);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
}</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"></script><br></span></span></div><br>cheers,<br><br>Tom<br><br><br><div><span class="gmail_quote">On 6/4/07,
<b class="gmail_sendername">Arjen de Korte</b> <<a href="mailto:arjendk@gmx.net">arjendk@gmx.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all,<br><br>I'm trying to view a WMS running on my local computer with OpenLayers. The WMS-layers are in Dutch RD coordinates (EPSG:28992). I'm using the code below. However, I get a JavaScript error "bounds has no properties" on the line
<br>"map.setCenter".<br><br> <script src="<a href="http://openlayers.org/api/OpenLayers.js">http://openlayers.org/api/OpenLayers.js</a>"></script><br> <script type="text/javascript">
<br> function init(){<br> map = new OpenLayers.Map("map",<br> { maxExtent: new OpenLayers.Bounds(0, 300000, 300000, 600000),<br> maxResolution: "auto",<br> units: 'meters',
<br> projection: "EPSG:28992"<br> });<br><br> // It works with this one:<br> //map = new OpenLayers.Map( $('map') );<br> //layer = new OpenLayers.Layer.WMS
( "OpenLayers WMS",<br> // "<a href="http://labs.metacarta.com/wms/vmap0">http://labs.metacarta.com/wms/vmap0</a>", {layers: 'basic'} );<br><br> //See: <a href="http://trac.openlayers.org/wiki/FrequentlyAskedQuestions#Projections">
http://trac.openlayers.org/wiki/FrequentlyAskedQuestions#Projections</a><br> layer = new OpenLayers.Layer.WMS( "VMap0", "<a href="http://localhost/mapserver/mapserv.exe?map=c:/Inetpub/test/demo.map">
http://localhost/mapserver/mapserv.exe?map=c:/Inetpub/test/demo.map</a>",<br> { request: 'GetMap',<br> layers: 'water',<br> srs: 'EPSG:28992',<br> format: 'image/png',
<br> transparent: true<br> } );<br> map.addLayer(layer);<br> map.addControl(new OpenLayers.Control.Permalink());<br> // This doesn't work: "JS error: bounds has no properties":
<br> map.setCenter(new OpenLayers.LonLat(lat, lon), zoom);<br> // This doesn't work either: "JS error: bounds has no properties":<br> //map.zoomToMaxExtent();<br> }<br>
// --><br> </script><br><br>Does anyone have an idea how this can be solved? Can it be it has to do with the fact that I'm trying to use the EPSG:28992 SRS? The basic example with the OpenLayers WMS (commented above) works fine.
<br><br>A similar problem has been posted earlier: <a href="http://openlayers.org/pipermail/users/2007-February/000695.html">http://openlayers.org/pipermail/users/2007-February/000695.html</a>, but I found no responses.<br>
<br>Best regards,<br>Arjen.<br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br><a href="http://openlayers.org/mailman/listinfo/users">
http://openlayers.org/mailman/listinfo/users</a><br></blockquote></div><br>