Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Waypoint Icons #88

Closed
petervaro opened this issue Dec 30, 2019 · 1 comment
Closed

Custom Waypoint Icons #88

petervaro opened this issue Dec 30, 2019 · 1 comment
Labels
enhancement New feature or request volunteer wanted Needs a volunteer to implement

Comments

@petervaro
Copy link

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 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:

  1. 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.
  2. If there are too many icons, its hard to navigate through them
  3. 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
[First Aid]
# Name that will be used in GPX files (<sym>)
gpx_symbol_name = 'First Aid'
# Alternative names used when sending GPX to specific device
device_specific_gpx_symbol_name = { garmin_etrex_10 = 'Medical Facility' } 

[Trailhead]
# This is how it will appear in qmapshack
display_name = 'Hiking'
# This could be used for bubble-help
description = 'The place where a trail begins'
gpx_symbol_name = 'Trail Head'
# Submenus under which the icon could be found
category = [ '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.

@petervaro petervaro added the enhancement New feature or request label Dec 30, 2019
@kiozen kiozen added the volunteer wanted Needs a volunteer to implement label Jan 3, 2020
@kiozen
Copy link
Collaborator

kiozen commented Jul 25, 2020

As there is no progress I close it for now.

@kiozen kiozen closed this as completed Jul 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request volunteer wanted Needs a volunteer to implement
Projects
None yet
Development

No branches or pull requests

2 participants