[OpenLayers-Users] Aligning mapserver wms layer with google maps
again
bmrg
fred.bennett at bmrg.org.au
Wed Oct 1 01:59:30 EDT 2008
I am not sure if this is an issue with projections or what, but I am having a
peculiar problem trying to align my mapserver wms layer with a google layer.
I have tried playing around with projections ect. to try and remedy this but
to no avail.
The misalignment seems to depend on the latitude of the feature. Features
drawn at the central latitude of the map align very well and the
misalignment increases the further north or south of the map centre. This is
even the case when I reposition the map. The wms layers are compresses in
the north-south dimension.
Is it obvious to anyone what I may be doing wrong? I have attahced part of
the openlayers script below for reference.
map = new OpenLayers.Map( 'map', {
numZoomLevels: 20, maxZoomLevel: 20 });
var gsat = new OpenLayers.Layer.Google(
"Google Satellite",
{type: G_SATELLITE_MAP}
);
//map.addLayer(gsat);
var gphy = new OpenLayers.Layer.Google(
"Google Physical",
{type: G_PHYSICAL_MAP}
);
//map.addLayer(gphy);
var gmap = new OpenLayers.Layer.Google(
"Google Streets" // the default
);
//map.addLayer(gmap);
var ghyb = new OpenLayers.Layer.Google(
"Google Hybrid",
{type: G_HYBRID_MAP}
);
//map.addLayer(ghyb);
map.addLayers([gsat, gphy, gmap, ghyb]);
wms = new OpenLayers.Layer.MapServer( "Regional
Ecosystems",
"http://localhost/cgi-bin/mapserv.exe", {map:
'C:/ms4w/Apache/htdocs/re.map', transparent: 'true', format: 'png'},
{'isBaseLayer': false, 'opacity': 0.5, 'reproject':
true, 'gutter': 15, 'singleTile': true} );
map.addLayer(wms);
cadastre = new OpenLayers.Layer.MapServer( "Cadastre",
"http://localhost/cgi-bin/mapserv.exe", {map:
'C:/ms4w/Apache/htdocs/cadastre.map', transparent: 'true', format: 'png'},
{'isBaseLayer': false, 'opacity': 0.5, 'reproject':
true, 'gutter': 15, 'singleTile': true} );
map.addLayer(cadastre);
cad_label = new OpenLayers.Layer.MapServer( "Cadastre Labels",
"http://localhost/cgi-bin/mapserv.exe", {map:
'C:/ms4w/Apache/htdocs/cad_label.map', transparent: 'true', format: 'png'},
{'isBaseLayer': false, 'opacity': 0.5, 'reproject':
true, 'gutter': 15, 'singleTile': true} );
map.addLayer(cad_label);
wms.setVisibility(false);
cadastre.setVisibility(false);
cad_label.setVisibility(false);
--
View this message in context: http://www.nabble.com/Aligning-mapserver-wms-layer-with-google-maps-again-tp19754401p19754401.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list