SWIG mapscript request/bug? - WORKAROUND

Ryan, Adam ARyan at CO.LINN.OR.US
Tue Jan 25 19:30:37 EST 2005


And the workaround is...

When you're reordering layers AND you want to do a drawQuery(), reorder the
layers and then save the map file and then load it again and then
drawQuery().  Ugly.

Adam

> -----Original Message-----
> From: Ryan, Adam [mailto:ARyan at CO.LINN.OR.US]
> Sent: Tuesday, January 25, 2005 4:21 PM
> To: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: Re: [UMN_MAPSERVER-USERS] SWIG mapscript request/bug?
>
>
> Alright folks,
>
> Thanks to Sean I've figured out how to reorder the layers of
> a map.  Now it turns out that the reordering is only
> recognized when doing a mapObj.draw() and NOT when doing a
> drawQuery().  What's up with that?
>
> Oh what to do?!?
>
> Cheers, Adam
>
> > -----Original Message-----
> > From: Ryan, Adam [mailto:ARyan at CO.LINN.OR.US]
> > Sent: Tuesday, January 25, 2005 3:05 PM
> > To: MAPSERVER-USERS at LISTS.UMN.EDU
> > Subject: Re: [UMN_MAPSERVER-USERS] SWIG mapscript request/bug?
> >
> >
> > > -----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