[ms4w-users] Problem with layer ordering
Bart van den Eijnden (OSGIS)
bartvde at xs4all.nl
Tue Sep 26 12:52:10 EDT 2006
You are asking this to the wrong list. MS4W is about the installer
environment only.
Try the mapserver-users list.
http://mapserver.gis.umn.edu/community/mailinglists/mapserver-users/
Best regards,
Bart
Russell H. DeGrove schreef:
> I am trying to change the order layers are rendered in. I'm using
> SWIG for C#.
>
> Code is as follows
>
> // "mObj" is a mapObject.
> // "list" is a list of "Layer" objects which aren't layerObjs
> but which do reference layerObj names
> // "list" is in the order I want, and when this code is reached I've
> verified that every Layer in "list" has a corresponding layerObj in mObj
>
> intarray arr = new intarray( list.Count );
> int arrIndex = 0;
> bool hasDiff = false;
>
> foreach ( Layer reqLay in list )
> {
> // find the layer object by the request layer's ID
> layerObj lObj = mObj.getLayerByName( reqLay.ID );
> if ( lObj == null )
> {
> throw new ApplicationException( "SetLayerOrdering must
> not be called until new layers are merged into the map state." );
> }
>
> // is layer order different from the original order
> if ( arrIndex != lObj.index )
> {
> hasDiff = true;
> }
>
> // add the index to the intarray
> arr.setitem( arrIndex++, lObj.index );
> }
>
> // set drawing order if any differences are found
> if ( hasDiff )
> {
> mObj.setLayersDrawingOrder( arr.cast() );
> }
>
> I can step through the code and see that mObj.setLayersDrawingOrder
> gets called when there are changes but the subsequent map rendering
> does not reflect the change in ordering. Can anyone suggest what I
> might be doing wrong?
> ------------------------------------------------------------------------
>
> _______________________________________________
> ms4w-users mailing list
> ms4w-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ms4w-users
>
--
Bart van den Eijnden
OSGIS, Open Source GIS
http://www.osgis.nl
More information about the ms4w-users
mailing list