maplibre / maplibre-plugins-android

MapLibre Native for Android Plugins
https://maplibre.org/
BSD 2-Clause "Simplified" License
24 stars 25 forks source link

Most demos crash due to not finding Streets layer #62

Open ahmedre opened 2 months ago

ahmedre commented 2 months ago

When I run the demo (after setting maptilerApiKey in local.properties), the vast majority of the samples in the sample app fail with this exception:

FATAL EXCEPTION: main
Process: org.maplibre.android.plugins.testapp, PID: 14496
java.lang.IllegalArgumentException: Could not find layer Streets
  at org.maplibre.android.maps.Style.getPredefinedStyle(Style.java:1430)
  at org.maplibre.android.plugins.testapp.activity.annotation.CircleActivity.lambda$onCreate$4$org-maplibre-android-plugins-testapp-activity-annotation-CircleActivity(CircleActivity.java:48)
  at org.maplibre.android.plugins.testapp.activity.annotation.CircleActivity$$ExternalSyntheticLambda4.onMapReady(Unknown Source:4)
  at org.maplibre.android.maps.MapView$MapCallback.onMapReady(MapView.java:1324)

if I instead edit PluginApplication and update:

  MapLibre.getInstance(this)

to

  MapLibre.getInstance(this, BuildConfig.MAPTILER_API_KEY, WellKnownTileServer.MapTiler)

many of the demos work, (though others crash still with the same exception with layer Outdoors instead of Streets). Is there any piece of setup I am missing here?

Also, is mapbox_access_token actually used? I set it, but I don't see anything in the code that reads it (neither in this repo nor in maplibre-native, minus some of their sample code).

Thanks!

louwers commented 4 weeks ago

We should replace the predefined styles with something like OpenFreeMap or Protomaps.

ravenfeld commented 2 weeks ago

@ahmedre The example has been updated.

ahmedre commented 2 weeks ago

thank you! 🎉