Having hard time adding layers with php

Daniel Morissette morissette at dmsolutions.ca
Wed Nov 15 08:17:04 EST 2000


Berend Veldkamp wrote:
> 
> btw Can anyone tell me the difference between $layer->set("status", MS_ON);
> and $layer->status = MS_ON; According to the docs 'status' isn't read-only so
> it should work either way?
> 

With objects in PHP, you should be able to set object properties using
$layer->property=value.  However, since PHP MapScript is a wrapper on
top of MapServer C structures, setting properties this way does not
propagate to the C structures and has no effect (there's no way to set a
callback on a property change internally).  

That's why there are set() method on all classes and they should be used
when setting properties.

-- 
------------------------------------------------------------
 Daniel Morissette                morissette at dmsolutions.ca
                 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