Compose MapView ignores isAttributionBarVisible=false

370
3
Jump to solution
04-26-2024 06:54 AM
dev4567
New Contributor III

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
3 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
New Contributor III

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