[Mapserver-users] php clone() doesn't cut it

Charlton Purvis cpurvis at asg.sc.edu
Tue Feb 3 17:20:25 EST 2004


Hi, folks:

I finally rewrote a raster querying kludge that works well.  At least,
in my opinion.  But I learned the hard way that I can't count on php's
mapObj clone().

If you try to clone() a mapObj and save it to a new variable, everything
will be OK *unless* you try to manipulate the layers.  I could not get
something like the following sequence to work:

(1) original mapObj's first layer is STATUS ON
(2) draw the original map (first layer is drawn)
(3) clone the original map to cloneMap
(4) set the clonMap's first layer to STATUS OFF
(5) draw the clone map (first layer is off)
(6) now draw the original map *** first layer is OFF !!! ***

It is a PHP fault.  Something along the lines of the paragraph that
begins "Want to allow . ." from
http://www.masterofweb.com/item/102/catid/10.

So my workaround was to save my current map state to a .map, and then
create a new mapObj based on that .map.

Just trying to save others some tears and premature graying.

Charlton

 
 
 
Charlton Purvis
(803) 777-8858 : voice
(803) 777-3935 : fax
cpurvis at sc.edu
 
Baruch Institute
University of South Carolina
Columbia, SC 29208





More information about the mapserver-users mailing list