[Mapserver-users] Bounding Box options in Mapserver

Lowell Filak lfilak at medinaco.org
Tue Jul 22 06:00:23 PDT 2003


The answer depends on what you want the user interface to behave like.
Because MapScript in general is a server-side operation it does not
allow you to generate an interface where the user can interactively
digitize both coners of a box and view the "drag the box" effect in the
process.
I believe for the "drag" effect it requires one of the two options you
mentioned.
However, if you don't need the drag effect you could make a call to a
PerlMapScript CGI for each corner click and then use a "zoom box"
routine to set the new map extents.
A sample of code is in the wiki at:
http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?PerlMapScriptExamples35ex2
under the set_extent routine with one difference:
instead of centering on a point and adding & subtracting from that point
to set the new extents you would use the picked coordinates as the extents.
HTH
Lowell

The following message was sent by "James Wharfe" <s0231180 at sms.ed.ac.uk>
on Tue, 22 Jul 2003 10:55:48 +0100.

> Hello list,
> 
> I was wondering if anybody had any examples of a bounding box function
> written in Perl Mapscript? What I want to do is allow the user to draw a
> rectangle on the Mapserver map image downloaded to their browser, and have
> the extents of that rectangle passed back to the Mapserver application in
> order to render a new map image based on the user-defined bounding box. If
> anyone has hints, pointers or even code that would be great!.
> 
> I have looked at the other options just in case this can't be done ie.
Jbox
> or Bbox. Bearing in mind that I'm trying to avoid using Javascript (am I
> just making things difficult here??) what do folks think the more
> appropriate solution?
> 
> Thanks alot,
> James.
> 
> _______________________________________________
> 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