434 |
map_item->way = way; |
map_item->way = way; |
435 |
|
|
436 |
if(way->draw.flags & OSM_DRAW_FLAG_AREA) { |
if(way->draw.flags & OSM_DRAW_FLAG_AREA) { |
437 |
if(map->style->area.opaque) |
if(map->style->area.color & 0xff) |
438 |
map_item->item = canvas_polygon_new(map, group, points, |
map_item->item = canvas_polygon_new(map, group, points, |
439 |
width, color, fill_color); |
width, color, fill_color); |
440 |
else |
else |
466 |
|
|
467 |
void map_show_node(map_t *map, node_t *node) { |
void map_show_node(map_t *map, node_t *node) { |
468 |
map_node_new(map, node, map->style->node.radius, 0, |
map_node_new(map, node, map->style->node.radius, 0, |
469 |
RGB2CANVAS(map->style->node.color), 0); |
map->style->node.color, 0); |
470 |
} |
} |
471 |
|
|
472 |
void map_way_draw(map_t *map, way_t *way) { |
void map_way_draw(map_t *map, way_t *way) { |
481 |
if(nodes == 1) { |
if(nodes == 1) { |
482 |
/* draw a single dot where this single node is */ |
/* draw a single dot where this single node is */ |
483 |
map_way_single_new(map, way, map->style->node.radius, 0, |
map_way_single_new(map, way, map->style->node.radius, 0, |
484 |
RGB2CANVAS(map->style->node.color), 0); |
map->style->node.color, 0); |
485 |
} else { |
} else { |
486 |
canvas_points_t *points = canvas_points_new(nodes); |
canvas_points_t *points = canvas_points_new(nodes); |
487 |
|
|
517 |
map_node_new(map, node, |
map_node_new(map, node, |
518 |
map->style->node.radius, |
map->style->node.radius, |
519 |
map->style->node.border_radius, |
map->style->node.border_radius, |
520 |
RGBA2CANVAS(map->style->node.fill_color, |
map->style->node.fill_color, |
521 |
map->style->node.has_fill_color?0xff:0x00), |
map->style->node.color); |
|
RGB2CANVAS(map->style->node.color)); |
|
522 |
|
|
523 |
else if(map->style->node.show_untagged || osm_node_has_tag(node)) |
else if(map->style->node.show_untagged || osm_node_has_tag(node)) |
524 |
map_node_new(map, node, |
map_node_new(map, node, |
525 |
map->style->node.radius, 0, |
map->style->node.radius, 0, |
526 |
RGB2CANVAS(map->style->node.color), 0); |
map->style->node.color, 0); |
527 |
} |
} |
528 |
|
|
529 |
static void map_item_draw(map_t *map, map_item_t *map_item) { |
static void map_item_draw(map_t *map, map_item_t *map_item) { |
605 |
canvas_points_t *points = canvas_points_new(5); |
canvas_points_t *points = canvas_points_new(5); |
606 |
|
|
607 |
/* don't draw frisket at all if it's completely transparent */ |
/* don't draw frisket at all if it's completely transparent */ |
608 |
if(map->style->frisket.opaque) { |
if(map->style->frisket.color & 0xff) { |
609 |
elemstyle_color_t color = |
elemstyle_color_t color = map->style->frisket.color; |
|
(map->style->background.color<<8) | map->style->frisket.opaque; |
|
610 |
|
|
611 |
float mult = map->style->frisket.mult; |
float mult = map->style->frisket.mult; |
612 |
|
|
1731 |
map_t *map = appdata->map = g_new0(map_t, 1); |
map_t *map = appdata->map = g_new0(map_t, 1); |
1732 |
|
|
1733 |
map->style = style_load(appdata, appdata->settings->style); |
map->style = style_load(appdata, appdata->settings->style); |
1734 |
|
if(!map->style) { |
1735 |
|
errorf(NULL, _("Unable to load valid style, terminating.")); |
1736 |
|
g_free(map); |
1737 |
|
return NULL; |
1738 |
|
} |
1739 |
|
|
1740 |
if(appdata->project && appdata->project->map_state) { |
if(appdata->project && appdata->project->map_state) { |
1741 |
printf("Using projects map state\n"); |
printf("Using projects map state\n"); |
2189 |
if(lpos) |
if(lpos) |
2190 |
appdata->track.gps_item = canvas_circle_new(appdata->map, CANVAS_GROUP_GPS, |
appdata->track.gps_item = canvas_circle_new(appdata->map, CANVAS_GROUP_GPS, |
2191 |
lpos->x, lpos->y, appdata->map->style->track.width/2.0, 0, |
lpos->x, lpos->y, appdata->map->style->track.width/2.0, 0, |
2192 |
RGB2CANVAS(appdata->map->style->track.gps_color), NO_COLOR); |
appdata->map->style->track.gps_color, NO_COLOR); |
2193 |
} |
} |
2194 |
|
|
2195 |
/* ------------------- map background ------------------ */ |
/* ------------------- map background ------------------ */ |