FW: [Mapserver-users] Map files CGI - PHP MapScript
bwragg at tpg.com.au
Wed Dec 4 15:53:13 EST 2002
On Tue, Dec 03, 2002 at 12:52:14PM +1030, Benjamin Wragg wrote:
> If I now zoom in on the map, is it possible to reuse the $map object
> used in the above lines of code, or do I need to recreate the object
> again, resulting in the parsing of the map file again and reloading
> and restoring of the data connections?
Yes, you need to recreate everytime the state. You can do that through
hidden variables in a form, session variables, databases, or just saving
the mapfile, as in:
$map = ms_newMapObj("europe.map");
/* Calculate the new extent */ $map->setextent($newx,$newy,$newz,$neww);
then mynewmap.php has the new extent, the next iteration you load the
new map instead of the old one... you could also overwrite the old one.
This issue is explained in the PHP-Mapscript by Example HOWTO, but I
guess you already read it, as your example shows :)
You can override almost all aspects of a mapfile with PHP/Mapscript,
with the notable exception of symbols (you must provide a symbol file,
with the symbols defined as in the docs).
Vinko Vrsalovic <el[|- at -|]vinko.cl>
More information about the mapserver-users