Skip to content

A demo project that shows some current issues with the mapbox Android SDK

Notifications You must be signed in to change notification settings

florianPOLARSTEPS/mapbox-image-loading

Repository files navigation

mapbox-issues

  • The first project MainActivityAsyncImageLoading.kt shows a common use-case for asynchronous image-generation with mapbox.
  • The second project MainActivityClusteringGlitch.kt demos a glitch we experience when panning clustered Geojson sources

Building

Please rename api_keys.sample.properties into api_keys.properties and fill in the relevant tokens.

The problem: async-image-loading

  • Start up the demo application.MainActivityAsyncImageLoading.kt
  • The app will render a map and will immediately add some data points in a horizontal line along the equator.
  • Those data points will have dynamic image identifiers the Mapbox renderer will not be able to find in the style.
  • The onStyleImageMissing callback is invoked with those identifiers.
  • Since we need to do some heavy computation + network requests in order to render those images, we offload the rendering of the Bitmaps to a background thread.
  • We also do not initially know the size of those icons.
  • After the computation completes, we want to add the image to the map via addImage
  • Here we encounter the problem: The images are added to the map successfully, but they are not rendered until a layout pass happens for some other reason (pinch gesture)

The problem: clustering

  • Start up the demo application. MainActivityClusteringGlitch.kt
  • Observe the fading clusters when crossing the screen bounds

About

A demo project that shows some current issues with the mapbox Android SDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages