[Mapserver-users] how do i make an image pop-up in a new window

Sean Gillies sgillies at frii.com
Sat Dec 13 17:04:22 PST 2003


On Saturday, December 13, 2003, at 05:00  PM, jon wrote:

> i have a map of lower manhattan with small polygons showing locations  
> of murals.
>
> the murals are shown as polygons and the data from them is from points  
> in a shape file.
>
> i would like to be able to click on one of these polygons and have an  
> image of the associated mural appear.
>
> can anyone help me?
>
> thanks,
>
> jdm
>
>

Jdm,

Should be easy to do.  In QUERY mode (see the reference

http://mapserver.gis.umn.edu/doc40/cgi-reference.html )

MapServer will process a query template defined within a CLASS in
your mural layer.  You're already using a template to return a
map of murals, and the query template is much the same.  The major
difference is that you can use variable substitutions to put attributes
of queried features into your HTML template.

Let's assume that your murals polygons have an attribute called ID, and
similarly named images (like mural_1.jpg) are available through
URLS like 'http://www.murals.org/images/mural_1.jpg'.  Your query  
template
file could be as simple as:

<html><body>
<img src="http://www.murals.org/images/mural_[ID].jpg">
</body></html>

Template reference:

http://mapserver.gis.umn.edu/doc40/template-reference.html

To get your query result to pop up in a new window, look at some
example like in this thread:

http://mapserver.gis.umn.edu/data2/wilma/mapserver-users/0112/ 
msg00023.html

Hope this is helpful,
Sean

--
Sean Gillies
sgillies at frii dot com
http://www.frii.com/~sgillies




More information about the MapServer-users mailing list