Compose MapView ignores isAttributionBarVisible=false

583
4
Jump to solution
04-26-2024 06:54 AM
dev4567
Emerging Contributor

Context

Using 

com.esri:arcgis-maps-kotlin-toolkit-geoview-compose:200.4.0

Issue

 

MapView(
  isAttributionBarVisible = false
)

 


Attribution bar is still shown.

Hacky Solution

@Composable
private fun rememberAttributionBarVisibility(): Boolean {
    // must be true by default - value must change to be applied
    var isAttributionBarVisible by remember { mutableStateOf(true) }
    SideEffect {
        // fix attribution bar is not hidden by default
        isAttributionBarVisible = false
    }
    return isAttributionBarVisible
}

 

 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
Shubham_Sharma
Esri Contributor

After some more investigation, it seems like this is happening with older compose versions. Could you try updating to a more recent Compose BOM version (2024.01.00 or above)? 

View solution in original post

0 Kudos
4 Replies
Shubham_Sharma
Esri Contributor

@dev4567 The MapView should be able to work with your original approach by passing in an isAttributionBarVisible to the MapView

Check out the Display Composable MapView sample app, I'm able to toggle the attribution bar. 

Could you provide more context on the Composable layout you are using and how exactly is the MapView being used?

0 Kudos
Shubham_Sharma
Esri Contributor

After some more investigation, it seems like this is happening with older compose versions. Could you try updating to a more recent Compose BOM version (2024.01.00 or above)? 

0 Kudos
dev4567
Emerging Contributor

I confirm it works, thanks! The error occurred on 2024.03.00, but with 2024.05.00 it seems to be fine.

dev4567
Emerging Contributor

@Shubham_Sharma we still see attribution bar is blinking on startup with the latest compose bom=2024.09.02 and sdk=200.5. We believe the problem is it's somehow linked with a Basemap loading – as our app starts with an empty `Basemap()` and then we add layers dynamically. Also, from what I see in the decompiled code, `isAttributionBarVisible` by default is `true` – probably we could advise change this to `false` by default? 

0 Kudos