On Wed, 2008-07-30 at 15:08 -0500, Brian Peschel wrote:
> I have a point feature (which I draw as a symbol) I am trying to label
> and isn't working (C++). I modified my data so this symbol is the only
> thing being drawn.
>
> I have two different styles setup. The rule to draw the symbol is:
> <Rule>
> <Filter>[mapnik:geometry] = '1' and [point_symbol] =
> 'cemetery'</Filter>
> <PointSymbolizer file="syms/cemetery.png" type="png" width="20"
> height="20" allow_overlap="true"/>
> </Rule>
>
> which is being drawn. I have a separate rule for the text (I had this
> inside the above rule but it didn't make a difference)
> <Rule>
> <Filter>[mapnik:geometry] = '1' and [point_symbol] =
> 'cemetery'</Filter>
> <TextSymbolizer name="name" face_name="DejaVu Sans Bold" size="8"
> fill="green" dy="-25" halo_radius="1" wrap_width="0"/>
> </Rule>
>
> Looking in the mapnik source, adding in my own debug, I see in
> src/agg_renderer.cpp::process(text_symbolizer ...) that the code is
> getting down into the POINT_PLACEMENT block and is calling
> finder.find_point_placement(). But the loop just below (for (unsigned
> int ii = 0; ii < text_placement.placements.size(); ++ii)) is never
> executing.
This is to be expected since you've set wrap_width=0 (wrap_at gets set
to string_width + 1 and so it fails the if() check a few lines above).
> I seriously doubt there is a problem in the mapnik library, so I assume
> I am doing something wrong. Any ideas? Or do I need to dive into the
> find_point_placement() method?
Does it work if you don't draw the symbol? If so, you may need to
increase the 'dy'. If the text collides with the symbol then it won't be
rendered.
Does other text in that font render OK (at one time the Mapnik code
would silently drop text if the font was not available, I don't know if
this has been fixed or not).
Are you calling freetype_engine::register_font() with the appropriate
DejaVu TTF file?
There was a bug in the wrapping code which prevented names with no
spaces from appearing on the map but I think this only caused a problem
if wrap_width was non-zero. This bug has been fixed in SVN r716.
Jon
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users