[Mapserver-dev] New msCloneLayerObj() function
Sean Gillies
sgillies at frii.com
Tue Feb 18 11:13:36 EST 2003
On Monday, February 17, 2003, at 01:23 PM, Jan Hartmann wrote:
>
>
> Sean Gillies wrote:
>
>> int msCopyLayer(layerObj *dst, layerObj *src, mapObj *map);
>> I picked the argument order to resemble memcpy(). The mapObj is
>> needed as a final argument because the destination layer needs a
>> pointer to it's parent map.
>
> Sean,
>
> The layerObj struct already has a pointer to its parent map (as well
> as to its own index in the map->layers array). Almost all bookkeeping
> you need is already available. I discovered this when implementing
> connection pooling; most of my original code could be discarded after
> that.
>
> Jan
>
>
Jan,
Yes, you are right: initLayer() sets the map for a layer. Thanks for
the
advice.
I've committed mapcopy.c to CVS, as well as a copy() extension to mapObj
in mapscript.i and a unit testing script in mapscript/python/tests.
I've written further notes about my work in Bugzilla. See Bug 272.
Sean
--
Sean Gillies
sgillies at frii.com
http://www.frii.com/~sgillies
More information about the mapserver-dev
mailing list