[OpenLayers-Users] Re: Overlaying WMS layers on Google Maps

BMcBride bmcbride at opengeo.org
Wed May 11 10:13:09 EDT 2011


Louis,

First, you have to pass your map options to the map constructor after the
div: 
map = new OpenLayers.Map('map', options);


Also- it's not necessary to use proj4js when you are working with EPSG:4326
and EPSG:900913, openlayers can handle these natively.

Try: 
var options = {
              projection: new OpenLayers.Projection("EPSG:900913"),
              displayProjection: new OpenLayers.Projection("EPSG:4326"),
              units: "m",
              maxResolution: 156543.0339,
              maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
                                               20037508, 20037508)
           };

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


-----
Bryan McBride, GISP
OpenGeo - http://opengeo.org 
Expert service straight from the developers. 
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Overlaying-WMS-layers-on-Google-Maps-tp6351168p6352008.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list