#include "sym.h"
#include "svg.h"
+#include "labeller.h"
+
static void sym_point_draw(struct symbol *sym, struct svg *svg)
{
struct sym_point *p = (struct sym_point *) sym;
{
case VALUE_CIRCLE:
svg_push_element(svg, "circle");
- svg_set_attr_dimen(svg, "cx", n->x);
- svg_set_attr_dimen(svg, "cy", n->y);
- svg_set_attr_dimen(svg, "r", p->size / 2);
+ svg_set_attr_dimen(svg, "cx", p->x);
+ svg_set_attr_dimen(svg, "cy", p->y);
+ // svg_set_attr_dimen(svg, "r", p->size / 2); // DEBUG HACK
+ svg_set_attr_dimen(svg, "r", 3);
break;
// FIXME: Other shapes
default:
style_get_number(si, PROP_SYMBOL_FILL_OPACITY, &sp->fill_opacity);
}
- sym_plan(&sp->s, sym_zindex(o, si, 4));
+ //sym_plan(&sp->s, sym_zindex(o, si, 4));
+ labeller_add_point(&sp->s, o, sym_zindex(o, si, 4));
}
struct symbolizer symbolizer_point = {
// sir->opacity = 1;
// style_get_number(si, PROP_ICON_OPACITY, &sir->opacity);
- sym_plan(&sic->s, sym_zindex(o, si, 4));
+ switch (o->type)
+ {
+ case OSM_TYPE_NODE:
+ labeller_add_point(&sic->s, o, sym_zindex(o, si, 4));
+ break;
+ case OSM_TYPE_WAY:
+ if (!osm_way_cyclic_p((struct osm_way *) o))
+ {
+ labeller_add_linelabel(&sic->s, o, sym_zindex(o, si, 4));
+ break;
+ }
+ case OSM_TYPE_MULTIPOLYGON:
+ labeller_add_arealabel(&sic->s, o, sym_zindex(o, si, 4));
+ break;
+ }
}
struct symbolizer symbolizer_icon = {