Android Mapbox SDK v10: attribution position; UiSettings
Asked Answered
S

2

5

How is possible to adjust the logo and attribution in com.mapbox.mapboxsdk.maps.MapView? In the older SDK v9, it was possible to simply set UiSettings via XML attributes (or by changing UiSettings programmatically).

mapbox:mapbox_uiAttributionMarginBottom="8dp"
mapbox:mapbox_uiAttributionMarginLeft="32dp"

Any idea how to achieve the same effect on Mapbox SDK v10?

Submersible answered 22/9, 2021 at 12:23 Comment(0)
A
5

I am using Mapbox android 10.4.0 and this is how I do. Hope it helps!

 mapView.attribution.updateSettings {
            marginRight= 56F
            marginLeft= 56F
        }
 mapView.logo.updateSettings {
        marginBottom= 420F
        marginLeft= 320F
    }
Algebraic answered 31/5, 2022 at 4:50 Comment(2)
Is it possible to do this adjustment directly in the xml?Overcasting
If I remeber, It didn`t work in xmlAlgebraic
C
2

Hello in v10+ they change to plugins, so the logo settings and UI settings you need to install:

implementation 'com.mapbox.plugin:maps-logo:10.2.0'

in your Gradle.build file.

Source: https://github.com/mapbox/mapbox-maps-android/tree/main/plugin-logo

Christianchristiana answered 13/1, 2022 at 20:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.