[Mapserver-users] Mouse Over (Attn Steve Lime)
Dave Astolfo
dastolfo1 at cogeco.ca
Fri Feb 20 05:28:55 PST 2004
Steve,
I tried your demo and had some interesting results. I am able to get
the image on the page, but the mouse over does not work. When viewing
the source of the page, I found that it appears that the shpxy is not be
processed by MapServer. I have included some source below. It looks
like it is simply returning the original code from witin the
county_code.html page, but yet it processed the [img] tag from the
header. Any thoughts on this? Is it because my version of MapServer does
not support the shpxy feature? I am running the Win32 binary V4.0.
Thanks,
Dave
--- SAMPLE SOURCE OF PAGE -----
<!-- MapServer version 4.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
OUTPUT=PDF OUTPUT=SWF SUPPORTS=PROJ SUPPORTS=FREETYPE
SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER
SUPPORTS=WFS_CLIENT INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE -->
<!-- start header -->
<html>
<head>
<title>Imagemap Test Page</title>
</head>
<body bgcolor="#ffffff">
<p>This is a test of generating a client-side imagemap from MapServer
using query templates.</p>
<p>Here's the querymap (STYLE=standard)<br>
<img src="/ms_tmp/test10772833593020.gif" usemap="#county"
border="0">
</p>
<!-- end header -->
<map name="county"> <area shape="polygon" coords="[shpxy xf=","
transform]" href="javascript:alert('Lake of the Woods County')"
alt="Lake of the Woods">
<area shape="polygon" coords="[shpxy xf="," transform]"
href="javascript:alert('Kittson County')" alt="Kittson">
<area shape="polygon" coords="[shpxy xf="," transform]"
href="javascript:alert('Roseau County')" alt="Roseau">
<area shape="polygon" coords="[shpxy xf="," transform]"
href="javascript:alert('Koochiching County')" alt="Koochiching">
<area shape="polygon" coords="[shpxy xf="," transform]"
href="javascript:alert('Marshall County')" alt="Marshall">
<area shape="polygon" coords="[shpxy xf="," transform]"
href="javascript:alert('St. Louis County')" alt="St. Louis">
...........................................
---- END SAMPLE SOURCE OF PAGE ----
--- THE SAME SOURCE OUTPUT FROM YOUR PAGE---
<!-- start header -->
<html>
<head>
<title>Imagemap Test Page</title>
</head>
<body bgcolor="#ffffff">
<p>This is a test of generating a client-side imagemap from MapServer
using query templates.</p>
<p>Here's the querymap (STYLE=standard)<br>
<img src="/tmp/test107728272728289.gif" usemap="#county" border="0">
</p>
<!-- end header -->
<map name="county"> <area shape="polygon" coords=" 178,33 179,33 180,34
185,34 185,10 187,10 187,11 192,11 192,10 193,11 193,10 195,12 196,12
196,13 199,13 199,19 200,20 200,25 201,26 201,27 202,28 202,33 203,34
203,38 204,39 204,44 203,44 203,48 204,48 204,49 205,49 205,50 206,50
206,51 207,51 207,52 210,52 210,53 213,53 213,54 214,54 214,74 181,74
181,63 179,63 178,62 176,62 176,51 177,52 187,52 187,39 186,39 186,40
184,40 184,41 180,41 180,40 178,40 178,38 177,38 177,37 178,37 178,35
177,35 177,34 178,34 178,33" href="javascript:alert('Lake of the Woods
County')" alt="Lake of the Woods">
<area shape="polygon" coords=" 133,32 133,33 132,34 132,50 133,50
132,51 132,61 131,60 110,60 109,59 99,59 99,58 100,58 100,59 101,58
100,58 100,56 101,56 101,55 101,54 101,53 102,53 102,52 102,51 103,51
103,50 102,50 102,48 101,48 101,47 101,44 101,43 100,43 100,42 100,39
99,39 99,38 99,37 99,35 99,34 98,34 98,30 108,30 109,31 128,31 129,32
133,32" href="javascript:alert('Kittson County')" alt="Kittson">
--- END---
-----Original Message-----
From: mapserver-users-admin at lists.gis.umn.edu
[mailto:mapserver-users-admin at lists.gis.umn.edu] On Behalf Of Steve Lime
Sent: Thursday, February 19, 2004 12:52 PM
To: cpurvis at asg.sc.edu; pucher at atlas.gis.univie.ac.at; Steve Lime;
mapserver-users at lists.gis.umn.edu; bartvde at xs4all.nl
Subject: RE: [Mapserver-users] Mouse Over
Here's a CGI-based demo.
http://maps.dnr.state.mn.us/cgi-bin/mapserv41?map=/usr/local/www/docs/te
sting/imagemap/test.map&mode=nquery&searchmap
You can download at http://maps.dnr.state.mn.us/testing/imagemap.zip
It's basically just a query that outputs features that have been
transformed (clipped and thinned) to image coordinates. The nice thing
is that you could use this for a component-based system, that is create
the map and the imagemap with seperate calls. The example above uses the
little documented "searchmap" option. This tells MapServer that the
search exent is that of a map so any incoming extent is fit to a map
(width/height) before querying is done. You can also use it with
pan/zoom interfaces (mode is still nquery) and MapServer will apply the
pan/zoom *before* doing the query. I don't know how you'd combine an
imagemap and a strait CGI-form so you could get the tooltips and the
clicking in the map for navigation. It's a start.
Steve
>>> "Steve Lime" <steve.lime at dnr.state.mn.us> 2/19/2004 12:46:07 AM
>>>
I don't know squat about the imagemap output function. As Atilla said
it's on the experimental side. I do have an alternative using queries
and the [shpxy...] tag that may be of interest. It's pretty flexible and
usable from the CGI application. I'll post an example on the DNR
machines tomorrow (can't get to them tonite).
Steve
>>> "Charlton Purvis" <cpurvis at asg.sc.edu> 02/17/04 11:52 AM >>>
Hi, Steve:
Checked out the overlib URL you sent below, and I must admit it's slick.
I'm a little lost, though, what library do I need to make sure I have
installed and part of my ./configure?
I'm trying to monkey around w/ imagemap, a la the Wiki post:
OUTPUTFORMAT
NAME imagemap
MIMETYPE "text/html"
DRIVER imagemap
END
But a shp2img gives me a:
msDrawMap(): GD library error. Unable to initialize image.
Running 4.0.1 and gd-2.0.15.
My MS build looks like it put mapimagemap.c into my libmap.a. Any
hints?
Thanks,
Charlton
> -----Original Message-----
> From: Steve Lime [mailto:steve.lime at dnr.state.mn.us]
> Sent: Tuesday, February 10, 2004 12:51 PM
> To: pucher at atlas.gis.univie.ac.at;
mapserver-users at lists.gis.umn.edu;
> bartvde at xs4all.nl
> Subject: Re: [Mapserver-users] Mouse Over
>
> Hi all: The mapimage w/XML software was really more a
proof-of-concept.
> I never took it any further than that. The source is around if
you're
> interested. There are other possibilities as well. For example, in
4.0
> there actually is a imagemap output object (see
> http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?ImageMap) but I don't
know
> much about it. In 4.1 there is the [shpxy] tag and I've been
planning
to
> add an attribute to allow you to output coordinates in IMAGE
> coordinates. That way you could build an imagemap on the fly via the
> CGI. It could also be used to populate DHTML popup objects (e.g.
> http://www.bosrup.com/web/overlib/).
>
> Would be happy to discuss further.
_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
More information about the MapServer-users
mailing list