Skip to content

Commit

Permalink
Adapt to MapsForge v4
Browse files Browse the repository at this point in the history
Locus now uses v4 for LoMaps. Keep the old v3 theme around as well for
old maps.
  • Loading branch information
liskin committed May 8, 2023
1 parent 7748277 commit 74592a6
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 15 deletions.
29 changes: 15 additions & 14 deletions Black.xml
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<rendertheme xmlns="http://mapsforge.org/renderTheme" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://mapsforge.org/renderTheme renderTheme.xsd" version="1" map-background="#000000">
xsi:schemaLocation="http://mapsforge.org/renderTheme renderTheme.xsd" version="4"
map-background="#000000" map-background-outside="#888888">

<rule e="way" k="highway" v="*">
<rule e="way" k="highway" v="*">
<rule e="way" k="highway" v="motorway|motorway_link|trunk|trunk_link">
<line stroke="#ffffff" stroke-width="2dp" />
<line stroke="#ffffff" stroke-width="2" />
</rule>
<rule e="way" k="highway" v="primary|primary_link">
<line stroke="#ffffff" stroke-width="1.5dp" />
<line stroke="#ffffff" stroke-width="1.5" />
</rule>
<rule e="way" k="highway" v="secondary|secondary_link">
<line stroke="#ffffff" stroke-width="1.2dp" />
<line stroke="#ffffff" stroke-width="1.2" />
</rule>
<rule e="way" k="highway" v="tertiary|tertiary_link">
<line stroke="#ffffff" stroke-width="1dp" />
<line stroke="#ffffff" stroke-width="1" />
</rule>
<rule e="way" k="highway" v="cycleway|track">
<line stroke="#ffffff" stroke-width="0.5dp" />
<line stroke="#ffffff" stroke-width="0.5" />
</rule>
<rule e="way" k="highway" v="residential">
<line stroke="#ffffff" stroke-width="0.2dp" />
<line stroke="#ffffff" stroke-width="0.2" />
</rule>
<rule e="way" k="highway" v="*">
<line stroke="#ffffff" stroke-width="0.1dp" />
<line stroke="#ffffff" stroke-width="0.1" />
</rule>
</rule>

<rule e="node" k="place" v="*">
<rule e="node" k="place" v="hamlet" zoom-min="13">
<caption k="name" font-style="bold" font-size="12dp" fill="#ffffff" stroke="#000000" stroke-width="2dp" />
<caption k="name" font-style="bold" font-size="12" fill="#ffffff" stroke="#000000" stroke-width="2" />
</rule>
<rule e="node" k="place" v="suburb|town|village" zoom-min="12">
<caption k="name" font-style="bold" font-size="13dp" fill="#ffffff" stroke="#000000" stroke-width="2dp" />
<caption k="name" font-style="bold" font-size="13" fill="#ffffff" stroke="#000000" stroke-width="2" />
</rule>
<rule e="node" k="place" v="island" zoom-min="10">
<caption k="name" font-style="bold" font-size="14dp" fill="#ffffff" stroke="#000000" stroke-width="2dp" />
<caption k="name" font-style="bold" font-size="14" fill="#ffffff" stroke="#000000" stroke-width="2" />
</rule>
<rule e="node" k="place" v="city" zoom-max="14">
<caption k="name" font-style="bold" font-size="15dp" fill="#ffffff" stroke="#000000" stroke-width="2dp" />
<caption k="name" font-style="bold" font-size="15" fill="#ffffff" stroke="#000000" stroke-width="2" />
</rule>
<rule e="node" k="place" v="country" zoom-max="6">
<caption k="name" font-style="bold" font-size="15dp" fill="#ffffff" stroke="#000000" stroke-width="2dp" />
<caption k="name" font-style="bold" font-size="15" fill="#ffffff" stroke="#000000" stroke-width="2" />
</rule>
</rule>
</rendertheme>
46 changes: 46 additions & 0 deletions Black_v3.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<rendertheme xmlns="http://mapsforge.org/renderTheme" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://mapsforge.org/renderTheme renderTheme.xsd" version="1" map-background="#000000">

<rule e="way" k="highway" v="*">
<rule e="way" k="highway" v="motorway|motorway_link|trunk|trunk_link">
<line stroke="#ffffff" stroke-width="2dp" />
</rule>
<rule e="way" k="highway" v="primary|primary_link">
<line stroke="#ffffff" stroke-width="1.5dp" />
</rule>
<rule e="way" k="highway" v="secondary|secondary_link">
<line stroke="#ffffff" stroke-width="1.2dp" />
</rule>
<rule e="way" k="highway" v="tertiary|tertiary_link">
<line stroke="#ffffff" stroke-width="1dp" />
</rule>
<rule e="way" k="highway" v="cycleway|track">
<line stroke="#ffffff" stroke-width="0.5dp" />
</rule>
<rule e="way" k="highway" v="residential">
<line stroke="#ffffff" stroke-width="0.2dp" />
</rule>
<rule e="way" k="highway" v="*">
<line stroke="#ffffff" stroke-width="0.1dp" />
</rule>
</rule>

<rule e="node" k="place" v="*">
<rule e="node" k="place" v="hamlet" zoom-min="13">
<caption k="name" font-style="bold" font-size="12dp" fill="#ffffff" stroke="#000000" stroke-width="2dp" />
</rule>
<rule e="node" k="place" v="suburb|town|village" zoom-min="12">
<caption k="name" font-style="bold" font-size="13dp" fill="#ffffff" stroke="#000000" stroke-width="2dp" />
</rule>
<rule e="node" k="place" v="island" zoom-min="10">
<caption k="name" font-style="bold" font-size="14dp" fill="#ffffff" stroke="#000000" stroke-width="2dp" />
</rule>
<rule e="node" k="place" v="city" zoom-max="14">
<caption k="name" font-style="bold" font-size="15dp" fill="#ffffff" stroke="#000000" stroke-width="2dp" />
</rule>
<rule e="node" k="place" v="country" zoom-max="6">
<caption k="name" font-style="bold" font-size="15dp" fill="#ffffff" stroke="#000000" stroke-width="2dp" />
</rule>
</rule>
</rendertheme>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ Tested with [Locus Map](https://www.locusmap.eu/). Installation steps for
Locus:

1. create directory `Locus/mapsVector/_themes/Black`
2. copy `Black.xml` to `Locus/mapsVector/_themes/Black`
2. copy `Black.xml` and `Black_v3.xml` to `Locus/mapsVector/_themes/Black`

![screenshot](https://user-images.githubusercontent.com/300342/98009997-7a8aa900-1df6-11eb-8529-7b97e4ce994d.jpg)

0 comments on commit 74592a6

Please sign in to comment.