Internal Render Theme - Where is osmarender.xml

909 views
Skip to first unread message

Charles Sweeney

unread,
Apr 21, 2015, 9:27:15 AM4/21/15
to mapsfo...@googlegroups.com
I see in mapsforge/map/rendertheme/InternalRenderTheme.java that the internal render theme is:

OSMARENDER("/osmarender/", "osmarender.xml");

I can't find "/osmarender/" or "osmarender.xml"

In Android Studio my project files show:

...\app\src\main\assets\renderthemes

assets.xml
assetssvg.xml
detailed.xml
driving.xml
onlybuildings.xml
osmarendernopng.xml

Where is osmarender.xml?

I am calling the internal render theme in BasicMapViewer with:

protected XmlRenderTheme getRenderTheme() {
        return InternalRenderTheme.OSMARENDER;
    }

...so if osmarender.xml isn't in my render themes, where is it?

I want to edit it so I can change the look of the map.

Emux

unread,
Apr 21, 2015, 9:40:08 AM4/21/15
to mapsfo...@googlegroups.com
Osmarender theme is in the root of Mapsforge map module under osmarender folder.

https://github.com/mapsforge/mapsforge/tree/master/mapsforge-map/src/main/resources/osmarender

--
Emux
Cruiser - Atlas

Charles Sweeney

unread,
Apr 21, 2015, 10:06:40 AM4/21/15
to mapsfo...@googlegroups.com
Thank you for the very quick reply, Emux.

Okay, as it's in the mapsforge library it's not very convenient for me to edit it.

So I suppose I have to use an "external" render theme.  Would that be the ones I have here?:


...\app\src\main\assets\renderthemes

Would I put my own theme in there?

How would I call it?  I currently have:

return InternalRenderTheme.OSMARENDER;

Emux

unread,
Apr 21, 2015, 11:51:50 AM4/21/15
to mapsfo...@googlegroups.com
You can use an external render theme from the file system or Assets folder.
Check the Samples for examples, i.e. RenderTheme4

Emux

unread,
Apr 21, 2015, 11:58:41 AM4/21/15
to mapsfo...@googlegroups.com
The use of render theme from file system is:
new ExternalRenderTheme(renderThemeFile);

It's important to use the proper prefix for the resources in the render theme file (assets, file, jar), depending on the situation.

Again the examples describe it better.

Charles Sweeney

unread,
Apr 21, 2015, 6:28:21 PM4/21/15
to mapsfo...@googlegroups.com
Thank you very much, Emux.  I'll check it out.

Charles Sweeney

unread,
Apr 22, 2015, 9:42:14 AM4/22/15
to mapsfo...@googlegroups.com
Android Studio is giving me errors for osmarender.xml when using the latest render theme version.

For this:

xsi:schemaLocation="http://mapsforge.org/renderTheme ../renderTheme-v4.xsd"

...I get:

"Cannot resolve file 'renderTheme-v4.xsd'"

For this:

map-background-outside="#dddddd"

...I get:

"Attribute map-background-outside is not allowed here"

I am also getting some errors like:

For this:

<symbol id="monument" src="jar:symbols/monument.svg" />

...I get:

"Attribute id is not allowed here"

For this:

<caption symbol-id="monument" k="name" position="above"...

...I get:

"Attribute symbol-id is not allowed here" and "Attribute position is not allowed here"

Otherwise it seems to be working ok but doesn't look great with all the red error highlighting.

Emux

unread,
Apr 22, 2015, 9:46:19 AM4/22/15
to mapsfo...@googlegroups.com
It tries to validate the xml render theme with its schema xsd file.

Either correct the path in render theme or move accordingly the xsd.

Reply all
Reply to author
Forward
0 new messages