This object is in archive! 

Locus GPX extension schema

Martin Ždila shared this question 18 months ago
Answered

Hello.

Is GPX locus extension schema documented? I am using custom `locus:icon` in GPX and I need to set different anchor than bottom-middle of the image. Is it possible?


Also I would like to see all locus-specific extension to see all what is possible.

Replies (6)

photo
1

Also it seems that Locus requires that namespace prefix is strictly "locus" which is against XML standards.

This works:

<gpx xmlns:locus="http://www.locusmap.eu" ...>

...

<locus:icon>...</locus:icon> ...

This does not:     


<gpx xmlns:ns1="http://www.locusmap.eu" ...>

...

<ns1:icon>...</ns1:icon> ...

Also this doesn't work:    


<gpx ...>

...

<icon xmlns="http://www.locusmap.eu">...</icon> ...

photo
1

Next, if you could please add support for "fill" GPX style support. If fill is present then it should render it as filled polygon.


Line GPX style is already supported.

photo
1

BTW I've added support of exporting some styles to http://www.freemap.sk - you can check it out. It uses also additional locus GPX extensions. Most interesting is possibility to export points with custom color. Sadly GPX style doesn't support it natively so it is hacked by using generated locus:icon.

https://www.freemap.sk/#map=13/48.759641/21.048433&layers=X&point=48.741370/21.060573C%2300ff91&point=48.779385/21.068125C%23ff00ff&point=48.796953/20.988607C%23eeff00&polygon=48.739038/20.981055%2C48.779317/21.011263%2C48.769363/21.097769W5C%23797dd7&show=export-gpx

photo
1

Hello Martine,

GPX support in the app is ... just "old" is not strong word enough :).

You are of course correct with hardcoded namespace, it is wrong - improved, thanks.

There is also no schema because extensions were added quite randomly over the years and I was always lazy to write docs here, sorry.

"fill" parameter - ah, thanks. Color from this will be used also in the next version.

Generated icons, nice :). This is probably the best way how to add such icons to the app. Well, maybe an alternative may be to have a defined set of icons available online and insert only a reference to these icons. It has an advantage > a united place from where icons are downloaded once. It also means better memory handling because your base64 icons are cached separately.

Mentioned changed will be available in the next beta or public version 4.17.0.1 or later.


photo
1

Thanks Menion for the upcoming fixes! This was fast.

I tried an export with ~100 of such points and I had no problem. Maybe Locus can cache also data URL (re-use memory) if it is same for multiple icons.

Set of online icons would in my case need to contain 16777216 icons (one for every color) but icons could be actually generated dynamically by URL (eg. https://example.com/icon?color=ff3050). I was originally considering this solution but data URL works well so far and embedded icons also doesn't require internet connection.

Thanks again!

photo
1

I`m rather checking it and to my surprise, the app is already caching also these Base64-based icons. It is done based on the first 50 characters of this "String". Perfect :)

Replies have been locked on this page!