[mapserver-users] java mapplet tooltips -- question

Stephen Lime steve.lime at dnr.state.mn.us
Fri Jun 1 11:34:42 EDT 2001


I've played with this in the past a little bit. My idea was to export addtribute data along with a transformed coordinate information as an XML file that the applet could use for mouse over display. Sort of a geographic image map. A version of the mapplet is available to do this although it needs to be brought in sync with the main version. You can download it at:

  http://maps.dnr.state.mn.us/java/mapplet_xml

There are a couple of examples on the DNR site that use it or variations.

  http://www.dnr.state.mn.us/cgi-bin/mapdoqs.pl

Is a MapScript app to browse DOQs for the state of MN. If you zoom in you'll also see red dots that represent GNIS points. Move the mouse over them and you'll get a few attributes in a popup window.

  http://www.dnr.state.mn.us/weather/map.html

Uses the base code and adds support for a second XML file, one for cities and another for counties. Same idea though.

Note that the applet requires the Aelfred XML parser. It's super light and well suited for applets. I'd like to be able to control the presentation within the popup window more but with Java 1.2 that's difficult. I imagine templates could be used here to create some really nice effects.

Anyway, one idea...

Steve

Stephen Lime
Internet Applications Analyst

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937
>>> "Robert Chavez" <rchavez at perseus.tufts.edu> 06/01/01 09:07 AM >>>
Greetings,

I'm trying to add some functionality to Steve's mapplet and I'm wondering if
anyone has some advice.

What I want to do is add a little java method and javascript so that when a
user mouses over a feature in a plotted layer, information about that
feature appears in a popup tooltip layer.  Kind of an alternate way of
displaying label information.

Some of the tooltip info will come directly from the Shapefile, other info
will come from a PostGres database.  I don't have a problem getting the
tooltip info out of the shapefiles and database and processing it.  Since
I'm using mapscript I can pull that information out of the appropriate place
and embed it in the output HTML in <div> tags that a JavaScript can pick up
and display..

The problem for me is how to get the applet and JavaScript communicating
properly.  I'm having some trouble figuring out how to get a mouseover on a
feature in the applet map to tip off the JavaScript to display the tooltip.

Any advice/suggestions would be greatly appreciated.
Thanks,
Rob





More information about the mapserver-users mailing list