From: martin-s Date: Wed, 18 Apr 2012 19:33:54 +0000 (+0000) Subject: Add:Core:Implemented center attribute for navit_get_attr X-Git-Tag: navit-0.5.0.5194svn~174 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1adf3245b74c66799ef3c52206316f17020775fd;p=profile%2Fivi%2Fnavit.git Add:Core:Implemented center attribute for navit_get_attr git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@5021 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- diff --git a/navit/navit/navit.c b/navit/navit/navit.c index 694b00f..95ccc14 100644 --- a/navit/navit/navit.c +++ b/navit/navit/navit.c @@ -164,6 +164,7 @@ struct navit { int border; int imperial; int waypoints_flag; + struct coord_geo center; struct attr **attr_list; }; @@ -2549,6 +2550,7 @@ int navit_get_attr(struct navit *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter) { struct message *msg; + struct coord *c; int len,offset; int ret=1; @@ -2592,6 +2594,11 @@ navit_get_attr(struct navit *this_, enum attr_type type, struct attr *attr, stru case attr_callback_list: attr->u.callback_list=this_->attr_cbl; break; + case attr_center: + c=transform_get_center(this_->trans); + transform_to_geo(transform_get_projection(this_->trans), c, &this_->center); + attr->u.coord_geo=&this_->center; + break; case attr_destination: if (! this_->destination_valid) return 0;