RenderTheme v4 or newer in mapsforge

182 views
Skip to first unread message

xNx

unread,
Oct 2, 2016, 8:38:37 AM10/2/16
to mapsforge-dev
hello
i'm using mapsforge to display offline maps, it shows with default theme like this:-


i want it to display like this :-



so how i can display with rendertheme v4 or newer ? how i can add it to my project ?


Emux

unread,
Oct 2, 2016, 8:42:00 AM10/2/16
to mapsfo...@googlegroups.com
1st screenshot is from included default Osmarender theme.

2nd screenshot is from rendertheme-v4, currently being in Samples assets folder.
You can get it from there and try it, seeing also how it can be used.

--
Emux
Message has been deleted

Emux

unread,
Oct 2, 2016, 8:51:05 AM10/2/16
to mapsfo...@googlegroups.com
Please invest some time to study the sample, e.g. here.

--
Emux

xNx

unread,
Oct 2, 2016, 8:57:47 AM10/2/16
to mapsforge-dev
ok ,thank you so much

xNx

unread,
Oct 2, 2016, 2:00:10 PM10/2/16
to mapsforge-dev
excuse me Emux, i have added assets folder to my project then I wrote this function :-

protected XmlRenderTheme getRenderTheme() {
try {
return new AssetsRenderTheme(this.getApplicationContext(), "", "renderthemes/rendertheme-v4.xml");
} catch (final IOException e) {
Toast.makeText(MainActivity.this,"render fails",Toast.LENGTH_LONG).show();
}
return null;
} 
 
and i added to tilerender ;-
tileRendererLayer.setXmlRenderTheme( getRenderTheme());


but it display like this :-

it doesn't looks that good without building, water...etc 

what is wrong ? Did I forget something ?


 

Emux

unread,
Oct 2, 2016, 2:21:25 PM10/2/16
to mapsfo...@googlegroups.com
Render theme v4+ supports theme styles i.e. turn on / off map layers.

But to not confuse you for start, let's proceed with all layers enabled.
Your constructor is correct, don't using the menuCallback parameter.

I tried it on Samples and it shows all layers.
Have you put correctly the patterns / symbols resources inside assets folder?

--
Emux

xNx

unread,
Oct 2, 2016, 3:29:13 PM10/2/16
to mapsforge-dev
the problem really was with my town it's small and it has not nice places and buildings that's why it looks like that loool :) 
i tried the code with other country it looks great 
thanx 
Reply all
Reply to author
Forward
0 new messages