shpxy and points

Fawcett, David David.Fawcett at STATE.MN.US
Mon Apr 10 16:05:48 EDT 2006


OK, the answer is yes.  

The main thing that I had to do was modify the query template for the
layer.  

In the query template for the layer, I put this:
<area shape="circle" coords="[shpxy precision=0 proj=image yf=",7"
xf=","]" href="http://mysite/mypage.cfm?region=[NAME]" >

This takes the map coordinates from the layer, projects them into image
coordinates, and then uses them to build the imagemap.  You also see
'yf=",7" xf=","'.  This tells MapServer to insert a comma after the x
coordinate and a comma and seven after the y coordinate.  (when defining
a circle object in an imagemap, the format is
coords="[xcoord],[ycoord],[radius]")

More documentation is found in the template reference:
http://mapserver.gis.umn.edu/docs/reference/templatereference/templatere
ference#query 

You can also see that in the href, it is using the value in the NAME
field of the shapefile to form the URL.

As with all shpxy queries, you need the header and footer to insert the
opening and closing tags for the imagemap.  

Here is the URL that I used to get the imagemap:

http://mywebsite/cgi-bin/mapserv?map=/web/maps/mymapfile.map&qlayer=site
s&mode=nquery&searchmap=true

Here is the beginning and first two elements of the imagemap:
<map id="mymap" name="mymap"><area shape="circle" coords="80,103,7"
href="http://aqi.pca.state.mn.us/region1.cfm?region=Brainerd" ><area
shape="circle" coords="43,87,7"
href="http://aqi.pca.state.mn.us/region1.cfm?region=Detroit Lakes" >

David.






-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of Fawcett, David
Sent: Monday, April 10, 2006 10:38 AM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] shpxy and points


Does the shpxy method for creating imagemaps work for point layers?  

Does it respect the symbol size or a tolerance value?  

I am using MapServer 4.6.1 and when I try to return an image map using
shpxy, I get a geometry something like: 

<area shape="polygon" coords="80 103" 

instead of shape="circle"

David.



More information about the mapserver-users mailing list