Locus Map - forum

Content & Tools => Themes - Vector maps => Topic started by: karlchick on April 19, 2020, 01:38:58

Title: [Theme] OS Map (v20200427 for v3 maps only)
Post by: karlchick on April 19, 2020, 01:38:58
Having used UK Ordnance Survey (OS) maps all my life, when I started using Locus Map I was desperate for a map theme that looked similar. After using both Voluntary UK and OS Style themes for a while, I still hankered after something closer to the style of the original UK OS maps. So I decided to create my own theme that tries to emulate the Ordnance Survey 1:25k and 1:50k map styles as closely as is possible within the constraints of Locus Map and data provided by the vector maps. It should work with both LoMap and OAM maps. I must give credit to John Campbell for his Voluntary UK theme that I used as a starting point (v. 190101).

There are 6 maps styles provided in the theme:
Dynamic Scale automatically switches from 50k to 25k at zoom level 16.
Night Modes provide a darker colour scheme for night usage that preserve the OS colour, but muted a bit. I don't like the built in night mode as it inverts all the colours.

There are also several overlay options:
I used google translate to define the translations, so let me know if there are more appropriate translations.

I also created PDF legends for the 25k and 50k themes to show what is supported/different using a similar style to the original OS legends with screenshots from Locus Map and the theme's own symbols etc.

Last attachment is a ZIP of the theme. (now with .nomedia files, thanks Henk van der Spek for pointing that out).

Install in the usual way of unzipping in Locus Map's _theme folder, e.g.:

\<root>\Android\data\menion.android.locus.pro\files\Locus\mapsVector\_themes

I've only tried this on my phone (Samsung Galaxy A3) and tablet (Samsung Galaxy Note 10.1 2014). It is quite a big theme file now (~10,000 lines)  because it contains so many different categories and overlay options. I am interested to know if it works OK for everyone. I have considered creating a "lite" 25k only option to see it is works faster or not...

I am putting this theme out there as I feel it might be of interest to others. It is provided as is.
I am not inclined to spend a lot of time working on it, but you are welcome to modify it for your own purposes.

Let me know if there some major problems with the theme.

Here is a comparison of the same map rendered with: Internal Theme, Voluntary UK, OS Style and my new 4 OS map styles (also attached as ThemePreviews_LORES.jpg but lower resolution):

