PHP MapScript zoompoint

Daniel Morissette dmorissette at DMSOLUTIONS.CA
Wed Apr 6 21:10:27 PDT 2005


Camden Daily wrote:
> It seems that many of the member values of mapscript objects are not
> directly accessible.  They are only available to be set with the set()
> function.  I do not know if this is a bug or a design decision, but it
> would certainly be nice to make those variables all public.
>

You need to use the set() methods to set any member variables in PHP
MapScript objects. This is because PHP MapScript objects are just PHP
wrappers on top of the MapServer C structures, and when you set the
variables explicitly using $point->x=1; then the value in the PHP
wrapper is set, but the value is not propagated to the lower-level
object inside MapServer because there was no way in PHP 4 to trap a
change to an object member variable.

In PHP5 this has been fixed, it will be possible to have callbacks
(internally) to catch the change to the member variables and we'll be
able to get rid of the set() methods... but this has not been
implemented yet for PHP MapScript.

Daniel
--
------------------------------------------------------------
  Daniel Morissette               dmorissette at dmsolutions.ca
  DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------



More information about the MapServer-users mailing list