App: External map styles

Open external map styles with the various offline maps.

Available in menu “Map | Map style”.

How to write xml based render themes to style maps:

1 Like

OpenAndroMaps with Elevate map style and its map groups / layers.

(map styles open as zip files)

1 Like

Yes, thanks. It is already (and still :frowning_face:) on my task list: Try to extract and modify original style: Show mountain_passes, do not show mountain peaks, perhaps modify icon.

1 Like

Sorry, my time does not allow simultaneous work on the app and the map style.
The map styles belong to community and all users to improve and update them.

The Elevate map style of OpenAndroMaps is improved and updated constantly.

This will be simple. Also it would be nice if the map style improvements
by the users could be integrated into the default map style in the future.

Available for testing in Kurviger 2.0.7 (Beta).

Implemented in Kurviger 2.0.12.

I really like this feature, i never knew about map styles!

1 Like

Simple … not for everyone :frowning:

Following a hint from @devemux86 I tried to extract a style from Kurviger APK and modify it - I want to see mountain passes, but I do not want to see mountain peaks (too many - and I can not reach them with motorcycle :wink: ).

That was easier than I thought before (just remove peaks from mountain_passes layer), so I tried next step: Separate layer and other symbol for mountain peaks.

I did following:

  • extract folder “assets” from Kurviger 2.0.13 APK
  • rename folder “assets” to “PeaksBlueDot”
  • in folder “PeaksBlueDot/kurviger” delete “openmaptiles.xml” (prevent Kurvinger asking for desired style when opening generated style ZIP)
  • in folder “PeaksBlueDot/kurviger” rename “default.xml” to “PeaksBlueDot.xml”

Then edit “PeaksBlueDot.xml”:

  • add attribute enabled=“true” to layer with id=“mountain pass” (to enable it after loading style)

  • change name of layer “mountain pass” from “Peaks and mountain passes” to “Mountain passes”, also for other languages

  • add a further layer with id=“mountain_peak” with adapted name for all languages

  • add layer id=“mountain_peak” as overlay to layer id=“normal”

  • add peaks to category “mountain_peak” instead of “mountain_pass”, use symbol “dot_blue_dark.svg” instead of “peak.svg”

Afterwards ZIP the folder “PeaksBlueDot” to “PeaksBlueDot.zip” and copy it to Android device.

Result: I can open the ZIP as a style in kurviger, layer “Mountain passes” is enabled, new layer “Mountain peaks” is there:

Having a look at Sella round only mountain passes are shown - clear view:

After enabling layer “Mountain peaks” peaks are shown by blue dot - not so clear view:

So it works!

But: I tried to add an own icon before, was not succesful: Even if I copied in folder “PeaksBlueDot\symbols” peak.svg to peak1.svg without modifying the svg and changed
in line 1112 <symbol src="assets:symbols/peak.svg/> to <symbol src="assets:symbols/peak1.svg/>
or to <symbol src="file:symbols/peak1.svg/> it did not work.

The Name and height of the peaks I could enable on map, but no icon was shown.