(https://sites.google.com/site/chicknet/images/ThemePreviews.jpg)
USE SCROLL BAR TO VIEW THE REST >>>>

UPDATE 2020.04.27
I have fixed:
   - couple of  mistakes in the legends
   - added to the legends some additional overlay footer notes.
   - country borders to include admin_levels 2, 3 and 4 now.
   - rounded locks in rivers now square
   - some syntax errors I found during porting to v4 (which is now about 50% completed).

I've updated the attachments with new versions, hence their counters are reset.
Title: Re: [Theme] OS Map
Post by: Henk van der Spek on April 19, 2020, 08:42:09
Hi Karl,

I would love to test it but it seems not compatible with the V4 ML maps from openandromaps.org that I mostly use.
I checked it out on an older map V3 map from another country (where I can not go to now) and it looks very promising.
Let me know of this can be fixed and I will be happy to give you moere feedback, because we still can hike at home.
Title: Re: [Theme] OS Map
Post by: karlchick on April 19, 2020, 11:38:08
Quote from: Henk van der Spek on April 19, 2020, 08:42:09
I would love to test it but it seems not compatible with the V4 ML maps from openandromaps.org that I mostly use.
Hi Henk, I thought I am using it with all the UK v4 OAM maps without issue (but I think I have v3 maps). Can you provide me link to the download for the map you can't use?
Thanks Karl
Title: Re: [Theme] OS Map
Post by: Henk van der Spek on April 19, 2020, 11:57:04
Thanks for your answer.
Sure, here it is: https://www.openandromaps.org/en/downloads/europe
And when I am viewing a V4 map your theme is not shown in the theme selection.
When I open a V3 map and select your theme all shows good. But then I pan to my own V4 region and the map is empty (not shown). Even after selecting that map by hand.
Title: Re: [Theme] OS Map
Post by: poutnikl on April 19, 2020, 12:02:15
It looks like very fine theme, but I confirm for OAM Austria ML map v4 from July 3,  it is not listed among available themes for the map.
Not sure about the new maps provided with Locus compatible POIs DB.

And WOW!! The PDF legends are positively 1A quality !

Sent from my Xiaomi MI A2 / Android 10, via Tapatalk
Title: Re: [Theme] OS Map
Post by: Andrew Heard on April 19, 2020, 12:13:33
The theme isn't listed when I display a V4 OpenAndoMap of Tasmania (Australia).

The legend PDF is very nicely presented. I would be SO GOOD if Locus team & other theme providers could provide a legend of this exceptional quality.
Title: Re: [Theme] OS Map
Post by: karlchick on April 19, 2020, 12:56:56
Hmm... I'm now wondering if I am actually using v3 maps after all... You are correct, all the v4 maps I tried do not work with OS Map theme.... I've started to look into it, seems v4 maps are handled differently in Locus Map from v3. I looked at how Velocity works for v3 and v4 and I got OS Map to be selectable for v4 maps but it displays nothing so far, seems I need would need create a new theme for v4 maps using different scalings/sizes etc... quite a bit of work.  Note Velocity is supporting v4 with a completely different theme with the same name...

For now I would suggest that this theme is for v3 maps only (I changed the post's title to reflect this too). I will look to see if I can get a v4 version working, but I suspect this may take some time. If anyone has any tips of converting v3 theme to v4 theme I would be glad to hear. Seems the zoom levels are reduced by 2 and line thicknesses are narrower and not using "dp" values...

Update: Found this might be useful: http://www.maiwolf.de/locus/
Update: Also found: https://www.openandromaps.org/en/oam-forums/topic/mapsforge-rendertheme-reference

Karl.
Title: Re: [Theme] OS Map (v3 maps)
Post by: Tapio on April 19, 2020, 16:09:47
Oh no  :) Most of us will use V4 maps, they aremuch better especially for text display order reasons. Thanks for your work though.
Title: Re: [Theme] OS Map (v3 maps)
Post by: Žajdlík Josef on April 19, 2020, 18:25:18
Nice map theme.  Would it be possible to highlight special bike paths?  See scr.  the cycle path is purple in color.
Title: Re: [Theme] OS Map (v3 maps)
Post by: Menion on April 19, 2020, 19:08:14
Just to refine @tapio post a little .. "most of us" at the forum, it's possible. By my older stats, it was about 60-70% users use LoMaps (V3), rest use combination of OpenAndroMaps (mainly) + some others.

Appreciate your work, looks pretty nice! If you would be interested to put it into Locus Store for direct download over the app, just let me know, @voldapet will help with it.
Title: Re: [Theme] OS Map (v3 maps)
Post by: Henk van der Spek on April 19, 2020, 19:33:29
@Žajdlík Josef: offcourse you saw the settings in the theme for highlighting?
For me I am also missing the names of the hiking trails like E3 and GR5.
And also please put a .nomedia  file in your directories :) otherwise my Gallery App is flooded.  :)
Title: Re: [Theme] OS Map (v3 maps)
Post by: Žajdlík Josef on April 19, 2020, 19:45:59
The accentuation will be felt on all cycle routes, not just on roads specially built for cyclists.
Title: Re: [Theme] OS Map (v3 maps)
Post by: karlchick on April 19, 2020, 19:49:23
Quote from: Henk van der Spek on April 19, 2020, 19:33:29
For me I am also missing the names of the hiking trails like E3 and GR5.
And also please put a .nomedia  file in your directories :) otherwise my Gallery App is flooded.  :)

I've replaced the theme with an updated version that now contains .nomedia files. I had them in there originally, but got over zealous deleting unused files before posting.

The hiking trails by default do not display their name labels (CW) but rather their full textual names (Cotswold Way). This is to be as compliant with Ordnance Survey's own maps. I have noticed that most non-LoMaps do not support this full name text of hiking trails, so I have included support for displaying the hiking trail labels, these are enabled by selecting the overlay "non-OS symbols" - you'll see in the Legends that all the non-OS symbols have a little 'cross' symbol next to them and a foot-note that tells you which overlay option selects them.

