[OpenLayers-Users] WMS layer not bounded by extents
David Quinn
daithiquinn at gmail.com
Thu Jan 26 14:24:57 EST 2012
Hi List,
I'm using openlayers to send a WMS query based on a user-chosen extent of a
rectangular polygon. My javascript is as follows:
// request raster layer
rasterLayer = new OpenLayers.Layer.WMS(
"Road layer..... ",
"http://mysite/mapserv.cgi?map=roads.map&",
{ layers: 'roads',
transparent: true
},
{ maxExtent: centralBounds, // extents of rectangular polygon
drawn on-screen
displayOutsideMaxExtent: false, // this is false by
default, but I tried adding it anyway
tileSize:new OpenLayers.Size(80,80), // by default this is
256
opacity: 0.5,
gutter: 0}
);
I am trying to return information from a raster using Mapserver.The query
returns a WMS layer, but only three of the four sides of the polygon have
the correct extents, and the WMS layer is a square. I've tried to
illustrated this in the below diagram:
X = requested
_____________
| |
| XXXX |
| XXXX |
| |
---------------------
Y = returned
_____________
| YYYY |
| YYYY |
| YYYY |
| |
----------------------
The extents are definitely correct, as I've used them for querying non-WMS
data that is displayed in-browser. When I make the tileSize smaller (e.g.
tileSize:new OpenLayers.Size(10,10), it fills the box perfectly. Initially,
I noticed that I was getting the following error message in Firebug:
"NetworkError: 404 Not Found - http://mysite.com/js_libraries/img/blank.gif".
My openlayers javascript is stored in the 'js_libraries' folder. I added a
folder 'img' with 'blank.gif', and my problem temporarily disappeared,
before the next page reload.
I asked a very similar question on the Mapserver list yesterday, thinking
it was a mapserver problem. I thought I had resolved it, but I have not,
and I don't think it is related to Mapserver. I'd appreciate any
suggestions - I'd prefer not to reduce tilesizes as it makes the raster
very slow to load.
Thanks,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120126/7f824f82/attachment.html
More information about the Users
mailing list