[mapserver-users] Perl/Mapscript

Stephen Lime sdlime at mninter.net
Wed Oct 3 01:04:02 EDT 2001


These are all correct. Image color is set like this:

  $map->{imagecolor}->{red} = 233;

and so on for the green and blue components. This is different from other
colors because of how a palette is built for an image. The image color is
allocated when the image is created and we need to keep the 3 components.

Projection objects cannot be manipulated directly. There is a helper
method (setProjection) that takes a string of Proj.4 commands as input.
That method is available in layerObj and mapObj. There is also a projObj
contructor and methods to do projections. The projection object is new for
3.5, previously being handled through seperate modules.

Extents are better documented. Use $map->{extent}->{minx} and so on to
access those members.

Steve

Paul Ramsey wrote:

> Interesting something happening with the perl binding:
>
> $map->{imagecolor} returns a colorObj, which is a standard hash
> reference. mapscript::colorObj=HASH(0x82195c4)
>
> $map->{projection} returns a projectionObj, which is a SCALAR reference
> for some reason. mapscript::projectionObj=SCALAR(0x83bb834)
>
> Similarly, $map->{extent} returns a rectObj, which is also a scalar
> reference.
> I have no idea what to do with these scalar references. Anyone have any
> light they can shine?




More information about the mapserver-users mailing list