Hope that helps, Karl.
Title: Re: [Theme] OS Map (v3 maps)
Post by: karlchick on April 19, 2020, 19:52:50
Quote from: Žajdlík Josef on April 19, 2020, 19:45:59
The accentuation will be felt on all cycle routes, not just on roads specially built for cyclists.

Hi Žajdlík Josef, which theme are you using that highlights cycle routes differently for roads vs off-road routes?  I was trying to figure out a way to differentiate between them because OS maps use a different symbol for non-traffic routes, but I couldn't figure out any way of doing it.

Having said that, in your example the cycle track is not on the road... so perhaps it is just the surface type...   The highlighting scheme was kept from the original Voluntary UK theme...
Karl.
Title: Re: [Theme] OS Map (v3 maps)
Post by: Žajdlík Josef on April 19, 2020, 20:01:16
I use Pawscyclist from the link below, but the Locus theme also shows the difference.
https://osm.paws.cz/render_themes.php
Sorry, my English is not very good.  These are special trails that cyclists can ride but no cars.  For cyclists on road bikes, these trails are important because they always have a solid base.
Title: Re: [Theme] OS Map (v3 maps)
Post by: karlchick on April 19, 2020, 20:13:46
Quote from: menion on April 19, 2020, 19:08:14
By my older stats, it was about 60-70% users use LoMaps (V3), rest use combination of OpenAndroMaps (mainly) + some others.

Appreciate your work, looks pretty nice! If you would be interested to put it into Locus Store for direct download over the app, just let me know, @voldapet will help with it.

Thanks Menion for the positive feedback. I have been delaying posting the theme for a while because there is always something additional to add. In fact on my list of things I really want to fix are:
   - Toll roads not as per OS yet.
   - Airport runways at 1:50k not same as OS.

I am more than happy to include the theme in the Locus Store. I thought it makes sense to see what the "early testers" find and fix first... Is there much involved in making it ready for direct download?
Title: Re: [Theme] OS Map (v3 maps)
Post by: john_percy on April 20, 2020, 11:52:33
@karlchick
By all means look at my latest Voluntary Mapsforge version (for v4 maps) and compare with the latest Voluntary Locus version (for v3 maps and LoMaps) to give some help on the changes needed for v4.
By the way, I've not managed to download your zip satisfactorily using Tapatalk.



Sent from my moto g(6) plus using Tapatalk

Title: Re: [Theme] OS Map (v3 maps)
Post by: poutnikl on April 20, 2020, 11:57:11
Quote from: john_percy on April 20, 2020, 11:52:33
By the way, I've not managed to download your zip satisfactorily using Tapatalk.

I have always troubles with TT downloads. It either truncates the file, either downloads some thumbnail image of the attachments.

All 3 files ( theme + 2 PDFs ) had the same size I guess like 14 kB, instead of cca 500 kB.

I always go rather to web to download anything there.



Sent from my Xiaomi MI A2 / Android 10, via Tapatalk
Title: Re: [Theme] OS Map (v3 maps)
Post by: john_percy on April 20, 2020, 12:39:06
@poutnikl
Thanks for the tip
@karlchick
Congratulations! You've done a very good job of emulating OS maps.


Sent from my moto g(6) plus using Tapatalk

