mapbox-gl-native-android icon indicating copy to clipboard operation
mapbox-gl-native-android copied to clipboard

Add clarifying docs on Style.addLayerAt

Open tir38 opened this issue 5 years ago • 1 comments

https://docs.mapbox.com/android/api/map-sdk/7.0.0/com/mapbox/mapboxsdk/maps/Style.html#addLayerAt-com.mapbox.mapboxsdk.style.layers.Layer-int-

addLayerAt is not very intuitive

  1. does it replace existing layers already at that index?
  2. how does index map to "what is on top of what"? smaller index on the bottom? small index on the top
  3. How can I use this to "addLayerToTheTopOfEverything"? I assumed I could just add a layer with a really large index to ensure it was always on top but then got an CannotAddLayerException: Invalid index error. So what are vaild indexes?

tir38 avatar Aug 03 '20 02:08 tir38

Thanks for this ticket @tir38 . I transferred it from https://github.com/mapbox/mapbox-android-demo to this repo, which is the repo for the Maps SDK for Android. Your questions and the idea of adding more explanatory javadocs, have more to do with Maps SDK work than with specifically the demo app.

langsmith avatar Aug 03 '20 14:08 langsmith