Custom rendering in 3.1

356 views
Skip to first unread message

OA

unread,
Sep 6, 2018, 4:55:06 PM9/6/18
to Osmand
I always use my own rendering, correcting width of navigation track. It's too wide to my taste, the track covers the whole street and I always reduce its default width so I can see it inside streets. It was done by creating small file AnyName.render.xml that I put in OsmAnd folder. Content of the file is very simple:
<renderingStyle depends="OsmAnd" version="1">
 
<renderingAttribute name="route">
   
<case color="#882a4bd1" strokeWidth="5:5" color_3="#ffde5b" color_2="#bfccff" strokeWidth_3="2:1">
     
<apply_if nightMode="true" color="#ffdf3d" color_2="#806f1f" color_3="#41a6d9" strokeWidth="2:2" color_0="#CCb29c2b" strokeWidth_0="2:1"/>
   
</case>
 
</renderingAttribute>
</renderingStyle>

It worked very well until OsmAnd was updated to 3.1. Now it doesn't see my file, leaving me with only option - edit default.render.xml. First of all, it's inconvenient - the file is big (currently 645 KiB). And second, every new update overwrites this file. So, I have to go through the hassle of editing it again and again...

Is this useful functionality gone now?

Can somebody who's using custom rendering advice how to make it work again?

Thank you

Majka

unread,
Sep 7, 2018, 4:13:46 AM9/7/18
to Osmand


On Thursday, 6 September 2018 22:55:06 UTC+2, OA wrote:
I always use my own rendering, correcting width of navigation track. It's too wide to my taste, the track covers the whole street and I always reduce its default width so I can see it inside streets. It was done by creating small file AnyName.render.xml that I put in OsmAnd folder. Content of the file is very simple:
<renderingStyle depends="OsmAnd" version="1">
 
<renderingAttribute name="route">
   
<case color="#882a4bd1" strokeWidth="5:5" color_3="#ffde5b" color_2="#bfccff" strokeWidth_3="2:1">
     
<apply_if nightMode="true" color="#ffdf3d" color_2="#806f1f" color_3="#41a6d9" strokeWidth="2:2" color_0="#CCb29c2b" strokeWidth_0="2:1"/>
   
</case>
 
</renderingAttribute>
</renderingStyle>

It worked very well until OsmAnd was updated to 3.1. Now it doesn't see my file, leaving me with only option - edit default.render.xml. First of all, it's inconvenient - the file is big (currently 645 KiB). And second, every new update overwrites this file. So, I have to go through the hassle of editing it again and again...

It is working, some of the built in rendering styles use the depends.

Change it like this:
<renderingStyle depends="OsmAnd" version="1">
<renderingProperty attr="appMode" name="Rendering mode" description="Map optimization for respective User Profile"
 
type="string" possibleValues="browse map,car,bicycle,pedestrian"/>



 
<renderingAttribute name="route">
 
<case color="#882a4bd1" strokeWidth="5:5" color_3="#ffde5b" color_2="#bfccff" strokeWidth_3="2:1">
 
<apply_if nightMode="true" color="#ffdf3d" color_2="#806f1f" color_3="#41a6d9" strokeWidth="2:2" color_0="#CCb29c2b" strokeWidth_0="2:1"/>
 
</case>
 
</renderingAttribute>
</renderingStyle>

Check, if you need to change depends="OsmAnd" to depends="default".

OA

unread,
Sep 7, 2018, 2:52:03 PM9/7/18
to Osmand
On Friday, September 7, 2018 at 1:13:46 AM UTC-7, Majka wrote:

Check, if you need to change depends="OsmAnd" to depends="default".

Thank you, @Majka for looking at the issue. Do you mean I have to edit default.render.xml file? But it defeats the very elegant feature in OsmAnd - ability to overwrite default rendering settings without editing its default style file. You place your own file alongside and it's done. No editing of default file is needed, no OsmAnd update will overwrite your file... 

Majka

unread,
Sep 7, 2018, 3:24:41 PM9/7/18
to Osmand
@OA:
No, just grab the code, copy it into your custom xml. In theory, just the one line is missing.
Start Osmand, try if it works. Should it work, you are done.

If it wont work, just change the header line in my text. The depends="whatever" just says what is the underlaying file. In my case, the Osmand says "Osmand" but the file is named "default" and the depends are using this. 

OA

unread,
Sep 7, 2018, 4:43:19 PM9/7/18
to Osmand
I just tried to change my AnyName.render.xml to:
<renderingStyle depends="OsmAnd" version="1">

It did not help. Width of track is still wider, than the road itself...

May be I should put in depends the name of my file (like e.g. depends="AnyName")?

OA

unread,
Sep 7, 2018, 4:47:19 PM9/7/18
to Osmand
Sorry, for my mistype, I actually tried:
<renderingStyle depends="default" version="1">

Majka

unread,
Sep 7, 2018, 5:41:43 PM9/7/18
to Osmand
I'm sorry, but what are you doing? For sure not what I told you to do :)

The name of the file has nothing to do with anything. The change is in the first row inside of the file. 

^read the line above once more^

...
And just to be sure: The change is in the text inside, not in the name!!!
...

And now, for dummies edition:
There are two files attached, copy both in the correct folder. Start Osmand, and only one of the custom rendering files will work inside correctly. Keep this one, rename it however you want it. It does work in my installation, for me the file name "TrySecond.render.xml" works. You can name the file how you want.
TryFirst.render.xml
TrySecond.render.xml

OA

unread,
Sep 7, 2018, 6:15:21 PM9/7/18
to Osmand
First of all, thank you for trying to help!

I've just tried your files:
1. I removed default.render.xml file and all my files from rendering folder.
2. I put your TryFirst.render.xml file there
3. I started OsmAnd to see if it changed anything. It did not
4. I cleared cache from OsmAnd
5. I put your TrySecond.render.xml file into the folder
6. Started OsmAnd again and I don't see the change

Perhaps I'm doing something wrong, but with those two files I still see wider track... And even worse I don't know what to try next.

A Thompson

unread,
Sep 7, 2018, 10:29:31 PM9/7/18
to Osmand
With a up-to-date standard Android OsmAnd installation from Google Play (version 3.1.5), I cut-and pasted the xml from OA's first post into a oa.render.xml file, and downloaded both of Majka's files. All three of them had the desired effect. Hope that helps with the problem-solving, OA!

Majka

unread,
Sep 8, 2018, 2:50:23 AM9/8/18
to Osmand
You shouldn't touch anything else than YOUR custom file. There needs to be default.render.xml - this is the main file used for rendering - do not touch it at all, nor any other file created by installation. Your ADDITIONAL file simply overwrites part of it. This is the only way it can work for you. Let the editing of the installed files to people who know what they are doing. 

Can you switch rendering style inside OsmAnd now at all? I would reinstall OsmAnd, grab one of the two files, copy it and forget the rest. 

For the future - either do not touch anything or make really, really 
sure that you understand the instructions. When not clear, please do ask. Your step one was a big mistake, the rest was fine but steps 4-6 shouldn't be necessary at all. 

OA

unread,
Sep 8, 2018, 10:46:00 PM9/8/18
to Osmand
@Thompson, thank you for checking those two files. If it worked for you as desired in both cases, it means that "depends" value is irrelevant here and it could be anything. :)

@Majka,
I did step 1 to make sure, that OsmAnd is using its default rendering file and not the one, that I edited. Editing default rendering file so far the only option for me to show narrower track. Obviously I'm doing something wrong (and at least two people in this thread are confirming that), but I don't know what's wrong here.

Tomorrow I'll try it again. What should I clean up  to make sure that it'll work well as for you guys?

A Thompson

unread,
Sep 9, 2018, 9:02:28 PM9/9/18
to Osmand
On Sunday, September 9, 2018 at 3:46:00 AM UTC+1, OA wrote:
@Thompson, thank you for checking those two files. If it worked for you as desired in both cases, it means that "depends" value is irrelevant here and it could be anything. :)

That's not implied by my tests. Majka was saying that the default renderer ("OsmAnd") is special in that it goes by two names ("default" and "OsmAnd") and that you should try both if you're having problems. But I just did an experiment and it seems that if the name given with depends= is junk, then the default renderer is assumed. In general, though, if your renderer is to modify one of the non-default ones, then the name has to be exactly right. (For walking, I use one that depends on touring view here.)

@Majka,
I did step 1 to make sure, that OsmAnd is using its default rendering file and not the one, that I edited. Editing default rendering file so far the only option for me to show narrower track. Obviously I'm doing something wrong (and at least two people in this thread are confirming that), but I don't know what's wrong here.

Tomorrow I'll try it again. What should I clean up  to make sure that it'll work well as for you guys?

If you're confident that you know how to backup and restore any personal data that you care about (favourites, gox tracks, etc) then the easiest thing would be to do a clean-reinstall (you said that the problem appeared when you updated to 3.1 and I can't replicate it). But if you're not confident about that then you'd be causing more trouble for yourself, and I'd wait for the next official update to see if that installation fixes your problem.

With sympathy ;-)
A.

OA

unread,
Sep 10, 2018, 4:04:22 PM9/10/18
to Osmand
On Sunday, September 9, 2018 at 6:02:28 PM UTC-7, A Thompson wrote:
If you're confident that you know how to backup and restore any personal data that you care about (favourites, gox tracks, etc) then the easiest thing would be to do a clean-reinstall (you said that the problem appeared when you updated to 3.1 and I can't replicate it). But if you're not confident about that then you'd be causing more trouble for yourself, and I'd wait for the next official update to see if that installation fixes your problem.

With sympathy ;-)
A.

Thank you. In a desperate attempt to fix the problem I've decided to re-install OsmAnd. That's what I did:
1. I've synched two folders:
  SDCard\osmand
 
Phone\Android\data\net.osmand\files
2. I made backup with Titanium Backup
3. Uninstalled OsmAnd
4. Installed OsmAnd back again
5. I've synched back two folders (see p.1)
6. Restored backup data with Titanium Backup (to see my local maps)

When I tried to make route, the track shown is wider than the street itself... :(

I have to edit default rendering file again to make it work. I just hope for a new version of OsmAnd to have it fixed. Otherwise, I'll have to edit default rendering file again and again :(

Majka

unread,
Sep 12, 2018, 1:58:27 AM9/12/18
to Osmand
No wrong again, you have just overwritten the correct installation with your BAD non working settings back - you have nullified the whole reason for reinstall by this.
You have to keep the rendering folder as installed. Do it again, but before restoring your settings copy the folder AS INSTALLED somewhere else. Restore your settings, copy the content of the folder AS INSTALLED back . Put one of the provided files into the same folder without changing anything . Done.

OA

unread,
Sep 12, 2018, 2:55:49 PM9/12/18
to Osmand
What settings are bad from my previous installation? I'd like to check all of them, one by one, if that's the problem. Restoring old settings with Titanium backup is needed to save me couple of hours on writing down all old settings (which as you said could contain some problems) and then setting all of them back again. So, if the settings are the problem, I'd appreciate any specific instructions on where to look at.

Rendering folder contains only two files:
  default.render.xml
 
TryFirst.render.xml

As I mentioned earlier I can get initial default.render.xml file at any time by removing it from the folder and then running OsmAnd. It will re-create the file immediately. So, it's guaranteed that it's native default file coming from OsmAnd and not changed in any way. The second file is working well for two participants of this thread. So, it should not be a problem too.

Majka

unread,
Sep 12, 2018, 3:19:12 PM9/12/18
to Osmand
Then recreate the file! You need both, the original one and either of those provided here as attachment. You need both in the correct folder.
Do not touch anything else, do not change a bit, no editing, no renaming. Simply recreate the file from the app and put the new there as well.
Restart Osmand, select the additional renderer, done.

It should work, there is nothing else to do.

OA

unread,
Sep 12, 2018, 3:52:42 PM9/12/18
to Osmand
I recreated default.render.xml file, put your file into rendering folder. I did not change anything even a bit. Then I restarted OsmAnd and it did not change its default rendering...

Restart Osmand, select the additional renderer, done.

How to select it? 
 

Majka

unread,
Sep 13, 2018, 5:02:25 AM9/13/18
to Osmand

Renderer.png

 

OA

unread,
Sep 13, 2018, 3:54:10 PM9/13/18
to Osmand
Thank you, Majka.

I have OsmAnd 3.1.5, released 2018-08-10 on my phone and there is no TryFirst item between Touring view and UniRS. Should I try something else instead?

Majka

unread,
Sep 13, 2018, 5:56:20 PM9/13/18
to Osmand


On Thursday, 13 September 2018 21:54:10 UTC+2, OA wrote:
Thank you, Majka.

I have OsmAnd 3.1.5, released 2018-08-10 on my phone and there is no TryFirst item between Touring view and UniRS. Should I try something else instead?


I do sincerely hope you are just kidding.

Read this message again. Read it aloud and repeat it as many times as you need to understand what you should be doing. If this doesn't help, read several times the last sentence from here

You can grab the missing file here.

Do not come back until you can show me a screenshot of the mentioned folder, where you have both the default.render.xml and TryFirst.render.xml files inside. 


OA

unread,
Sep 14, 2018, 3:13:54 PM9/14/18
to Osmand


On Thursday, September 13, 2018 at 2:56:20 PM UTC-7, Majka wrote:


On Thursday, 13 September 2018 21:54:10 UTC+2, OA wrote:
Thank you, Majka.

I have OsmAnd 3.1.5, released 2018-08-10 on my phone and there is no TryFirst item between Touring view and UniRS. Should I try something else instead?


I do sincerely hope you are just kidding.
No, I'm not. There is no reason for me whatsoever to make anything up here. I'm interested in finding solution.

If I said, that I removed default.rendering.xml to make sure that I'm using OsmAnd's default rendering file, I mean it. If I said, that I see route track wider, than street road, I mean it too.

Do not come back until you can show me a screenshot of the mentioned folder, where you have both the default.render.xml and TryFirst.render.xml files inside. 

If I said, that I have only two files in rendering folder, I mean it. See RenderingFolder.jpg attached.

If I said, that my OsmAnd has version 3.1.5 released 2018-08-10, I mean it. See OsmAndVersion.jpg attached. If you have different version of OsmAnd, that could easily explain why we see different results. What version do you have?
RenderingFolder.png
OsmAndVersion.png

Majka

unread,
Sep 15, 2018, 6:15:41 PM9/15/18
to Osmand
What do you see if you try to switch the renderer? I cannot understand why you shouldn't see the renderer. You did say you had used your old one, it simply stopped working. Well, I have corrected the missing line inside. There shouldn't be any other change. I could understand if the renderer wasn't working, but not that you cannot even see it.

I am using nightly version, but this means nothing for you. When you try to switch the renderer, there is no check against the contents of the file, it does check only what files do exist in the folder. 

You have confirmation here that it works with standard installation and this is what you have on your phone. 

I am ready to give up.

Last try:
Take a screenshot of the settings with your data folder (Settings > common settings > data folder)
Take a screenshot of the map styles as described here

OA

unread,
Sep 15, 2018, 8:45:33 PM9/15/18
to Osmand
I got it working by switching the renderer! :)

My fault was - I did not point to specific renderer in order to make it work. Now I know that I have to do 2 things:
1. put my rendering file into rendering folder
2. choose it in "Map style" menu
The second step is very important!

Thanks a lot, @Majka! Your input was very helpful here :)
Reply all
Reply to author
Forward
0 new messages