View Single Post
Posts: 3 | Thanked: 0 times | Joined on Feb 2007
#74
Another feature request:
If no GPS is conneted copy the current position to the GPS position.
This makes "Download Route to..." and "Show Distance to" more usable.

A new menuitem in the Location Menu like "Copy Lat/Lon to GPS" can do this with the code:
static gboolean
cmenu_cb_loc_gps_latlon(GtkAction *action)
{
guint unitx, unity;
gfloat lat, lon;

printf("%s()\n", __PRETTY_FUNCTION__);

unitx = x2unit(_cmenu_position_x);
unity = y2unit(_cmenu_position_y);
unit2latlon(unitx, unity, lat, lon);

_gps.latitude = lat;
_gps.longitude = lon;

vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
return TRUE;
}