Hello again,

I reply to myself in case someone would need it too.

Styles are sorted by name in the std::map containing the styles of the
mapnik::Map.
So, as I loop in the styles to add them to my layers (matching style name),
if I give a correct name they will be added in the right order and will be
drawn the right way:
e.g.
this will be correct :
<Style name="road_00_border"> <!-- draw large dark border line -->
    <Rule>
        <LineSymbolizer ... />
    </Rule>
</Styles>
<Style name="road_01_fill"> <!-- draw thin light inner line -->
    <Rule>
        <LineSymbolizer ... />
    </Rule>
</Styles>

this will be wrong, because "_00_" is drawn before "_01_"
<Style name="road_00_fill"> <!-- draw thin light inner line -->
    <Rule>
        <LineSymbolizer ... />
    </Rule>
</Styles>
<Style name="road_01_border"> <!-- draw large dark border line -->
    <Rule>
        <LineSymbolizer ... />
    </Rule>
</Styles>

but be carefull, styles are sorted only in the std::map inside the
mapnik::Map object. The order you add them on layers is the only one that
defines which will be drawn first.


Nicolas Gillet wrote:
> 
> Hello,
> 
> thank you for your answers.
> 
> Actually I cannot declare my layers in the XML file because before to
> create the tile I don't know if I will need one or two shapes for the data
> source. (e.g. if I render a tile on a border of 2 or 3 shape files)
> 
> I had already thought to the SQL solution but it would need many other
> changes so I keep it as a B plan.
> 
> So I guess that using only <Style> and <Rules> with unsorted shape files I
> cannot ensure that my roads will be drawn in the right order.
> 
> Nicolas
> Gillet
> 
> 

-- 
View this message in context: 
http://www.nabble.com/roads-are-dripping-tp25403701p25432893.html
Sent from the Mapnik - Users mailing list archive at Nabble.com.

_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to