dBox map multiple results with itemnquery

Richard Greenwood richard.greenwood at GMAIL.COM
Sat Nov 11 12:39:37 EST 2006


On 11/11/06, Richard Greenwood <richard.greenwood at gmail.com> wrote:
> I am using a simple template to map the results of an itemnquery:
>   [img],[shpminx],[shpminy],[shpmaxx],[shpmaxy],[queryfile]
> from which I parse the 'img' to draw the map and the shpminx, shpminy,
> shpmaxx, shpmaxy, to set the new extents. Works fine for a single
> result.
>
> Multiple results are harder. If I put the template in the HEADER I get
> an image with all results (which is what I want) but I don't get
> shpminx, shpminy, shpmaxx, shpmaxy. Whit my template as TEMPLATE, it
> gets processed for each result. I get the shpminx, shpminy, shpmaxx,
> shpmaxy, but what I really want is shpminx, shpminy, shpmaxx, shpmaxy
> for the whole result set.
>
> I could process each record in JavaScript and save the min & max x &
> y, and assume that will be the extents on the full result set, but I
> don't think that would be reliable.
>
> How can I get the extents of a multi-result image?



In reply to my own question, use:
   [minx],[miny],[maxx],[maxy]
instead of:
  [shpminx],[shpminy],[shpmaxx],[shpmaxy]

Amazing how often I find the answer immediately after posting to the
list. It's like magic!

Rich

-- 
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com



More information about the mapserver-users mailing list