I did not yet understand how I have to add a new file (has the symbol path to start with “assets:”, “file:” or “file:/” ? Or even an other suffix?

Google gave some information (interesting: mapsforge/docs/Rendertheme.md at master · mapsforge/mapsforge · GitHub ), but currently I’m stuck.

Nevertheless there is a (small) success: I could disable the peaks / make them switchable separately and give them an other symbol (but just one which was already there) :+1:

Perhaps someone has an idea - also comments from other users are welcome, let’s save the time of @devemux86 and @boldtrn for more important / more difficult topics :wink:

Thanks again to @devemux86 for implementing external map styles and giving hints concerning that topic! :+1: :+1:

So, as a first result, from my point of view, proposal for the integrated style in the future could be:

  • add a separate layer (separately switchable) for mountain peaks
  • enable the layer for mountain passes by default
  • tbd: different symbol for peaks and passes, which one (blue dot ist not a good solution). In the 1st step separate layers will improve clearness also also with same symbol for both layers.

Attached you find the style ZIP, but be careful: Using it might cause unintended behaviour, test depth is extreme low. Of course feedback is welcome:
PeaksBlueDot.zip (428,4 KB)

2 Likes

Thanks for the detailed instructions!

The correct documentation for map styles is here.
(see also 1st post)

(the prefix “assets:” uses resources included in the app)

You need to use the “file:” prefix to use external resources.
Then xml must be at the root next to [patterns, symbols, textures].
(the “shaders” is not needed)

There is already a relevant suggestion, although without answers from users:

Thanks for the hint - although this was the same in an other sample from OpenAndroMaps, I did not see that (and might not have seen furthermore :innocent:)!
So I modified it and added a modified symbol for peaks (triangle with black border and white fill) and used it - works:
PeaksWhiteTriangle.zip (428,9 KB)

2 Likes

Oh, it’s fantastic!
I have tried to load this style, seeing that in the layers of the map it looks you can choose and it works perfectly.
I think it would be a very interesting option to put it in the ‘default’ style
:metal: :metal:

Inspired by @rumbrummer (thanks!), I decided to slightly modify the default style. I want to add objects tagged with Historic=ruins to the Tourist attractions layer. Indeed, it was not difficult, and it worked! I just copied the Castle section and changed the name to Ruins (I left the icon because the adequate one is not readable).

But I have noticed that objects tagget as Ruins appear on a different scale than Castles (> 15). Changing entries in the style file has no effect. So I guess it depends on the structure of the map? Which may also explain that not all such objects appear at all. Or is there a trick to force these objects to appear earlier, along with the all attractions (scale > 10)?

There are 2 steps:

  • Map creation (documentation):
    “You can use the XML configuration to define which subset of the known tag set should be included in the map file and to configure the zoom levels on which map objects first appear.”

  • Map styles (documentation):
    “The minimum / maximum zoom level on which the rule will be matched.”

1 Like

In the Locus map forum you find some very active theme developers.
I think that you can get the necessary cooperation or good advice there.
Just ask, after all, it’s about identical vector base maps.

Info about multiple available themes is unfortunately rather fragmented :-((
https://forum.locusmap.eu/index.php?topic=6998.msg59993#msg59993
https://forum.locusmap.eu/index.php?board=40.0

1 Like

Working in map styles is easier on the computer with (desktop) Cruiser.
Use the Reload (F5) function with map style changes.

(as does OpenAndroMaps)

1 Like

In Kurviger 2.1.11 fuel stations and charging stations have separate icons - but the difference is hardly to detect, especially on a smartphone:

  • charging station: image
  • fuel station: image

As a first step I modified a style where I just changed the color of the charging station to dark green:

  • extract folder “assets” from Kurviger 2.1.11 APK
  • rename folder “assets” to “SeparateChargingStation”
  • in folder “SeparateChargingStation/kurviger” delete “openmaptiles.xml” (prevent Kurvinger asking for desired style when opening generated style ZIP)
  • in folder “SeparateChargingStation/kurviger” rename “default.xml” to “SeparateChargingStation.xml”
  • move “SeparateChargingStation.xml” to folder “SeparateChargingStation” (according to hint from @devemux86 above next to [patterns, symbols, textures])
  • in folder “SeparateChargingStation\symbols\custom\transport” create a copy of charging_station.svg and rename it to charging_station_green.svg
  • edit charging_station_green.svg with text editor: in row 16 change fill=“#ac39ac to fill=“#0e600e
  • edit SeparateChargingStation.xml with text editor: change all occurences of “assets:symbols/custom/transport/charging_station.svg” to “file:symbols/custom/transport/charging_station_green.svg”
  • ZIP the folder “SeparateChargingStation” to “SeparateChargingStation.zip” and copy it to Android device
    After opening ZIP as a style in kurviger the charging stations have a dark green color: image
    SeparateChargingStationV0.zip (442,5 KB)

Of course you can apply any other RBG color by choosing an other hex code instead of #0e600e (see e.g. HTML Color Picker).

Probably it would be also helpful to be able to switch fuel stations and charging stations separately … perhaps I will try later (but do not wait for it :wink: )

4 Likes

That was easier and faster than I thought:
I added an separate layer for charging stations just by modifieing SeparateChargingStation.xml. For details compare versions V0 and V1 - some languages might have to be reworked, especially the greek one :wink: :

SeparateChargingStationV1.zip (442,5 KB)

The changes:

4 Likes

Thank you so much for this tip! I thought about replacing the icon, but I would never think to edit the icon in… a text editor on my phone :+1:
I even used the color you suggested, because it is perfectly suitable. Thanks.

1 Like

It is implemented in the new Version, so no need for an external style any more: