<div class=""><table class="" width="100%" cellpadding="0" cellspacing="0"><tbody class=""><tr class="netRow netLimitRow collapsed"><td colspan="5" class="netCol netLimitCol"><table class="" cellpadding="0" cellspacing="0">
<tbody class=""><tr class=""><td class=""><span class="netLimitLabel"><br></span></td><td style="width: 100%;" class=""><br></td><td class=""><br></td><td class=""><br></td></tr></tbody></table></td></tr></tbody></table></div>
<span class="objectBox objectBox-errorMessage hasTwisty hasBreakSwitch"><div class="errorTitle">Hi all,<br><br>I'm getting a firebug error, which is this:<br><br><div class="errorTitle"><br>
invalid object initializer</div><div class="errorSourceBox errorSource-exec"><img src="chrome://firebug/content/blank.gif" title="Break on this error" class="errorBreak"><span class="errorSource">var factory=null;if(typeof GearsFactory!...documentElement.appendChild(factory);}}} error line 224<br>
</span></div><br>Here's my code, basically, I'm just trying to get OL to display data in UTM Zone 32N, which I believe is EPSG:22332 (although there are several))<br>I apologize for the commented out lines of code. <br>
<br>I'm pretty sure the error's with the mapserver layer.<br><br></div><div class="errorSourceBox errorSource-exec"><span class="errorSource">//Tricking OL's wms to setCenter<br> var lon = 10.8804;<br>
var lat = 33.7817;<br> var zoom = 10;<br> var myproj = new OpenLayers.Projection("EPSG:22332");<br> //var myproj = new OpenLayers.Projection("EPSG:4326");<br> var map, layer;<br>
function init(){<br> // Default WMS from Metacarta<br> map = new OpenLayers.Map('map',<br> {<br> maxExtent: new OpenLayers.Bounds (656782.661, 3720728.22, 693473.18, 3754557.09),<br>
maxResolution: "auto",<br> projection: "myproj"<br> });<br> <br> // var myBaseLayer = 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> // map.addLayer(myBaseLayer);<br> // var jerbaSites =(new OpenLayers.Layer.GML("Jerba_sites", "kml/doc.kml", <br> // { <br> // projection: new OpenLayers.Projection ("EPSG:4326"),<br>
// format: OpenLayers.Format.KML, <br> // formatOptions: {<br> // extractStyles: true, <br> // extractAttributes: true,<br> // maxDepth: 2<br> // }<br>
// }));<br> <br>// map.addLayer(jerbaSites);<br> var mapserv = new OpenLayers.Layer.WMS( "Jerba",<br> "<a href="http://localhost/cgi-bin/mapserv.exe">http://localhost/cgi-bin/mapserv.exe</a>", <br>
{<br> map: 'C:/ms4w/apache/htdocs/oltest/Jerba.map',<br> layers: "satt", "sites", "soils"<br> }<br> );<br> map.addLayer(mapserv);<br> <br>
// var kmlTest = new OpenLayers.Layer.GML("KML_Test", "kml/jerba_site.kml",<br> // { projection: new OpenLayers.Projection ("EPSG:4326"), format: OpenLayers.Format.KML, formatOptions: {extractStyles: true, <br>
// extractAttributes: true,<br> // maxDepth: 2<br>// }<br>// }));<br>// map.addLayer(kmlTest); <br> // Map Controls<br> map.addControl( new OpenLayers.Control.LayerSwitcher());<br>
map.addControl( new OpenLayers.Control.MousePosition());<br> map.addControl( new OpenLayers.Control.OverviewMap());<br> map.addControl( new OpenLayers.Control.ScaleLine());<br> map.addControl(new OpenLayers.Control.Permalink());<br>
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);<br><br> }<br> // --><br> </script><br><br><br></span></div></span>