OpenMapTiles styling

66 views
Skip to first unread message

Zoran Smilevski

unread,
Sep 20, 2018, 10:33:00 AM9/20/18
to mapsforge-dev
Hello!

I'm using OpenMapTiles maps with VTM and would like to render it with a similar theme like OSM Bright. First I tried to write a xml theme, but then saw that would be easier to write custom ThemeBuilder. So I started writing JsonThemeBuilder which parses Maputnik JSON output and now I have a problem with some filter implementations.

Example for layer "place-country-other" in OSM Bright style:

"filter": [
"all",
[
"==",
"class",
"country"
],
[
">=",
"rank",
3
],
[
"!has",
"iso_a2"
]
]

For first filter is easy, I just need to create a parent rule with k="class" and v="country". Also last is possible with parent rule where k="iso_a2" and v="~". But how to implement second rule? Is that even possible? Do I need to write a custom Rule class and implement matchesTags function? Or I'm doing completely wrong that?

Thanks for any advice!

Emux

unread,
Sep 20, 2018, 10:56:12 AM9/20/18
to mapsfo...@googlegroups.com
Why not just use regular xml themes which are supported by the library and used by all?

There is a openmaptiles.xml theme example used in OpenMapTilesMvtActivity sample.

--
Emux

Zoran Smilevski

unread,
Sep 20, 2018, 11:50:28 AM9/20/18
to mapsforge-dev
Yes, I tried, it works fine, but OSM Bright theme is much more beautiful in my opinion. So I wanted to replicate it. And is easy to make custom styles with Maputnik. So why not support it? Can make a pull request if someone else is interested in this, I guess I'm not the only one who's interested in this. VTM looks much nicer project than Mapbox.

Emux

unread,
Sep 20, 2018, 12:01:58 PM9/20/18
to mapsfo...@googlegroups.com
Theme format alone cannot determine map appearance.
It's actually map / theme engine which defines rendering.

If anyone wants to try different theme format for VTM, I'd be happy to review it.

Note: if need extra dependencies, then should exist in separate module.

--
Emux
Reply all
Reply to author
Forward
0 new messages