[mapserver-users] WMS non-square extent query using openlayers

David Quinn daithiquinn at gmail.com
Wed Jan 25 14:43:14 PST 2012


Hi List,

Is it possible to receive a non-square tile, or collection of tiles, from a
WMS query? I'm using openlayers to send a WMS query based on a user-chosen
extent of a rectangular polygon. My javascript is as follows:

    WMSLayer = new OpenLayers.Layer.WMS(
           "layerName",
           "wms_server",
           {layers: 'roads', },
           {'maxExtent': polygonBounds}
       );

The initial part of my .map file is:

MAP
    NAME
 "roads"
    UNITS          meters
    EXTENT       -850000 495000 -890000 500000
    SIZE             256 256
    STATUS       OFF
    DEBUG        ON

and I am returning information from a raster.The query returns a WMS layer
fine, 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        |
|                         |
----------------------

I've tried adjusting the SIZE values but this does not seem to change the
limit. The extents are definitely correct, as I've used them for querying
non-WMS data that is displayed in-browser. When I subtracted a value from
the "bound.top" value in Openlayers, the correct values were returned, but
this did not seem like the right way to fix the problem. I'd appreciate any
suggestions!

Thanks,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120125/72af4a41/attachment.htm>


More information about the MapServer-users mailing list