SWIG mapscript request/bug?

Ryan, Adam ARyan at CO.LINN.OR.US
Tue Jan 25 15:05:11 PST 2005


> -----Original Message-----
> From: Sean Gillies [mailto:sgillies at frii.com]
> Sent: Tuesday, January 25, 2005 2:48 PM
> To: Ryan, Adam
> Cc: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: Re: SWIG mapscript request/bug?
>
>
> On Jan 25, 2005, at 3:28 PM, Ryan, Adam wrote:
>
> > Hi.  I'd like to make a request.  In using python mapscript I find
> > that a
> > layer's index property is unchanged after using
> map.moveLayerUp/Down.
> > Shouldn't the index values of the two layers that are swapped be
> > swapped
> > themselves?
> >
> > Is this a bug that I should report?
> >
> > Cheers,
> >
> > Adam
>
> Adam,
>
> A MapServer mapObj has an array of layerObjs and also an array of
> indexes of these layerObjs in drawing order.  It is this second array
> that is modified by moveLayerUp/Down.  Same situation for the other
> mapscripts including PHP.  It's not a bug, just the way that
> MapServer
> is designed.
>
> cheers,
> Sean
>
> --
> Sean Gillies
> sgillies at frii dot com
> http://users.frii.com/sgillies
>

Hey Sean, thanks for the reply.

Maybe you can lend a suggestion.  I want to manipulate the draw order using
a list of layer names from the client.  I'd like to do this:
...
curI = 0
for layerName in layerList:
    layerO = mapO.getLayerByName(layerName)
    while layerO.index > curI: mapO.moveLayerUp( layerO.index )
    curI += 1
...
The problem, if I understand it, is that the layer index is indeed being
moved up in the drawing order, but the index values don't change.  Thus, my
while statement runs forever.

I see there are get/setLayersDrawingOrder methods but how much work is it to
set them up?

Thanks again,

Adam



More information about the MapServer-users mailing list