[Mapserver-users] Problem setting up direct URLs when using MapScript

AMC Story s9646183 at sms.ed.ac.uk
Tue Jul 22 07:03:48 PDT 2003


Hi there,

My problem is that I've set up a user interface to my application using perl 
MapScript.  The script utilises a form that passes back variables such as the 
current map extents, previous map extents, mouse click locations, modes (ie. 
pan north, zoomin, previous extent etc), active layers and so on.  I then use 
MapScript to manipulate these variables, set the new extents and active layers 
accordingly and then redraw the map.  

So, the user is first presented with a screen that lists all the features of 
interest (i.e. all the point objects in my shapefile).  The user can then click 
on the url of each feature to go to the map interface page and see a map that 
is zoomed in to that point.  The user can also click on an image on the opening 
page which submits a form with the hidden variable "mode" set to "full_extent", 
so that they see the whole world map with all the features displayed.

The problem is, that when you click on the url (which looks like this...
<a href="http://file_path/script?lon=123.64&lat=-0.51&mode=each_feature">) the 
variables are passed and the script runs.  The script then works out the extent 
of the new map based on these variables and a new map should be created with 
this extent (ie the extents for $current_map are set to their zoomed in values, 
and then the $current_map->draw method draws the map).  However, to see the 
zoomed in map, you have to manually refresh the browser, or put in a line to 
the script which does this automatically for you.  Otherwise, the map is drawn 
as if the extent values haven't actually been changed from those in the map 
file.  Can anyone see why this might be the case?  I've printed out the extents 
of the map object just before it gets drawn, and they definately have been 
updated, but the map object that is drawn doesn't seem to reflect this..??

Sorry if this is a really long-winded e-mail ;)

Many thanks for any thoughts,
Ali



More information about the MapServer-users mailing list