Steve,

Thanks for the reply. Your approach makes total sense. I was sort of
thinking along those lines, but I figured I'd check in with the
experts before I tried to implement it myself.

Different topic - I have a partial javascript port of the Proj.4 CS2CS
program for client-side coordinate system transformations. I've got a
demo of it with dBox which I hope to get on a public site soon.

Rich

--
Richard Greenwood
[EMAIL PROTECTED]
www.greenwoodmap.com



On 7/17/06, Steve Lime <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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

--
Richard Greenwood
[EMAIL PROTECTED]
www.greenwoodmap.com


Reply via email to