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

Windows: maps.xml access #68

Closed
richardy2 opened this issue Apr 27, 2019 · 2 comments
Closed

Windows: maps.xml access #68

richardy2 opened this issue Apr 27, 2019 · 2 comments

Comments

@richardy2
Copy link

If I open Viking and then open a GPX file from within it, I have a full range of maps available, including openstreetmap with my API applied. However if I double click a GPX file in a different folder I only have a limited list of maps which does not include my default map so no map appears.
I had assumed this was a path problem to maps.xml but adding this to PATH does not help. Any ideas? Using Windows10 and Windows7 and the problem is the same with both on different computers.

@rnorris
Copy link
Collaborator

rnorris commented May 1, 2019

You should be (creating if necessary) editing the maps.xml in your home directory:

 C:\Users\<username>\.viking\maps.xml

I'm guessing you are editing the 'system' installed maps.xml, in something like:

C:\Program Files\Viking\data\maps.xml

I think Viking can't find its own 'data' directory if run via a double click, as this must set the current working directory to the location of the GPX file and so the 'data\maps.xml' loading fails (as this is a relative path).

Viking uses multiple paths in trying to load maps.xml files (entries from each location are cumulatively added) - in order to combine the installed values plus the user generated ones.

Background information:
IIRC Finding the absolute path on Windows wasn't as straightforward as I hoped and so gave up and used the relative path - which at least works when opening Viking first.
NB On Linux this works by using system locations defined by environment variable XDG_DATA_DIRS, but this is not available in Windows.

@richardy2
Copy link
Author

Thanks for your assistance. I fully understand what you are saying and I have now solved the problem by moving maps.xml to what you refer to as my home directory from C:\Program Files\Viking\data\maps.xml which is where, as you suspected it was. However the default installation has the data, lib, locale and share folders all in C:\Program Files\Viking\ Should all these also really be in the "home directory" C:\Users<username>.viking\ and if that is the case could the install program be modified to put them there in the first instance.

@rnorris rnorris changed the title Maps Windows: maps.xml access Dec 23, 2020
rnorris added a commit that referenced this issue May 15, 2021
Use glib method to get own installation directory, rather than relative path.
So now paths to data files works regardless of method used to start Viking under Windows.

Thus loads own maps.xml when started via double-click.

Also ensure absolute path to the Magic database file.
@rnorris rnorris closed this as completed May 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants