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

David Quinn daithiquinn at gmail.com
Thu Jan 26 11:48:06 EST 2012


Just to follow up with the resolution of this problem, even though it seems
to be more on the OpenLayers side. 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 disappeared. Now, only the
queried area is displayed onscreen (but I realize that openlayers is
sending a larger query, and replacing the results from Mapserver with a
blank gif).

David



On Wed, Jan 25, 2012 at 7:11 PM, Frank Warmerdam <warmerdam at pobox.com>wrote:

> On Wed, Jan 25, 2012 at 3:34 PM, David Quinn <daithiquinn at gmail.com>
> wrote:
> > Just to clarify - so non-square results should be returned without doing
> > anything special on the mapserver side?
>
> David,
>
> That is my understanding in WMS mode.
>
> >>
> >>
> >> But if I were you, I'd start by examining that WMS request is actually
> >> being generated and sent to MapServer by OpenLayers and determine
> >> if it is doing what it ought to.
> >
> >
> > This is an example of the html that is returned on screen:
> >
> > <img id="OpenLayersDiv119" style="width: 256px; height: 256px; position:
> > relative; opacity: 0.5;" class="olTileImage"
> > src="
> http://mysite.com/mapserv.cgi?map=roads.map&amp;LAYERS=roads&amp;TRANSPARENT=TRUE&amp;SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=GetMap&amp;STYLES=&amp;FORMAT=image%2Fpng&amp;SRS=EPSG%3A900913&amp;BBOX=-8234561,4996137,-8214993,5015705&amp;WIDTH=256&amp;HEIGHT=256
> ">
> >
> > In this case, I set SIZE 64 64 in my mapfile, but it did not make a
> > difference, as 256 seems to be used. The polygon bounds calculated in
> > browser using openlayers are as follows:
> -8254128,4976569,-8215574,4996932
> >
> > I can now see that the problem is due to the entire tile being included,
> and
> > not clipped to the upper extent. But this is strange, as the verticals
> are
> > being clipped ok, as is the lower extent.
>
> I see that the request getting sent to MapServer is 256x256 and
> for a BBOX that is 19568m by 19568m so it seems the problem
> is with client side request composition.
>
> Note that the SIZE keyword in your map file has no effect
> on anything when using WMS requests.  I believe it is the
> default image size when using non-WMS map=mode requests
> to MapServer without an explicit size in the request.
>
> Best regards,
> --
>
> ---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank Warmerdam,
> warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush    | Geospatial Software Developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120126/e0fde2a5/attachment.html


More information about the mapserver-users mailing list