Just would like to add that I changed the code following some more tutorials I found / examples thanks to Chris, and this is the new code :<br><br><html><br><head><br><title>OpenLayers Example</title>
<br><script src="<a href="http://yancho.no-ip.org/~yancho/OpenLayers.js">http://yancho.no-ip.org/~yancho/OpenLayers.js</a>"></script><br><br><br><script defer="defer" type="text/javascript">
<br>//var lon = 164;<br>//var lat = 162;<br>var map, layer;<br><br><br><br>function init(){<br>var options =<br>{<br>maxExtent: new OpenLayers.Bounds(625102.34974933861,215593.742071 ,656343.383138 ,239014.742071),<br>maxResolution: 302051/1024,
<br>zoom: 0,<br>projection: "EPSF:4326", <br>//'controls': [],<br>units: "m",<br>numZoomLevels: 12<br>};<br>map = new OpenLayers.Map("map", options);<br>//map.addControl(new OpenLayers.Control.MousePosition
());<br>map.addControl(new OpenLayers.Control.LayerSwitcher());<br><br><br>layer = new OpenLayers.Layer.MapServer( "Streets Layer",<br>" <a href="http://yancho.no-ip.org/~yancho/cgi-bin/mapserv?map=\\home\\yancho\\public_html\\nc\\sample.map&">
http://yancho.no-ip.org/~yancho/cgi-bin/mapserv?map=\\home\\yancho\\public_html\\nc\\sample.map&</a>", {layers : 'streets'}, {gutter: 15});<br>map.addLayer(layer); <br><br>//map.setCenter(new OpenLayers.LonLat
(lon, lat), zoom);<br>map.addControl( new OpenLayers.Control.LayerSwitcher() );<br>}<br><br><br><br></script> <br></head><br><body onload="init()"><br><div style="width:800px;height:600px" id="map"></div>
<br><br></html><br><br><br>Pastebin : <a href="http://pastebin.com/f50f62c3f">http://pastebin.com/f50f62c3f</a><br><br>The problem is that when I load the page, there is just the controls, and the map is not loading. There are no JavaScript errors and I think its just a problem of the loading of the map.
<br><br><br>Link to page : <a href="http://yancho.no-ip.org/~yancho/openl.html">http://yancho.no-ip.org/~yancho/openl.html</a><br><br>Link to how I load the map on mapserv : <a href="http://yancho.no-ip.org/~yancho/cgi-bin/mapserv?map=%2Fhome%2Fyancho%2Fpublic_html%2Fnc%2Fsample.map&imgext=637373.285472+230666.856430+647786.963271+238473.856432&imgxy=200.0+150.0&zoom=0&layer=hospitals&layer=streets&layer=firestations&layer=majorroads&layer=railroads&mode=browse&img.x=164&img.y=62">
http://yancho.no-ip.org/~yancho/cgi-bin/mapserv?map=%2Fhome%2Fyancho%2Fpublic_html%2Fnc%2Fsample.map&imgext=637373.285472+230666.856430+647786.963271+238473.856432&imgxy=200.0+150.0&zoom=0&layer=hospitals&layer=streets&layer=firestations&layer=majorroads&layer=railroads&mode=browse&img.x=164&img.y=62
</a> <br><br>Any help will be much appreciated. Thanks<br><br>Regards<br><br><br><div><span class="gmail_quote">On 11/17/07, <b class="gmail_sendername">Christian López Espínola</b> <<a href="mailto:penyaskito@gmail.com">
penyaskito@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; margin-left: 0.80ex; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-left: 1ex">
Hi Matthew,<br><br>Your div is named 'map', and you are using<br><br>var map = new OpenLayers.Map("basemap", options);<br><br>This search for a basemap div, but it doesn't exist.<br>Change the div id, or change that line of code.
<br><br>Hope this helps.<br><br>On 11/17/07, Matthew Pulis <<a href="mailto:mpulis@gmail.com">mpulis@gmail.com</a>> wrote:<br>> Hi,<br>><br>> I am a fairly new user to OpenLayers, and this is my project aims :
<br>><br>> - Want to create a Basemap of streets which is a Vector layer and loading it<br>> as a MapServ Layer<br>> * create a start / end point<br>> * create the route<br>><br>> (* are not yet started)
<br>><br>> I am having a problem since after going through the Javascript docs, I fixed<br>> many of my syntax errors, but am still plagued with this one :<br>><br>> this.div has no properties<br>> callback("basemap", Object)OpenLayers.js (line 464)
<br>> Class()OpenLayers.js (line 57)<br>> init()openl.html (line 24)<br>> onload(load )openl.html (line 1)<br>> [Break on this error] this.active=false;return<br>> true;},callback:function(name,args){if(this.callbacks
[n...<br>><br>> Error found @ OpenLayers.js (line 464) .. Error reporting by FireBug of<br>> FireFox<br>><br>> The code I am working upon is a mix of viewsourcing some pages and the<br>> tutorials :<br>>
<br>> <html><br>> <head><br>> <title>OpenLayers Example</title><br>> <script<br>> src="<a href="http://yancho.no-ip.org/~yancho/OpenLayers.js">http://yancho.no-ip.org/~yancho/OpenLayers.js
</a>"></script><br>><br>><br>> <script defer="defer" type="text/javascript"><br>> function init(){<br>> var options =<br>> {<br>> maxExtent: new OpenLayers.Bounds
(625102.34974933861,215593.742071<br>> ,656343.383138 ,239014.742071 ),<br>> maxResolution: 302051/1024,<br>> zoom: 2,<br>> projection: "WGS84",<br>> 'controls': [],<br>> units: "m",
<br>> numZoomLevels: 12<br>> };<br>> var map = new OpenLayers.Map("basemap", options);<br>> var options2 =<br>> ( {name : "Streets Layer"},<br>> {url : "<a href="http://yancho.no-ip.org/~yancho/cgi-bin/mapserv">
http://yancho.no-ip.org/~yancho/cgi-bin/mapserv</a>"},<br>> {params : "\\home\\yancho\\public_html\\nc\\sample.map"},<br>> {options : []}<br>> );<br>> map.addLayer (new OpenLayers.Layer.MapServer
("streets", options2));<br>><br>> }<br>><br>> </script><br>> </head><br>> <body onload="init()"><br>> <div style="width:800px;height:600px" id="map"></div>
<br>><br>> </html><br>><br>> If you want the code with syntax highlighted you can go here :<br>> <a href="http://pastebin.com/f218a9fc9">http://pastebin.com/f218a9fc9</a><br>><br>><br>> I would be extremely happy if you manage to point me to any errors I am
<br>> doing, and maybe some other reading I should do.<br>><br>> Thanks alot for your time in reading my post<br>><br>><br>> Regards<br>><br>><br>> Matthew<br>><br>> --<br>> Matthew Pulis
<br>> URL : <a href="http://www.solutions-lab.net">http://www.solutions-lab.net</a><br>> MSN : pulis_matthew[@]hotmail.com<br>> ICQ : 145951110<br>> Skype : <a href="http://solutions-lab.net">solutions-lab.net
</a><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>><br>><br><br><br>--<br>Regards,<br><br>Christian López Espínola<br></blockquote></div><br><br clear="all"><br>-- <br>Matthew Pulis<br>URL : <a href="http://www.solutions-lab.net">
http://www.solutions-lab.net</a><br>MSN : pulis_matthew[@]hotmail.com<br>ICQ : 145951110<br>Skype : <a href="http://solutions-lab.net">solutions-lab.net</a>