Rob Norris [Sun, 17 Mar 2013 20:05:06 +0000 (20:05 +0000)]
Make more portable .vik file, as don't save the map cache directory if it's the map cache default directory.
The map cache default directory is dependent on the user and OS, however on reading in when it's blank it automatically puts in the map cache default directory.
Unlike the previous effort SHA1: 39aec6c6b87a324981a6e1d028ba345320a444ad
This uses the fixed value MAPS_CACHE_DIR rather than the preference value in case the preference has changed.
Michael Klein [Tue, 16 Apr 2013 22:04:22 +0000 (23:04 +0100)]
SF#3610708: Fix Failing to Load DEM files on Big Endian Systems.
Endian awareness is needed in unzip_hgt_file() for processing DEM zip file headers, as the values are in little-endian byte order.
Otherwise loading on a big-endian system such as a PowerPC Mac will fail with the program complaining 'wrong format' for the DEM file.
See http://en.wikipedia.org/wiki/Zip_(file_format)
Wolfgang Goetz [Wed, 10 Apr 2013 19:54:55 +0000 (20:54 +0100)]
Fix Double defined msgid's in po-files.
Unfortunately due to previous commit in simplying the code, which then caused an incorrect commit:
'Update translations for layers menu popup which no longer have to start with '/''
SHA1:33a5209f18fdddfa011eabc3d4834cc23bef5955.
Which aligned the translation to the code. However Po files don't allow repeated text strings as ids.
Simply remove the secondary copy in most places and for the da translation copy the texts into the first place.
Rob Norris [Fri, 22 Feb 2013 18:49:24 +0000 (18:49 +0000)]
Minimum GTK+2.14 required for the build.
Remove now unneeded check for 2.14 existence.
Revise direct access for '->vbox' to use gtk_dialog_get_content_area() instead.
Revise direct access for '->window' to use gtk_widget_get_window() instead.
Remove direct access for '->colorsel' and replace with gtk_color_selection_dialog_get_color_selection()
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.