[mapserver-users] Dynamic Layers PHP/Mapscript

Daniel Morissette morissette at dmsolutions.ca
Wed Aug 15 07:12:48 PDT 2001


> Jim Burnett wrote:
> 
> Here is what I am trying...
> I am turning the status of my 2nd layer to "on" but it still doesnt
> show up.
> 
> $mapObj = ms_newMapObj("$dataPath/$map.map");
> $layerObj = $mapObj->getLayer(1);
> $layerObj->status=1;

Setting '$layerObj->status=1' directly does not update the internal
MapServer data structures... you have to use

  $layerObj->set("status", 1);

or even better:

  $layerObj->set("status", MS_ON);

This applies to setting values in any of the MapScript objects in PHP.

<LONG_STORY>
I know this kind of sucks but unfortunately we're stuck with this
because of the way things work internally in PHP.  Last time I checked
there was still no way for a PHP module to have a callback or an event
trigerred when one of its class members was changed by the script... so
the only way around this is using the set() method.
</LONG_STORY>

-- 
------------------------------------------------------------
 Daniel Morissette               morissette at dmsolutions.ca
 DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------
  Don't put for tomorrow what you can do today, because if 
      you enjoy it today you can do it again tomorrow.




More information about the MapServer-users mailing list