dBox with mode=itemquery or itemnquery
Richard Greenwood
richard.greenwood at GMAIL.COM
Tue Jul 25 18:59:07 PDT 2006
So Steve, your suggestions for itemquery (below) work great. In
mapserv.js I do not see any support for saved queries. Am I missing
anything? Are saved queries still the way it's done, or is there some
new and improved method?
I'm thinking of adding something to mapserv.js like:
if (this.savedqueryfile)
this.url += '&queryfile=' + this.savedqueryfile;
Adding an "itemqueryoptions" to the Mapserv object, and a couple
methods to add and remove a saved query file.
Using a template like:
[img],[shpminx],[shpminy],[shpmaxx],[shpmaxy],[queryfile]
Is this reasonably consistent with your stuff or am I in left field?
Rich
--
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com
On 7/17/06, Steve Lime <Steve.Lime at dnr.state.mn.us> wrote:
> Rich: This is where AJAX can really help. The dbox code really doesn't help you here. It gives you the
> tools to do something with the query result but not with the query itself.
>
> So, to do this you need 2 things or so:
>
> 1) a method that is called to trigger the search (e.g. myLookup), and process the response
> 2) a query template(s) to package the results for use in the client
>
> One might look like:
>
> function myLookup(map, layer, item, term)
> {
> var URL = map.mapserver + '?map=' + map.mapfile + '&mode=itemquery&qlayer=' + layer + '&qitem=' + item + '&qstring=' + term;
> var response = get_content(URL);
>
> // parse the response somehow, check for errors and such... (in this case the response is just a delimeted line, see template)
> var tokens = response.split(',');
>
> map.setExtent(tokens[1], tokens[2], tokens[3], tokens[4]);
> map.draw();
> }
>
> Two might look like (simple delimited response):
>
> [NAME],[shpminx],[shpminy],[shpmaxx],[shpmaxy]
>
> Does this sort of make sense? You could respond with XML and use that to drive some interface stuff- your choice. I suppose one could write a dbox add-on to turn myLookup into a more formal feature of the software with a callback and all.
>
> Steve
>
> >>> Richard Greenwood <richard.greenwood at GMAIL.COM> 7/17/2006 10:05:27 AM >>>
> I am working with Steve's dBox and mapserv.js. It's great stuff. Does
> anyone have any examples or suggestions for using mode=itemquery or
> itemnquery? Specifically, how are you getting the new extent from the
> server into the javascript map object? And how are you updating the
> main map image (in mode=map you get an image back, but in
> mode=anything_else you get an image in a directory on the server).
>
> Rich
More information about the MapServer-users
mailing list