[OpenLayers-Users] OpenLayers vs Mapserver layer rendering order

Ted Spradley tspradley at snoogems.com
Wed Dec 9 12:30:32 EST 2009




Ted Spradley wrote:
> 
> 
> My OL map layer renders my MapServer layers not in the (expected) order of
> the map file.
> 
> The MapServer layer that I would like 'last' or 'on top' is 'zip_codes'. 
> I have placed it first, various places in the middle, and last in the
> OpenLayer addLayers call and it doesn't seem to make a difference.  The MS
> layers 'tl_edges_..' are always drawn on top of 'zip_codes'.  In my map
> file, 'zip_codes' is last and drawn last when rendered directly from
> MapServer.
> 
> How does the OpenLayers rendering of layer order differ from calling
> MapServer directly in the url?
> 
> /* Openlayers Layer */
> 
>  'layers':
> "zip_codes,countries,tl_edges_3,tl_edges_2,tl_edges_1,tl_edges_0,tl_edges_00,parcels,row_annotation"
> 
> 

Found the answer I think.  The WMS spec does state 'A WMS shall render the
requested layers by drawing the leftmost in the list bottommost, the next
one over that, and so on.'  However, observed MapServer behavior responding
to the WMS call is that if the layer STATUS is DEFAULT, then layer those
layers are rendered first, in their mapfile order, then layers listed in the
LAYERS parameter of the WMS call are rendered per the specification.

So, the solution in my case was to change to layer STATUS ON, and the map
was rendered as expected.

Ted S.

Ted S.

-- 
View this message in context: http://n2.nabble.com/OpenLayers-vs-Mapserver-layer-rendering-order-tp4135864p4140768.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list