[Mapserver-users] MapServer and Java
Steve Lime
steve.lime at dnr.state.mn.us
Tue Feb 11 13:07:35 PST 2003
I wrote a simple java (bean) wrapper for the CGI version of MapServer that would
allow the programmer to build a service call programatically and then submit a request
that service. That combined with a simple template on the MapServer side results in a
hash of parameters to be returned to the calling program. The base id, extent, image
names and so on could be nabbed that way. MapServer could also respond with straight
XML is so desired. Here's an example usage:
MapServerBean msb = new MapServerBean();
HashMap content;
msb.setMap("MAPFILE");
msb.setMapsize("500 500");
msb.setLayers("mypoints"); // multiple layers seperated by spaces
// points to add to the map (3rd column is a label)
msb.addPoint(492428.9862,4971809.3571,"55118","mypoints");
msb.addPoint(402100.0259,5134187.6075,"56425","mypoints");
msb.addPoint(293507.7264,5273181.9598,"56542","mypoints");
msb.addPoint(283147.0886,5188256.4327,"56501","mypoints");
try {
content = msb.getMap();
} catch (Exception e) {}
The template used by MapServer is something like:
mapext=[mapext]
img=http://[host]:[port][img]
Seemed to work ok. Source is available if anyone cares...
Steve
Stephen Lime
Data & Applications Manager
Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937
>>> <christian.schuster at rsag.ch> 02/11/03 12:31AM >>>
Hi List,
My problem is that I am working on a WebApplikation based on Java. Now, we
also will need to include geographic pictures for references purposes. The
data are in PostgreSQL. Now, I have a working MapServer and I can bring up
the pictures using PostGIS. But what I would like is just to get the name
of the pictures (eq image, refimage, scalebar, legend) MapServer has
created which I can then load into to the WebApplikation with normal GET
calls to the server. I looked at Mapplet. But this is not really what I am
looking for. Is there a possibility to get the names of the picture
MapServer created?
Regards,
Christian Schuster
Rudolf Schuster AG
Postfach 277
CH - 3000 Bern 11
http://www.rsag.ch
++41 31 348 05 30
_______________________________________________
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