case element_polyline:
if (e->u.polyline.width > 1)
gc->meth.gc_set_linewidth(gc->priv, e->u.polyline.width);
+ if (e->u.polyline.width > 0 && e->u.polyline.dash_num > 0)
+ graphics_gc_set_dashes(gc, e->u.polyline.width, 0,
+ e->u.polyline.dash_table,
+ e->u.polyline.dash_num);
gra->meth.draw_lines(gra->priv, gc->priv, di->pnt, di->count);
break;
case element_circle:
ITEM(nav_roundabout_l6)
ITEM(nav_roundabout_l7)
ITEM(nav_roundabout_l8)
+ITEM(poi_peak)
+ITEM(poi_rail_station)
/* Line */
ITEM2(0x80000000,line)
ITEM2(0x80000001,line_unspecified)
}
struct element *
-polyline_new(struct color *color, int width, int directed)
+polyline_new(struct color *color, int width, int directed,
+ int *dash_table, int dash_num)
{
struct element *e;
+ int i;
e = g_new0(struct element, 1);
e->type=element_polyline;
e->color=*color;
e->u.polyline.width=width;
e->u.polyline.directed=directed;
+ e->u.polyline.dash_num=dash_num;
+ for (i=0; i<dash_num; i++)
+ e->u.polyline.dash_table[i] = dash_table[i];
return e;
}
struct element_polyline {
int width;
int directed;
+ int dash_num;
+ unsigned char dash_table[4];
} polyline;
struct element_polygon {
} polygon;
void layer_add_itemtype(struct layer *layer, struct itemtype *itemtype);
void itemtype_add_element(struct itemtype *itemtype, struct element *element);
struct element *polygon_new(struct color *color);
-struct element *polyline_new(struct color *color, int width, int directed);
+struct element *polyline_new(struct color *color, int width, int directed,
+ int *dash_table, int dash_num);
struct element *circle_new(struct color *color, int radius, int width, int label_size);
struct element *label_new(int label_size);
struct element *icon_new(const char *src);
<polygon color="#e7cf87" />
</item>
<item type="rail" order="6-">
- <polyline color="#808080" width="3" />
+ <polyline color="#808080" width="3" dash="10" />
</item>
<item type="ferry" order="5-">
- <polyline color="#000000" width="1" />
+ <polyline color="#000000" width="1" dash="10" />
</item>
<item type="border_country" order="0-">
- <polyline color="#b8434e" width="1" />
+ <polyline color="#b8434e" width="1" dash="10,5,2,5" />
</item>
<item type="border_state" order="0-">
<polyline color="#808080" width="1" />
<item type="poi_oil_field" order="0-">
<icon src="oil_field.xpm" />
</item>
+ <item type="poi_peak" order="6-">
+ <icon src="peak.xpm" />
+ </item>
<item type="poi_personal_service" order="0-">
<icon src="personal_service.xpm" />
</item>
<item type="poi_public_office" order="0-">
<icon src="public_office.xpm" />
</item>
+ <item type="poi_rail_station" order="9-">
+ <circle color="#ff0000" radius="3" width="3" />
+ <circle color="#000000" radius="6" width="2" label_size="8" />
+ </item>
<item type="poi_repair_service" order="0-">
<icon src="repair_service.xpm" />
</item>
"n aeroway helipad poi_heliport\n"
"n man_made tower poi_tower\n"
"n natural bay poi_bay\n"
+ "n natural peak poi_peak\n"
"n place suburb district_label\n"
"n place city town_label_2e5\n"
"n place town town_label_2e4\n"
"n place village town_label_2e3\n"
"n place hamlet town_label_2e2\n"
+ "n railway station poi_rail_station\n"
"w amenity place_of_worship poly_building\n"
"w building glasshouse poly_building\n"
"w building 1 poly_building\n"
"w power line powerline\n"
"w railway rail rail\n"
"w railway narrow_gauge rail\n"
- "w railway station poly_building\n"
"w railway subway rail\n"
"w railway tram rail\n"
"w leisure golf_course poly_golf_course\n"
}
static int
+convert_number_list(const char *val, int *table, int size)
+{
+ char *tok,*str,*val_str,*saveptr=NULL;
+ int i;
+ str=val_str=g_strdup(val);
+ for (i=0; i<size && (tok=strtok_r(str, ",", &saveptr)); i++) {
+ table[i]=convert_number(tok);
+ str=NULL;
+ }
+ g_free(val_str);
+ return i;
+}
+
+static int
xmlconfig_config(struct xmlstate *state)
{
state->element_object = (void *)1;
xmlconfig_polyline(struct xmlstate *state)
{
struct color color;
- const char *width, *directed;
- int w=0,d=0;
+ const char *width, *dash, *directed;
+ int w=0, d=0, dt[4], ds=0;
if (! find_color(state, 1, &color))
return 0;
width=find_attribute(state, "width", 0);
if (width)
w=convert_number(width);
+ dash=find_attribute(state, "dash", 0);
+ if (dash)
+ ds=convert_number_list(dash, dt, sizeof(dt)/sizeof(*dt));
directed=find_attribute(state, "directed", 0);
if (directed)
d=convert_number(directed);
- state->element_object=polyline_new(&color, w, d);
+ state->element_object=polyline_new(&color, w, d, dt, ds);
if (! state->element_object)
return 0;
itemtype_add_element(state->parent->element_object, state->element_object);