XMLHttp Object and Mapserver

Steve Lime steve.lime at DNR.STATE.MN.US
Mon Dec 20 17:10:28 EST 2004


J.F. and I were talking about recently. Lot's of possibilities. Not so
much for images because you can already do that with javascript and
image objects, but it's come in handy for handling legends and
configuration information. I've got a couple of examples running that
use the technique.

http://www.dnr.state.mn.us/maps/landview_dhtml_x.html?layers=dlgstln2+lakes

Uses the XMLHttp object to grab new legends controls from the MapServer
CGI (HTML legend plus mode=legend). I've got a small DHTML class that
anchors a DHTML element to an inline element (eg. image) and has a
method to retrieve a URL and display it in the element (adds scrollbars
too), makes page design easy. The images (map, reference and scalebar)
are grabbed from MapServer CGI using your standard
"document.imagename.src=..." code.

http://maps.dnr.state.mn.us/mapserver_demos/wcs/demo.html

Uses the XMLHttp object to grab the WCS capabilities response and
builds the application from that. Sort of a smart configuation. The
capabilities output is run through "XML for <script>" and used as a DOM
object. (http://xmljs.sourceforge.net/)

http://maps.dnr.state.mn.us/deli/data_catalog.html

Pick a layer. The resulting page uses the XMLHttp object to grab
metadata reports generated by JSP pages. The metadata is then dumped
into a <div> that is surrounded by our look and feel. The reports are
part of another application and it was easier to steal the content from
it then re-write or re-architect the java code.

In all cases the XMLHttp object works very well, and has proven very
portable (if you don't have to support Netscape 4.x)...

Steve

>>> Jean-Francois Doyon <Jean-Francois.Doyon at CCRS.NRCAN.GC.CA>
12/20/2004 11:52:58 AM >>>
Mike,

Yup.  Steve Lime has an application that uses it, and I do something
similar, but without XML. I use HTML as if it was XML, to pass
structured
data, it's cheating, but is much easier on the browser ... The basic
paradigm remains the same however.

My interface should be ready to look at in January, or April 1st at
the
latest.  Steve can point you to his app.

This way of approaching interface design with the CGI opens up a world
of
possibilities, I've been having lots of fun with it.

J.F.

-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU]On

Behalf Of Mike Davis
Sent: December 20, 2004 12:47 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] XMLHttp Object and Mapserver


I have been following the dissection of the new Google Suggest
(http://www.google.com/webhp?complete=1&hl=en) service with great
interest.  Particularly the use of the XMLHttp object to transfer data
back and fourth from the server without re-loading the page.
Apparently this feature (originally created by Microsoft) has been
implemented in Mozilla and Safari (with some minor differences) and is
for all intents and purposes "cross platform".  Check out the code
dissection here:

http://serversideguy.blogspot.com/2004/12/google-suggest-dissected.html


I am curious if anyone has implemented, or considered using this
method to swap map images using the mapserver cgi?

-Mike



More information about the mapserver-users mailing list