Mapext from itemnquerymap?

Steve Lime Steve.Lime at DNR.STATE.MN.US
Mon Jun 11 11:40:23 EDT 2007


For 1) you can't get both an extent and the image using itemnquerymap. The ...map modes return an image stream so there is no way to encode other information. The work around is to use templates and probably AJAX. If you do an itemnquery with the following template:

[img]
[mapext]

You'll get back the base path to the created image (in the temporary directory) and the extent in one little package. You could muck with the format to return XML or JSON to ease parsing on the client. That's your best bet.

For 2) I'd like to see that behavior. Sounds like a bug to me or possibly a conflict with parameters being passed. If you're using 4.10 you could try the [item...] tag as a work around.

Steve

>>> On 6/8/2007 at 11:59 PM, in message <466A33AA.5090007 at mikestreet.ca>, Mike
Street <mike at MIKESTREET.CA> wrote:
> Hi list,
> 
> First, thanks for all the help. I've taken in as much as a lurker can,
> and lately the archives have been my best friend and have solved most of
> my problems. But now I'm stuck on a few things:
> 
> Specs: MS4W with a 'tricked out' version of the Itasca demo and the Rosa
> applet for display. First project, so just CGI, HTML templates, and lots
> of messy javascript. :)
> 
> Details: A basic browse/query/itemnquery setup to find city info (shp
> layers - roads, trains, landmarks, etc.). The map displays in a main
> HTML template frame, the queries display in query frame.
> 
> For query, I use a javascript call in the query frame for the Rosa
> SetImageURL function to display the querymap hilited feature in the main
> frame. (I haven't quite figured out the persistent hilite thing yet, but
> that's not really an issue for this project).
> 
> For itemnquery, the user supplies the base of a qstring in a textbox in
> the mainframe, and the query displays in the query frame. I've then set
> links to the [Name] field of each layer's query template, which supplies
> the final qstring for an itemnquerymap call in the query frame to
> display in the main frame via the Rosa SetImageURL function. (It works
> well as long as there's only one return - more on this below).
> 
> So, with that... everything works okay, except:
> 
> 1. Most of my data are points layers, so I use
> "scale=10000&mapext=shapes" in the itemnquerymap call to centre on the
> point, but of course the main frame still 'remembers' its last extent,
> so I need to reset the mapext (and other stuff) in the
> parent.map_frame.document, so the user can continue on without interruption.
> 
> Question 1: How can I find the mapext used in the 'mapext=shapes' thing
> from the itemnquerymap so I can set the
> parent.map_frame.document.form.mapext.value?
> 
> 2. This one is less important, but totally annoys me because I can't
> understand it. :) Each shp file has 2 fields in common - [Name] and
> [Link]. When the records are returned via the query/itemnquery queries,
> I can use the value of the [Link] (i.e. http://whatever.com) to onclick
> pop a new browser window and load the URL, even if there are multiple
> records. But when I try the same with the [Name] field (set it as a
> link, then onclick to call the script to display the itemnquerymap
> (using the [Name] value as the qstring), the only value for EVERY listed
> record is that of the last returned record of the itemnquery.
> 
> Question 2: So what's up with that? :)
> 
> Sorry for the length. It's probably obvious I lack the correct
> terminology, so I made up for it with verbosity. :)
> 
> I'd appreciate any help, and I promise to <!--comment--> your name (and
> my gratitude) into the live version. :)
> 
> Cheers, and many thanks in advance,
> Mike Street
> 
> 
> 
> 
> _________________________________________________________________
> Need personalized email and website? Look no further. It's easy
> with Doteasy $0 Web Hosting! Learn more at www.doteasy.com



More information about the mapserver-users mailing list