[OpenLayers-Users] Horizontal spatial shift and inconsistent behaviour when overlaying WMS and Google satellite

Viola Anne violaanne at gmail.com
Mon Aug 29 08:08:47 EDT 2011


Hello list,
I am trying to overlay wms on google satellite, I have read a few articles
on the same and finally what i have is
*ONE*: the WMS layers overlaying vertically but there seems to be a spatial
shift horizontally (to the right).
*TWO*: the WMS does NOT overlay AT ALL at certain zoom levels, while at
other zoom levels works as described in *ONE. **attached a screenshot of the
shift*
*
*
i have downloaded proj4js folder and copied into openlayers folder then
included the <script type='text/javascript'
src="openlayers/proj4js/lib/proj4js-combined.js"></script> just before
openlayers.js script. In geoserver i have set the SRS to EPSG:32737 and
below is relevant piece of openlayers code and a screenshot of the wms &
google overlay



Proj4js.defs["EPSG:32737"] ="+proj=utm +zone=37 +south +ellps=WGS84
+datum=WGS84 +units=m +no_defs ";
Proj4js.defs["EPSG:3857"]=Proj4js.defs["GOOGLE"];
 var mapExtent= new OpenLayers.Bounds(170361.569, 9963401.274,183801.419,
9971245.621);
mapExtent.transform(new OpenLayers.Projection('EPSG:32737'), new
OpenLayers.Projection('EPSG:3857'));

var options = {
              projection: new OpenLayers.Projection("EPSG:3857"),
              displayProjection: new OpenLayers.Projection("EPSG:32737"),
              units: "m",
  //maxResolution: "auto",
              maxResolution: 156543.0339,
              maxExtent: mapExtent ,
      minExtent: "auto",
    restrictedExtent: mapExtent
           };

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

var LandParcel= new OpenLayers.Layer.WMS(
"Land Parcels",
 "http://localhost:8082/geoserver/wms",
{layers:"nakinfo:nk_land_parcels",
 tiled: true,
format:"image/gif",
transparent:true,
 projection: new OpenLayers.Projection("EPSG:32737")},
{visibility: false, opacity:0.3}
 );
map.addLayer(LandParcel);


-- 
Kind Regards,
Viola
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110829/9df15466/attachment.html


More information about the Users mailing list