[OpenLayers-Users] Firebug Error: Invalid Object Initializer
Christopher Schmidt
crschmidt at metacarta.com
Tue May 12 07:16:14 EDT 2009
On Mon, May 11, 2009 at 09:27:15PM -0400, Nicholas Efremov-Kendall wrote:
> Hi all,
>
> I'm getting a firebug error, which is this:
>
>
> invalid object initializer
> var factory=null;if(typeof
> GearsFactory!...documentElement.appendChild(factory);}}} error line 224
I see this error message regularly. I believe it is related to Google
Gears somehow, and I also think it's bogus -- not something wrong with
your code. I've neve rseen it cause problems before.
> 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))
> I apologize for the commented out lines of code.
>
> I'm pretty sure the error's with the mapserver layer.
>
> //Tricking OL's wms to setCenter
> var lon = 10.8804;
> var lat = 33.7817;
> var zoom = 10;
> var myproj = new OpenLayers.Projection("EPSG:22332");
> //var myproj = new OpenLayers.Projection("EPSG:4326");
> var map, layer;
> function init(){
> // Default WMS from Metacarta
> map = new OpenLayers.Map('map',
> {
> maxExtent: new OpenLayers.Bounds (656782.661, 3720728.22,
> 693473.18, 3754557.09),
> maxResolution: "auto",
> projection: "myproj"
> });
>
> // var myBaseLayer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
> // "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'}
> );
>
> // map.addLayer(myBaseLayer);
> // var jerbaSites =(new OpenLayers.Layer.GML("Jerba_sites",
> "kml/doc.kml",
> // {
> // projection: new OpenLayers.Projection ("EPSG:4326"),
> // format: OpenLayers.Format.KML,
> // formatOptions: {
> // extractStyles: true,
> // extractAttributes: true,
> // maxDepth: 2
> // }
> // }));
>
> // map.addLayer(jerbaSites);
> var mapserv = new OpenLayers.Layer.WMS( "Jerba",
> "http://localhost/cgi-bin/mapserv.exe",
> {
> map: 'C:/ms4w/apache/htdocs/oltest/Jerba.map',
> layers: "satt", "sites", "soils"
> }
> );
> map.addLayer(mapserv);
>
> // var kmlTest = new OpenLayers.Layer.GML("KML_Test",
> "kml/jerba_site.kml",
> // { projection: new OpenLayers.Projection ("EPSG:4326"), format:
> OpenLayers.Format.KML, formatOptions: {extractStyles: true,
> // extractAttributes: true,
> // maxDepth: 2
> // }
> // }));
> // map.addLayer(kmlTest);
> // Map Controls
> map.addControl( new OpenLayers.Control.LayerSwitcher());
> map.addControl( new OpenLayers.Control.MousePosition());
> map.addControl( new OpenLayers.Control.OverviewMap());
> map.addControl( new OpenLayers.Control.ScaleLine());
> map.addControl(new OpenLayers.Control.Permalink());
> map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
>
> }
> // -->
> </script>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
--
Christopher Schmidt
MetaCarta
More information about the Users
mailing list