[OpenLayers-Dev] overlay projection probelm

neelima neelima91 at yahoo.co.in
Mon Dec 19 01:39:23 EST 2011


Hi All, 
I have generated  2 maps using mapserver , one of it is a world map.These two maps are working very well on all the browsers. And then, i took my world map coming from mapserver , googlemap  as base layers in open layers and the other map which has polygon, line and point features as a overlay.This overlay is working fine with my world map , both are in EPSG:4326. But when i overlay it on google map , i can see a shift and shift changes as i zoomin and out. Thinking that it is projection problem, i have added below code to my template 
1. var options = { 
        projection: new OpenLayers.Projection("EPSG:900913"), 
       displayProjection: new OpenLayers.Projection("EPSG:4326") 
       units: "m", 
       maxResolution: 156543.0339, 
       maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 
                                     20037508.34, 20037508.34) 
        }; 
2. map.setCenter(new OpenLayers.LonLat(-98, 38) 
.transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913")),4) 
)); 

After adding the above code, my map's are visible as a dot. 

Can anyone tell  me how to overlay properly my EPSG:4326 map over EPSG:900913. 

Awaiting reply. 
Neelima 

 
Neelima
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20111219/3ba07cb1/attachment.html


More information about the Dev mailing list