[OpenLayers-Users] Why is there a large white background area beyond raster image overlays ?

Brett Wilton bdwilton at gmail.com
Fri Apr 27 06:57:30 EDT 2007


Hello,
I'm a new user to OpenLayers I'm running 2.3 and are getting WMS data from
GeoServer 1.5.0. What I was trying to do was have a shape file as my base
map and various tiff image overlays (all requested as PNG). Both the base
map and a single overlay layer are displayed however the overlay image has a
massive white area outside of the image extent.

I have tried specifying transparent: true but no luck, I can reduce the
white area by setting maxExtent: new OpenLayers.Bounds(...) but can only get
that to work when using lat & lon values (which dont seem to be accurate to
the amount they reduce the white area.

my code is similar to the following :-
map = new OpenLayers.Map( $('map'), { controls: [] });
var basemap = new OpenLayers.Layer.WMS("NZ Coast",
"http://localhost:8080/geoserver/wms?service=wms",
 {layers: 'bimaris:nzcoast', bgcolor: '#96B4CC', format: 'image/png'},
 {maxExtent: new OpenLayers.Bounds(166.25916889102302,-47.4098674940290,
179.48459790941232,-34.001147239984334)}
);
var overlay = new OpenLayers.Layer.WMS("Sat Img",
"http://localhost:8080/geoserver/wms?service=wms",
{layers: 'topp:be37a', format: 'image/png', transparent: true},
{isBaseLayer: false, maxExtent: new OpenLayers.Bounds(176,-38,175,-37.86),
opacity: 0.5}
);

Any suggestions or help appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070427/a68448bf/attachment.html


More information about the Users mailing list