59 |
if(id == ID_ILLEGAL) |
if(id == ID_ILLEGAL) |
60 |
str = g_strdup_printf(_("Unknown item")); |
str = g_strdup_printf(_("Unknown item")); |
61 |
else { |
else { |
62 |
str = g_strdup_printf("%s #%ld", item_str, id); |
str = g_strdup_printf("%s #" ITEM_ID_FORMAT, item_str, id); |
63 |
|
|
64 |
/* add some tags ... */ |
/* add some tags ... */ |
65 |
/* |
/* |
299 |
void map_relation_select(appdata_t *appdata, relation_t *relation) { |
void map_relation_select(appdata_t *appdata, relation_t *relation) { |
300 |
map_t *map = appdata->map; |
map_t *map = appdata->map; |
301 |
|
|
302 |
printf("highlighting relation %ld\n", relation->id); |
printf("highlighting relation "ITEM_ID_FORMAT"\n", relation->id); |
303 |
|
|
304 |
g_assert(!map->highlight); |
g_assert(!map->highlight); |
305 |
map_highlight_t **hl = &map->highlight; |
map_highlight_t **hl = &map->highlight; |
322 |
|
|
323 |
case NODE: { |
case NODE: { |
324 |
node_t *node = member->object.node; |
node_t *node = member->object.node; |
325 |
printf(" -> node %ld\n", node->id); |
printf(" -> node "ITEM_ID_FORMAT"\n", node->id); |
326 |
|
|
327 |
item = canvas_circle_new(map->canvas, CANVAS_GROUP_NODES_HL, |
item = canvas_circle_new(map->canvas, CANVAS_GROUP_NODES_HL, |
328 |
node->lpos.x, node->lpos.y, |
node->lpos.x, node->lpos.y, |
882 |
|
|
883 |
switch(map_item->object.type) { |
switch(map_item->object.type) { |
884 |
case NODE: |
case NODE: |
885 |
printf(" item is node #%ld\n", map_item->object.node->id); |
printf(" item is node #"ITEM_ID_FORMAT"\n", map_item->object.node->id); |
886 |
break; |
break; |
887 |
case WAY: |
case WAY: |
888 |
printf(" item is way #%ld\n", map_item->object.way->id); |
printf(" item is way #"ITEM_ID_FORMAT"\n", map_item->object.way->id); |
889 |
break; |
break; |
890 |
default: |
default: |
891 |
printf(" unknown item\n"); |
printf(" unknown item\n"); |
911 |
parent = map_item->object.node->map_item_chain->map_item; |
parent = map_item->object.node->map_item_chain->map_item; |
912 |
|
|
913 |
if(parent) |
if(parent) |
914 |
printf(" using parent item node #%ld\n", parent->object.node->id); |
printf(" using parent item node #" ITEM_ID_FORMAT "\n", |
915 |
|
parent->object.node->id); |
916 |
break; |
break; |
917 |
|
|
918 |
case WAY: |
case WAY: |
920 |
parent = map_item->object.way->map_item_chain->map_item; |
parent = map_item->object.way->map_item_chain->map_item; |
921 |
|
|
922 |
if(parent) |
if(parent) |
923 |
printf(" using parent item way #%ld\n", parent->object.way->id); |
printf(" using parent item way #" ITEM_ID_FORMAT "\n", |
924 |
|
parent->object.way->id); |
925 |
break; |
break; |
926 |
|
|
927 |
default: |
default: |
1288 |
} |
} |
1289 |
|
|
1290 |
void map_way_delete(appdata_t *appdata, way_t *way) { |
void map_way_delete(appdata_t *appdata, way_t *way) { |
1291 |
printf("deleting way #%ld from map and osm\n", way->id); |
printf("deleting way #" ITEM_ID_FORMAT " from map and osm\n", way->id); |
1292 |
|
|
1293 |
/* remove it visually from the screen */ |
/* remove it visually from the screen */ |
1294 |
map_item_chain_destroy(&way->map_item_chain); |
map_item_chain_destroy(&way->map_item_chain); |
1973 |
|
|
1974 |
switch(item.object.type) { |
switch(item.object.type) { |
1975 |
case NODE: |
case NODE: |
1976 |
printf("request to delete node #%ld\n", item.object.node->id); |
printf("request to delete node #" ITEM_ID_FORMAT "\n", |
1977 |
|
item.object.node->id); |
1978 |
|
|
1979 |
/* check if this node is part of a way with two nodes only. */ |
/* check if this node is part of a way with two nodes only. */ |
1980 |
/* we cannot delete this as this would also delete the way */ |
/* we cannot delete this as this would also delete the way */ |
2035 |
break; |
break; |
2036 |
|
|
2037 |
case WAY: |
case WAY: |
2038 |
printf("request to delete way #%ld\n", item.object.way->id); |
printf("request to delete way #" ITEM_ID_FORMAT "\n", item.object.way->id); |
2039 |
map_way_delete(appdata, item.object.way); |
map_way_delete(appdata, item.object.way); |
2040 |
break; |
break; |
2041 |
|
|
2346 |
} |
} |
2347 |
|
|
2348 |
way_t *way = map->selected.object.way; |
way_t *way = map->selected.object.way; |
2349 |
printf("hiding way #%ld\n", way->id); |
printf("hiding way #" ITEM_ID_FORMAT "\n", way->id); |
2350 |
|
|
2351 |
map_item_deselect(appdata); |
map_item_deselect(appdata); |
2352 |
way->flags |= OSM_FLAG_HIDDEN; |
way->flags |= OSM_FLAG_HIDDEN; |