Simone,

What other layers are you adding to the map, along with the Google Hybrid layer? I've had similar messages appear when I try and add a layer that doesn't support the projection that the map is in. In this case, I'd say that one of the layers you're trying to add is not available in the 900913 projection.

Try adding just the Google Hybrid layer to your map and then adding additional layers one by one and see when the error occurs.

- Ryan


On 12/23/2010 9:30 AM, Simone Bianchi wrote:
Hello,

maybe this a very newbie request, but I cannot find myself the solution!

I have a GML file projected in gcs-wgs84. I created a Openlayers
project and used both the Openlayers and Demis WMS as base layers,
everything is fine. With Google (I'm trying to use the Hybrid map),
there problem due to the different projections I suppose. So I checked
the live example "OpenLayers Spherical Mercator Example" on
http://openlayers.org/dev/examples/, and tried to implement some of
the code there in my project, but I wasn't able to make it works....

Which lines of code should I use? I tried adding the just the
following to my project:

Initially
             var options = {
                 projection: new OpenLayers.Projection("EPSG:900913"),
                 displayProjection: new OpenLayers.Projection("EPSG:4326"),
                 units: "m",
                 numZoomLevels: 18,
                 maxResolution: 156543.0339,
                 maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
                                                  20037508,
20037508.34) -ok, I know I can change this but i don't think it's the
problem now....
             };


then
           map = new OpenLayers.Map('map', options);

and
             var ghyb = new OpenLayers.Layer.Google(
                 "Google Hybrid",
                 {type: G_HYBRID_MAP, 'sphericalMercator': true}
             );

but the result is "Invalid projectio [epsg:900913], only"

Just a clarification: I have NO experience on programming language, I
can just copy and paste lines of code, change some parameters, and
check the syntax.... ;-)
Thanks to everyone!!





--
Simone Bianchi
www.simonebianchi.eu
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users


--
Ryan Williams, GISP
GIS Analyst / Programmer
PAQ Interactive Inc.
Monticello, IL
www.paqinteractive.com

_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to