You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the latest version (as of writing this issue), qmapshack uses the file names alone to display the available icons in the waypoint icon selector as well as references in the <sym> tags in the exported GPX files. Moreover, if the file name matches an existing (built-in) icon name qmapshack uses the custom icon over the existing one. Although this approach works for lots of simple usecases, it has a few major problems:
File names have limitations, e.g. on a UNIX-like system the file name cannot contain the character /. This is problematic for waypoint names such as Navaid, Green/White which is required by a few Garmin devices.
If there are too many icons, its hard to navigate through them
Different devices use different waypoint names, there's no easy way currently to define more than one names depending on where the output file is going to be used
Possible Solution
There are plenty of ways to solve and implement this problem. I would probably do it in the easiest, and most flexible yet backward compatible way:
If there is a configuration file in the directory (INI, TOML, JSON, etc.) then qmapshack uses the configuration defined in that file, otherwise
The names (both display, and GPX symbol) derived from the file name, and built-in ones could be overridden by files with matching names
Let's say the configuration file is called icons.toml, then it would look like as follows:
# Name defined by qmapshack or file name
[FirstAid]
# Name that will be used in GPX files (<sym>)gpx_symbol_name = 'First Aid'# Alternative names used when sending GPX to specific devicedevice_specific_gpx_symbol_name = { garmin_etrex_10 = 'Medical Facility' }
[Trailhead]
# This is how it will appear in qmapshackdisplay_name = 'Hiking'# This could be used for bubble-helpdescription = 'The place where a trail begins'gpx_symbol_name = 'Trail Head'# Submenus under which the icon could be foundcategory = [ 'Outdoors', 'Signs' ]
At the top level each key is the name defined by qmapshack or the file name if it is a custom icon.
Each section can have a display_name property, which defines the name of the icon qmapshack will use in the icon-selector pop-up. If it is not defined, the built-in name or the file name is used instead.
The section could also contain a description property, which could be used as an extra information displayed in the bubble-help when hovered over the icon and/or name in the selector. If it is not defined, the information is the same as display_name.
The section could also contain a gpx_symbol_name which is the default name used for the <sym> tag in the GPX file. If it is not given the display_name should be used instead.
The section could contain a device_specific_gpx_symbol_name which could define an arbitrary number of devices (each device identifier is predefined by qmapshack) and their corresponding GPX names. This name is used when the waypoints transferred to the device. If this property is not defined or a specific devices is not defined in this property the gpx_symbol_name should be used instead.
And last but not least, this section could contain a category property, which is a list of user-defined categories (submenus) where the icon could show up in the icon selector. This property relies on a new feature in qmapshack, i.e. the ability to have nested submenus in the icon selector.
The text was updated successfully, but these errors were encountered:
Problem
In the latest version (as of writing this issue),
qmapshack
uses the file names alone to display the available icons in the waypoint icon selector as well as references in the<sym>
tags in the exported GPX files. Moreover, if the file name matches an existing (built-in) icon nameqmapshack
uses the custom icon over the existing one. Although this approach works for lots of simple usecases, it has a few major problems:/
. This is problematic for waypoint names such asNavaid, Green/White
which is required by a few Garmin devices.Possible Solution
There are plenty of ways to solve and implement this problem. I would probably do it in the easiest, and most flexible yet backward compatible way:
qmapshack
uses the configuration defined in that file, otherwiseLet's say the configuration file is called
icons.toml
, then it would look like as follows:At the top level each key is the name defined by
qmapshack
or the file name if it is a custom icon.Each section can have a
display_name
property, which defines the name of the iconqmapshack
will use in the icon-selector pop-up. If it is not defined, the built-in name or the file name is used instead.The section could also contain a
description
property, which could be used as an extra information displayed in the bubble-help when hovered over the icon and/or name in the selector. If it is not defined, the information is the same asdisplay_name
.The section could also contain a
gpx_symbol_name
which is the default name used for the<sym>
tag in the GPX file. If it is not given thedisplay_name
should be used instead.The section could contain a
device_specific_gpx_symbol_name
which could define an arbitrary number of devices (each device identifier is predefined byqmapshack
) and their corresponding GPX names. This name is used when the waypoints transferred to the device. If this property is not defined or a specific devices is not defined in this property thegpx_symbol_name
should be used instead.And last but not least, this section could contain a
category
property, which is a list of user-defined categories (submenus) where the icon could show up in the icon selector. This property relies on a new feature inqmapshack
, i.e. the ability to have nested submenus in the icon selector.The text was updated successfully, but these errors were encountered: