[mapserver-users] savequery and queryfile / hilite a selected object

Robert Fritz robert-fritz at web.de
Thu May 16 04:17:16 EDT 2002


Hello,

I have the same question as Megan Watson (Message from 26.02.02) about the
use of savequery and queryfile, because unfortunately there was no answer.

Queryfile is useful for "hilite a feature while still in a pan/zoom mode"
(CGI Documentation), this is exactly what I want to do.
But how to use?

I want to do this:

I have an ID and want to zoom und hilite to the Object with this ID via a
Link. I do this using mode=itemquery&id=2345... and a filter set in the
mapfile (Filter ("[ID]" = "%id%").
I get a map with the Object with ID=2345 in red color.

Now I want to keep the hilited object while zooming/paning in the map. I
made a second layer definition for the same shape:

Classitem "ID"
 CLASS
    NAME 'Object selected'
    COLOR  255 0 0
    OUTLINECOLOR 120 120 120
   Expression ("[ID]" = "%id%")
 END
 CLASS
     NAME 'Objects'
    COLOR 255 255 100
    OUTLINECOLOR 0 0 0
    Expression /./
 END
END

For it I have to pass the ID everytime, but the layer displays the selected
object (red) and the other objects of the shape.

It works, but maybe there is a better way, perhaps using
savequery/queryfile?

Sorry for my English :-).

Robert




More information about the mapserver-users mailing list