Locus Map - forum

Development => Developers => Topic started by: john_percy on February 19, 2022, 19:02:01

Title: Alternative extension for link to legend
Post by: john_percy on February 19, 2022, 19:02:01
Would it be possible to have an alternative extension other than .lnk for the link to the legend for a theme? I have in mind, say, both .lnk and .link working.
Why? Currently it's a pain if you use Windows to prepare the files, as Windows assumes the file is a Windows shortcut, hides the extension and treats it accordingly.

Sent from my moto g(6) plus using Tapatalk

Title: Re: Alternative extension for link to legend
Post by: Menion on February 19, 2022, 20:21:47
Hmm John, do not complicate to me the code too much please. I believe this is a minor issue, thanks  ;)
Title: Re: Alternative extension for link to legend
Post by: srtie4k on October 04, 2022, 18:39:03
Bump for visibility, dealing with .lnk files in Windows 11 is a huge nightmare. I am a theme developer who works in Windows, I built the "Adventure" theme for adventure motorcyclists (hosted over on advrider.com).

Every time I load a theme in to Locus with lnk files pointing to the legend, I get an error in the Android PDF viewer "Cannot display PDF ([theme].pdf cannot be opened).

I believe this is because Windows is appending metadata to each .lnk file whenever the OS sees the file renamed from a txt extension. If I generate the lnk file on my Android and place it in the theme folder, the legend is able to successfully open from within Locus with no error, but every time I try to offload the lnk file from my phone to my Windows machine, then transfer it back to the phone again, I get this error.

It would be nice if you could add a provision for those of us who work in Windows to get the legend link files working in our themes. Maybe even look for a standard txt file in addition to the lnk file. For the time being, I will have to make a copy of the legend PDF for the 2 theme XML files I maintain (a V3 and a V4 theme), since even a URL will not work.
Title: Re: Alternative extension for link to legend
Post by: john_percy on March 19, 2023, 17:56:29
@srtie4k
The workaround that worked for me in Windows is to edit and save it as a .txt file (or even a .lnk.txt file) in Windows, upload it by FTP and then rename the uploaded file.

These days I work from my android and avoid the problem.
Title: Re: Alternative extension for link to legend
Post by: Menion on March 20, 2023, 09:11:55
I'm a little off-topic, sorry for this, but I would like to remind to both of you, that we will be soon releasing LoMaps based on the MapsForgeV4 system. It will be then a lot easier to create themes for LoMaps and other public vector maps (OpenAndroMaps).

Unfortunately old themes for LoMaps V3 won't be usable since users update to new LoMaps.
Title: Re: Alternative extension for link to legend
Post by: john_percy on March 20, 2023, 09:46:49
Does that mean the themes that currently work for OAM will work for new Lomaps?


Sent from my moto g(6) plus using Tapatalk

Title: Re: Alternative extension for link to legend
Post by: Menion on March 20, 2023, 10:34:18
In the ideal world yes. But we noticed that OAM use some hack and special tags so the content of this file won't be identical ... for now ... unfortunately. It is not on me, but @voldapet should discuss this with anyone responsible for OAM maps and unite map content. Ah, this should be amazing  :)
Title: Re: Alternative extension for link to legend
Post by: michaelbechtold on March 20, 2023, 13:17:49
Quote from: Menion on March 20, 2023, 10:34:18In the ideal world yes. But we noticed that OAM use some hack and special tags so the content of this file won't be identical ... for now ... unfortunately. It is not on me, but @voldapet should discuss this with anyone responsible for OAM maps and unite map content. Ah, this should be amazing  :)

I'm biased, as you know, but I think that Christian's tag mapping in coop with Tobias' themes is more powerful and comprehensive than LoMaps. voldapet should reach out to Christian ...
Title: Re: Alternative extension for link to legend
Post by: Menion on March 20, 2023, 14:01:02
Sure I also think they contain more info. But also some "hacks" because of problems that were in the previous MF library. Anyway, it's not up to me ...