Title: Re: [Theme] OS Map (v3 maps)
Post by: karlchick on April 20, 2020, 14:24:21
I've started porting the theme into a version for v4 maps. It is going well so far, I am transferring section by section.  However, the OS Map theme makes extensive use of many v3 locus extended rendering options that are not supported in v4, so i do not think the v4 version will be as good as the v3 version.  Missing the ability for dash arrays to scale up as you zoom in. This will affect a lot of the theme elements that make it similar to OS maps.
Title: Re: [Theme] OS Map (v3 maps)
Post by: john_percy on April 20, 2020, 14:37:33
Dash arrays can scale in v4 (possibly it's a v5 feature, available in Locus). Check my Voluntary Mapsforge theme as an example.

Title: Re: [Theme] OS Map (v3 maps)
Post by: FriedelXT on April 27, 2020, 09:26:30
Wow!
Very nice map themes. This will be my favorite for motorbiking.
Many Thanks!

I have 2 questions.
I see purple street markers (only) in netherland. What is this? It is disturbing while driving, i think. maybe you can make it for hide
Second.....I see a lot of "fm" on houses in landscape. What is this?

Greetings
Friedhelm
Title: Re: [Theme] OS Map (v3 maps)
Post by: john_percy on April 27, 2020, 09:37:53
Fm = Farm


Sent from my moto g(6) plus using Tapatalk

Title: Re: [Theme] OS Map (v3 maps)
Post by: karlchick on April 27, 2020, 09:50:41
The "purple markers" are to highlight or emphasise protected areas that might have restricted access. In the UK they seem to match quite closely the OS map land access areas.

You can deselect them in the overlay options of the theme by unticking "emphasise land access".
Title: Re: [Theme] OS Map (v3 maps)
Post by: FriedelXT on April 27, 2020, 09:56:29
Ahh,
thanks for answer.
But I think it would better to use an extra option for hiding, because I want see land access (without restricted area)
And....I have realize that you forget to show borders :-)
Title: Re: [Theme] OS Map (v3 maps)
Post by: karlchick on April 27, 2020, 10:50:02
Quote from: FriedelXT on April 27, 2020, 09:56:29
But I think it would better to use an extra option for hiding, because I want see land access (without restricted area)
And....I have realize that you forget to show borders :-)

Land access is shown separately from restricted areas, see attached which shows the two areas overlapping.

I will look into borders. I have mainly focused on UK usage and put in support for borders on admin_levels of 4=country, 6=county, 8=districts and 10=parish. However, it seems the UK maps only support country borders.... Perhaps if I got this wrong someone can hint what the correct mappings of admin_levels should be... perhaps some of the unused levels are used in other maps...?
Title: Re: [Theme] OS Map (v3 maps)
Post by: FriedelXT on April 27, 2020, 11:35:13
ok, then I misunderstood the description
I am very happy with this theme
I can see all important streets and others also in higher zoom level. And with zoom out you hide the right things.
Good work!
Title: Re: [Theme] OS Map (v3 maps)
Post by: karlchick on April 29, 2020, 22:36:39
Quote from: karlchick on April 27, 2020, 10:50:02I will look into borders. I have mainly focused on UK usage and put in support for borders on admin_levels of 4=country, 6=county, 8=districts and 10=parish. However, it seems the UK maps only support country borders....

I updated the theme to include admin levels 2 and 3 together with existing used level 4 to the country borders, this seems to work. I hope this is the correct interpretation of admin levels...
Title: Re: [Theme] OS Map (v3 maps)
Post by: FriedelXT on May 03, 2020, 01:01:30
Quote from: karlchick on April 29, 2020, 22:36:39
Quote from: karlchick on April 27, 2020, 10:50:02I will look into borders. I have mainly focused on UK usage and put in support for borders on admin_levels of 4=country, 6=county, 8=districts and 10=parish. However, it seems the UK maps only support country borders....

I updated the theme to include admin levels 2 and 3 together with existing used level 4 to the country borders, this seems to work. I hope this is the correct interpretation of admin levels...


I see the borders. thanks.
But not such present. maybe you can use other patterns like this:
Title: Re: [Theme] OS Map (v3 maps)
Post by: FriedelXT on May 03, 2020, 01:10:23
Quote from: karlchick on April 29, 2020, 22:36:39
Quote from: karlchick on April 27, 2020, 10:50:02I will look into borders. I have mainly focused on UK usage and put in support for borders on admin_levels of 4=country, 6=county, 8=districts and 10=parish. However, it seems the UK maps only support country borders....

I updated the theme to include admin levels 2 and 3 together with existing used level 4 to the country borders, this seems to work. I hope this is the correct interpretation of admin levels...


can you tell me how I can learn modify map themes?
I like to change some colors of roads
Title: Re: [Theme] OS Map (v3 maps)
Post by: karlchick on May 03, 2020, 03:18:02
Quote from: FriedelXT on May 03, 2020, 01:10:23
can you tell me how I can learn modify map themes?
I mean one time I saw an online editor...

As far as a I know, there is no editor for map themes...

But I can point you in the direction of some information that will tell you what you need to know:

https://github.com/mapsforge/mapsforge/blob/master/docs/Rendertheme.md (https://github.com/mapsforge/mapsforge/blob/master/docs/Rendertheme.md)

