[ka-Map-users] Layers in reverse order

Paul Spencer pspencer at dmsolutions.ca
Sun Jan 8 10:50:25 EST 2006


Marc,

it appears to be a problem caused by recent changes to init.php to  
accomodate the layer visibility changes (layer tiles not loaded until  
they become visible).  If you load init.php directly, you will see  
the __base__layer is last.

Looking in init.php, it seems that the code to check for ungrouped  
layers comes after the code to check for grouped layers, so ungrouped  
layers are added last.  This is incorrect as it does not respect the  
layer order of the map file.

I don't have a map file handy to test this case.  Perhaps you could  
try moving the code block from lines 169-224 up to line 66.  I  
haven't looked closely at this, so I'm not sure that would work  
without changes, but it might :)

Another problem we should consider: what happens if layers are in the  
'base' group (or any other group for that matter) but are not  
contiguous in the map file?  ka-Map obviously cannot handle this.  I  
believe the right answer is to render the groups in the order in  
which they appear in the map file, regardless of the order of  
subsequent layers.  This won't produce the same result as just  
rendering the map file, but it seems the only logical way of handling  
it.

Further to this problem, what happens if an ungrouped (__base__)  
layer is not the first layer in the map file?  This means the Base  
group shouldn't appear at the top.  But we restrict movement and  
visibility of the 'Base' layer.  Should we force the Base layer to  
the top?  Or should we remove restrictions on movement/visibility?

Looking for input from all on this :)

Cheers

Paul

On 6-Jan-06, at 8:50 PM, Marc Pfister wrote:

> This is stumping me – the layers are coming in in reverse order.  
> You can see it at:
>
>
>
> http://www.enplan.com/mapserver/kamap-cvs/index.html
>
>
>
> The parcels end up on the bottom and the shaded relief on top.
>
>
>
> Mapfile is below. It works fine in the release version of Ka-Map.
>
>
>
> Thanks for any help or pointers.
>
>
>
> Marc
>
>
>
>
>
>
>
>
>
> MAP
>
>   NAME "Lidar Map"
>
>   STATUS ON
>
>   DEBUG ON
>
>   EXTENT 6428000 2064000 6458000 2112000
>
>   SIZE 400 550
>
>   SHAPEPATH "C:/Inetpub/ENPLAN/mapserver/maps/data"
>
>   FONTSET "C:/Inetpub/ENPLAN/mapserver/fonts/fontset.txt"
>
>   IMAGETYPE PNG
>
>   IMAGECOLOR 204 204 204
>
>   UNITS FEET
>
>   WEB
>
>     IMAGEPATH "C:/Inetpub/ENPLAN/mapserver/maps/tmp/"
>
>     IMAGEURL "/mapserver/maps/tmp/"
>
>   END
>
>   PROJECTION
>
>     "init=epsg:102641"
>
>     ""
>
>     ""
>
>   END
>
>   SCALEBAR
>
>     STATUS ON
>
>     UNITS FEET
>
>     STYLE 1
>
>   END
>
>   OUTPUTFORMAT
>
>     NAME "png"
>
>     MIMETYPE "image/png"
>
>     DRIVER "GD/PNG"
>
>     EXTENSION "png"
>
>     IMAGEMODE RGB
>
>   END
>
>
>
>  LAYER
>
>     NAME "Hillshade"
>
>     STATUS ON
>
>     DATA "ReddingRGB.tif"
>
>     TYPE RASTER
>
>     UNITS FEET
>
>     PROJECTION
>
>       "init=epsg:102641"
>
>       ""
>
>     END
>
>   END
>
>
>
>
>
>
>
>   LAYER
>
>     NAME "roads major"
>
>
>
>     STATUS on
>
>     DATA "rddroads_dis"
>
>     TYPE annotation
>
>     UNITS FEET
>
>     PROJECTION
>
>       "init=epsg:102641"
>
>     END
>
>     LABELITEM "FULL_NAME"
>
>
>
>     LABELMINSCALE 11000
>
>     CLASS
>
>       EXPRESSION ('[MAJOR_RD]' eq 'MAJOR')
>
>       STYLE
>
>             COLOR -1 -1 -1
>
>       END
>
>       LABEL
>
>         COLOR 255 255 255
>
>         SHADOWCOLOR 31 31 31
>
>         SHADOWSIZE  3 3
>
>         TYPE truetype
>
>         FONT arial
>
>         SIZE 7
>
>         ANTIALIAS TRUE
>
>         POSITION auto
>
>         ANGLE auto
>
>         PARTIALS false
>
>         MINDISTANCE 20
>
>
>
>         BUFFER 4
>
>       END #label
>
>     END #class
>
>   END #layer
>
>
>
>   LAYER
>
>     NAME "poi"
>
>     STATUS on
>
>     DATA "rddpoi"
>
>     TYPE annotation
>
>     GROUP 'Points of Interest'
>
>     UNITS FEET
>
>     PROJECTION
>
>       "init=epsg:102641"
>
>     END
>
>     LABELITEM "NAME"
>
>     CLASS
>
>       STYLE
>
>             COLOR -1 -1 -1
>
>       END
>
>       LABEL
>
>         COLOR 255 204 102
>
>         SHADOWCOLOR 31 31 31
>
>         SHADOWSIZE   2 2
>
>         TYPE truetype
>
>         FONT arial
>
>         SIZE 8
>
>         ANTIALIAS TRUE
>
>         POSITION cc
>
>         ANGLE 0
>
>         PARTIALS false
>
>         MINDISTANCE 25
>
>
>
>         BUFFER 4
>
>       END #label
>
>     END #class
>
>   END #layer
>
>
>
> LAYER
>
>     NAME "parcels"
>
>     STATUS on
>
>     GROUP 'Parcels'
>
>     DATA 'SCRparcel2003poly'
>
>     TYPE polygon
>
>     UNITS FEET
>
>     PROJECTION
>
>       "init=epsg:26741"
>
>     END
>
>
>
>     CLASS
>
>       NAME "Bounds"
>
>       STYLE
>
>         OUTLINECOLOR 255 102 102
>
>         ANTIALIAS TRUE
>
>       END
>
>     END
>
>   END #layer
>
>
>
>
>
>   LAYER
>
>     NAME "roads"
>
>     STATUS on
>
>     GROUP 'Roads'
>
>     DATA "rddroads_dis"
>
>     TYPE line
>
>     UNITS FEET
>
>     PROJECTION
>
>       "init=epsg:102641"
>
>     END
>
>     LABELITEM "FULL_NAME"
>
>     LABELMAXSCALE 11000
>
>     CLASS
>
>       STYLE
>
>             COLOR 255 255 255
>
>       END
>
>       LABEL
>
>         COLOR 255 255 255
>
>         SHADOWCOLOR 31 31 31
>
>         SHADOWSIZE  3 3
>
>         TYPE truetype
>
>         FONT arial
>
>         SIZE 7
>
>         ANTIALIAS TRUE
>
>         POSITION auto
>
>         ANGLE auto
>
>         PARTIALS false
>
>         MINDISTANCE 50
>
>         MINFEATURESIZE auto
>
>         BUFFER 4
>
>       END #label
>
>     END #class
>
>   END #layer
>
>
>
> END
>
> n
>
> Marc Pfister
> ENPLAN
> mpfister at enplan.com
> 530/221-0440
> 530/221-6963 Fax
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users

+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+







More information about the ka-Map-users mailing list