summaryrefslogtreecommitdiff
path: root/navit/map.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-08-05 18:29:34 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-08-05 18:29:34 +0000
commitf7653870724b1c217722d52f19bc7de178620cea (patch)
treed8f2fff96b665862fc632fa72dc31241ea87ea80 /navit/map.c
parent8044cf29a40000e4bae88f6e323891e1ea4d8d6a (diff)
downloadnavit-f7653870724b1c217722d52f19bc7de178620cea.tar.gz
Add:gui_internal:Added support for POIs
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@1251 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/map.c')
-rw-r--r--navit/map.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/navit/map.c b/navit/map.c
index 39d89bee0..e49ba09da 100644
--- a/navit/map.c
+++ b/navit/map.c
@@ -303,7 +303,22 @@ map_search_destroy(struct map_search *this_)
}
struct map_selection *
-map_selection_dup(struct map_selection *sel)
+map_selection_rect_new(struct pcoord *center, int distance, int order)
+{
+ int i;
+ struct map_selection *ret=g_new0(struct map_selection, 1);
+ for (i = 0 ; i < layer_end ; i++) {
+ ret->order[i]=order;
+ }
+ ret->u.c_rect.lu.x=center->x-distance;
+ ret->u.c_rect.lu.y=center->y+distance;
+ ret->u.c_rect.rl.x=center->x+distance;
+ ret->u.c_rect.rl.y=center->y-distance;
+ return ret;
+}
+
+struct map_selection *
+map_selection_dup_pro(struct map_selection *sel, enum projection from, enum projection to)
{
struct map_selection *next,**last;
struct map_selection *ret=NULL;
@@ -311,6 +326,10 @@ map_selection_dup(struct map_selection *sel)
while (sel) {
next = g_new(struct map_selection, 1);
*next=*sel;
+ if (from != projection_none || to != projection_none) {
+ transform_from_to(&sel->u.c_rect.lu, from, &next->u.c_rect.lu, to);
+ transform_from_to(&sel->u.c_rect.rl, from, &next->u.c_rect.rl, to);
+ }
*last=next;
last=&next->next;
sel = sel->next;
@@ -318,6 +337,12 @@ map_selection_dup(struct map_selection *sel)
return ret;
}
+struct map_selection *
+map_selection_dup(struct map_selection *sel)
+{
+ return map_selection_dup_pro(sel, projection_none, projection_none);
+}
+
void
map_selection_destroy(struct map_selection *sel)
{