This gives a good background to creating XML theme files. the following gives you some LocusMap specific information too:

https://docs.locusmap.eu/doku.php?id=manual:advanced:map_tools:theming (https://docs.locusmap.eu/doku.php?id=manual:advanced:map_tools:theming)

In additional you will need a good text editor. I can highly recommend NotePad++ which is what I am using (the portable version, so I can keep it on a USB stick and use on any machine).

I have installed into Notepad++ a plugin called "Quick Color picker +" which allows you to modify the hex colors directly in the theme with a pop-up colour picker. You can find the plugin at:

https://github.com/nulled666/nppqcp/ (https://github.com/nulled666/nppqcp/)

I would suggest starting with modifying an existing theme that is for v3 maps, as the render engine for v4  is very intolerant to syntax errors and will refuse to display anything when one is found.

Good luck.
Title: Re: [Theme] OS Map (v3 maps)
Post by: Tapio on May 03, 2020, 06:59:28
Yeah, DIY and a decent Editor, I prefer Microsoft Visual Studio Code, an awesome editor, even many of my diehard Unix people at work like it.
Title: Re: [Theme] OS Map (v3 maps)
Post by: FriedelXT on May 03, 2020, 14:58:05
Thanks for answers,
I cant use your prefered editors, because I am on Apple.
But found a good editor, i think. But till now I dont understand so much.
Its not like in "elevate".
Can you show me the passage where i can edit motorway color?
Title: Re: [Theme] OS Map (v3 maps)
Post by: karlchick on May 03, 2020, 15:41:23
Quote from: FriedelXT on May 03, 2020, 14:58:05
Can you show me the passage where i can edit motorway color?

Line 5948:

            <!-- Highway Cores: Motorway, OS: Blue -->
            <rule cat="day" e="way" k="highway" v="motorway">
               <line stroke="#08b8e8" stroke-width="1.4dp"  />
            </rule>
            <rule cat="night" e="way" k="highway" v="motorway">
               <line stroke="#0b8cb0" stroke-width="1.4dp"  />
            </rule>


The above is the blue core colour for motorway ways. You also need to change the motorway_link core colours at line 5792. Also the motorway labels perhaps...

I should warn you that the OS Map theme is quite a complex theme to work with as it contains 6 different map styles.

I'm currently porting this theme to v4 maps and as a result of have hit a problem changing the map background colour for night mode. So, I might split the theme into two separate themes for day and night, and probably generate the night theme from the day theme using a script.   This will reduce the size of the theme file a lot, so might improve performance for v4 maps...
Title: Re: [Theme] OS Map (v3 maps)
Post by: Viajero Perdido on May 03, 2020, 18:31:23
Quote from: FriedelXT on May 03, 2020, 14:58:05
I cant use your prefered editors, because I am on Apple.
Visual Studio Code, suggested above, does work on Apple.  https://code.visualstudio.com/Download

Also Linux, which is good news for me.  One of my to-do list items has been to find a decent editor for themes.  A task I've been sort of dreading, sort of looking forward to...
Title: Re: [Theme] OS Map (v3 maps)
Post by: FriedelXT on May 03, 2020, 19:32:28
Quote from: karlchick on May 03, 2020, 15:41:23

I should warn you that the OS Map theme is quite a complex theme to work with as it contains 6 different map styles.

thanks karl.
I realize already that is very complex! uff!
Title: Re: [Theme] OS Map (v3 maps)
Post by: poutnikl on May 04, 2020, 11:47:30
For smaller on-place changes, like a theme tweaking, there is the good Android editor Quickedit.

https://play.google.com/store/apps/details?id=com.rhmsoft.edit

It does not do code folding, but it supports XML syntax highlighting and regex.

Sent from my Xiaomi MI A2 / Android 10, via Tapatalk
(https://uploads.tapatalk-cdn.com/20200504/4885471eeedd00581d25da98982cf0c9.jpg)
Title: Re: [Theme] OS Map (v3 maps)
Post by: FriedelXT on May 04, 2020, 19:28:33
Thanks.
Yesterday, after hours i could tweak some things insite the theme.
- Autobahn color
- hiding parking till zoom 19
- hiding football till zoom 19
- do better viewing borders
- see earlier grass