Rob Norris [Fri, 22 Feb 2013 23:12:31 +0000 (23:12 +0000)]
Position Trackpoint Edit and Waypoint dialogs to not obscure the selected point.
Shift the dialog towards the opposite edge if we think the dialog will be drawn over the selected point.
For Trackpoint Edit this means it gets shifted up or down,
whilst the Waypoint Property/Edit dialog is shifted left or right.
Positioning of the dialog for a new Waypoint is unchanged.
Rob Norris [Wed, 27 Feb 2013 00:00:52 +0000 (00:00 +0000)]
When adding layers insert 'Base' layers (i.e Maps/GeoRef/DEM) below the selected layer.
Consider a common scenario of opening a GPX or KML file so there is now a TrackWaypoint layer.
Then one adds a map layer (previously this then gets inserted above the trackwaypoint layer
and one can no longer see the tracks or waypoints) so now it gets placed below the TRW layer
and hence the GPS info is still visible.
Maintain the ordering of layers when opened from a file.
Sven Eckelmann [Fri, 11 Mar 2011 11:36:30 +0000 (12:36 +0100)]
Fix GPX symbol names for Garmin Oregon 450
While testing the GPS export using Garmin Oregon 450 with software
version 4.20, it was noticed that no symbol seemed to be recognized by
the waypoint manager. The problem seems to be that this device
differenciate between lower and upper chars in the symbol names.
Casing of all symbols apart from 'custom placeholder' were modified into
'Title Case'. The hash helper functions had to be changed to ignore the
difference between lower and upper cases. The import had to be extended
to convert lower case names in sym to the version in the table to work
correctly.
Reported-by: Frank Eckelmann <f.eckelmann@gmx.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
Rob Norris [Tue, 19 Mar 2013 21:11:43 +0000 (21:11 +0000)]
SF#3608264: Improve Statusbar Location Info Maybe Truncated
Reduce precision of location output in DMS to 4 decimal places.
Since (default float output of) 6 dp of precision for one second too detailed be of use!
Reduce space allocated to naming the Tool in use and give it to the location field.
The tool in use (as reported in the statusbar) is not very important so it doesn't matter
does not matter if is truncated here, since the Tool in use is also indicated by:
1. The mouse icon
2. The button depressed on the toolbar
Rob Norris [Mon, 4 Mar 2013 18:54:31 +0000 (18:54 +0000)]
Optimize: Calculate associated icon of a waypoint only on change.
Instead of looking up a hash table on every waypoint draw on every layer draw;
store the icon reference in the waypoint itself and update only when necessary:
1. When the waypoint icon is changed directly by the user.
or
2. When implicitly changed via the size preference,
so add method to update all windows and then all waypoints to switch between
small<->large icons.
Rob Norris [Sun, 21 Oct 2012 17:59:10 +0000 (18:59 +0100)]
Make vik_viewport_coord_to_screen() calculation faster.
Since this function is used for every drawn trackpoint, this can be called
hundreds or thousands of times.
Thus calculate the fixed factors separately only when the dependent values change:
. factors dependent on the zoom level - set when the zoom level changes
. factors dependent on the screen size - set when the screen is resized.
Rob Norris [Sun, 21 Oct 2012 16:27:09 +0000 (17:27 +0100)]
Only attempt to draw waypoints when they are in the screens bounding box.
Store bounding box of all the waypoints in a TrackWaypoint layer.
Waypoints bounds are calculated on layer create and whenever the waypoints positions have changed.
Bump minimum glib due to usage of g_hash_table_iter_init ()
Rob Norris [Fri, 19 Oct 2012 11:32:05 +0000 (12:32 +0100)]
Store track bounding box and only attempt to draw it if some part of it
is visible on screen.
Bounds are calculated on TrackWaypoint creation (i.e. loading tracks
from a file or acquiring from an external source).
Bounds are recalculated on trackpoint changes.
Where 'simple' this is done within the vik_track update functions,
however much direct trackpoint list manipulation is performed by the TrackWaypoint layer,
such as the various merge and split functions, so the recalculation is called there.
Thus with multiple tracks, this skips attempting to draw all trackpoints
of every marked visible track when no part of the track is within the
current screen bounds.
This should mean Viking is much faster in drawing.
Note this still attempts to draw all trackpoints of a track should you
zoom 'inside' it. But this is not much of a penalty.
Rob Norris [Sat, 9 Mar 2013 10:29:46 +0000 (10:29 +0000)]
Extend map scales down to support 1/32 zoom level.
Refactor all usage of 'GZ()' and *_mpp_to_scale() to use common definitions.
Including the addition of map_utils_mpp_to_zoom_level() and use it with WebToolCenter.
Rob Norris [Wed, 6 Mar 2013 19:50:53 +0000 (19:50 +0000)]
Fix use of scaled tile image when tile image not present.
Due to the two stage initialization of the VIK_MAP_SOURCE the tilesize was actually set to zero.
This leads to the mapslayer redraw *not* trying differing tile zooms to get a pixbuf for the current zoom level.
First vik_map_source_init is performed (such as vik_slippy_map_source_init(),
which sets a specific tilesize value in the first g_object_new() call.
However since the tilesize parameter is 'G_PARAM_CONSTRUCT | G_PARAM_READWRITE',
on the second g_object_new() such as in osm_init(), since the tilesize is not specified
it seems it is then 'constructed' with the default g_param value - which in this case is 0.
Thus to prevent the resetting of the tilesize, set it to 'G_PARAM_READWRITE'
and hence the extra (re)construction is avoided.
Greg Troxel [Thu, 15 Dec 2011 19:12:11 +0000 (14:12 -0500)]
Allow zoom to 1/32.
Sometimes I want to look at a track in fine detail, perhaps to
understand quantization. I find the default limit of 1/8 meter per
pixel too constraining, and I don't find allowing the user to zoom in
a bit to be problematic.
Rob Norris [Tue, 26 Feb 2013 23:15:31 +0000 (23:15 +0000)]
Fix datasource acquiring waypoints from geotag images.
Still need to return something for the 'command'.
I think in some personnel reworking to the acquire.c method I stopped requiring the command to have a value, thus I removed it.
Unfortunately I shouldn't have checked in this change to the geotag datasource, as in the end the acquire rework didn't include this hoped for simplification.
Rob Norris [Wed, 23 Jan 2013 21:14:50 +0000 (21:14 +0000)]
Add default values for layers.
Add functions to set the default layer parameter data, which is used on initialization.
This uses the GKeyFile mechanism to read and write files.
Using the group type offers a straightforward way to map to the layer name.
Enable GUI access to change the default values.
Rework the layer initialization to use the current default value for each parameter.