Setting maptiler as tile source produces a black map, how to fix?

Hello, I’ve been trying to get the graphhopper Android example working for the past 2 days.

In my strings.xml I did

`    <!-- The style used for regular map viewing and route planning -->
<string name="map_view_styleUrl" translatable="false">https://api.maptiler.com/tiles/v3/tiles.json?key=</string>
<!-- The "day" style used for navigation -->
<string name="navigation_guidance_day" translatable="false">https://api.maptiler.com/tiles/v3/tiles.json?key=</string>
<!-- The "night" style used for navigation -->
<string name="navigation_guidance_night" translatable="false">https://api.maptiler.com/tiles/v3/tiles.json?key=</string>`

(with the keys included) and that gives me a black map.Like, entirely black.
34

The urls themselves do seem to be correct because when I change the key I get the standard
20

What is going on there? Do I use the wrong tiles? I eventually want to self-host them or include them right into the app but as of now I don’t understand how to get them right in first instance.

Thank you

You are passing the tile.json endpoint, but you need to pass a style url (for example to OSM Bright).

Have a look at the the original developer-config.xml where we pass:

https://tiles.mapilion.com/assets/osm-bright/style.json?key=[MAP_API_KEY]

2 Likes

Thank you that worked. Your project is so helpful it’s unreal.

1 Like