[OpenLayers-Users] wms tiles off in latitude for spherical mercator
setup
thomcat
chewiecat at gmail.com
Fri Jul 1 11:23:38 EDT 2011
My WMS tiles service works fine on a v2 google site but on openlayers the
same WMS service the tiles show up offset by a tile or so directly to the
south...so I suspect my map setup to match mercator.
I have added and removed the displayprojection below with no change..and
goofed around with the layer set up and using the alias back to
3857...nothing changes the bad location of my WMS tiles tho. I checked my
bbox on the wms call as well and it looks OK.
Any ideas of what to check...the allOverlays didn't seem to matter as
well..I want to use that eventually for now I draw the google and or
openstreet to make sure I know where I am even with white background
Here is my map definition:
map = new OpenLayers.Map({
div: "map",
allOverlays: true,
projection: new OpenLayers.Projection("EPSG:900913"),
displayProjection: new OpenLayers.Projection("EPSG:4326"),
units: "m",
numZoomLevels: 18,
maxResolution: "auto", // maxResolution: 156543.0339,
maxExtent: new OpenLayers.Bounds(-20037508.34,
-20037508.34, 20037508.34, 20037508.34)
});
OpenLayers.Projection.addTransform("EPSG:4326", "EPSG:3857",
OpenLayers.Layer.SphericalMercator.projectForward);
OpenLayers.Projection.addTransform("EPSG:3857", "EPSG:4326",
OpenLayers.Layer.SphericalMercator.projectInverse);
// create sphericalmercator layers
var googleLayer = new OpenLayers.Layer.Google("Google", {
"sphericalMercator": true });
var osmLayer = new OpenLayers.Layer.OSM("OpenStreetMap");
// override default epsg code
aliasproj = new OpenLayers.Projection("EPSG:3857");
googleLayer.projection = osmLayer.projection = aliasproj;
//add baselayers to map
map.addLayers([googleLayer, osmLayer]);
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/wms-tiles-off-in-latitude-for-spherical-mercator-setup-tp6538159p6538159.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list