dBox howto ?

Steve Lime Steve.Lime at DNR.STATE.MN.US
Mon Nov 6 18:39:33 EST 2006


Hi Lawrence: Here's a simple example I did:

  http://maps.socsci.umn.edu/~lime/2006/test_dbox.html

It's a simple dbox implementation that does use mapserv.js to manage
coordinates on the client side, that is, MapServer is used to create
images and respond to queries, nothing more.  It doesn't have the button
handling and all that other crap that can get in the way of seeing
what's going on. 

Note that this is not the most naive implementation using dbox. It is
possible to use dbox with a normal templated pan/zoom application
(without mapserv.js at all). In this case a dbox event is used to
populate a CGI variable such as imgbox or imgxy and then submit the
form. I tend to prefer using mapserv.js though and do away with
templates.

To be clear:

  - dbox.js is the code that handles a rubber-band box zoom, measure
and area tools, basically any interaction with the map

  - mapserv.js is the code that does all the coordinate handling (e.g.
zoom in, out, box zoom, ...) on the client and builds MapServer CGI
URLs

They do not have to be used together, but have been designed to do so.

Any of the other code (dlegend.js, dcontainer.js) is related to legend
handling which may or may not be of interest. You certainly need not use
it as the example above shows. Please let me know if you have other
questions.

Steve

>>> "Lawrence Hartpence" <hartpence_gis at co.jasper.ia.us> 11/6/2006
7:18:35 AM >>>
Hello,

I have downloaded dbox and looked at different examples that implement
it.
I get confused trying to understand which JavaScript libraries do what.
 Is
there anyone who has a very simple example of implementing the drag
zoom
functionality and nothing else?  My little mind needs to chew on things
in
small increments to be able to understand.

Thanks,

Lawrence Hartpence



More information about the mapserver-users mailing list