Loading...

Android SDK v4 - Migration guide

On November 22, 2021 we released the Mappedin Android SDK v4. This short migration guide explains the steps needed to migrate from version 3.

Flat labels

// before:
mapView.labelAllLocations(
MPIOptions.LegacyLabelAllLocations(color = "red")
)
// after:
mapView.labelAllLocations(
MPIOptions.FlatLabelAllLocations(
MPIOptions.FlatLabelAppearance(color = "red")
)
)

Floating labels

// before:
mapView.labelAllLocations(
MPIOptions.LabelAllLocations(
appearance = MPIOptions.LabelAppearance.lightOnDark
)
)
// after:
mapView.labelAllLocations(
MPIOptions.FloatingLabelAllLocations(
appearance = MPIOptions.FloatingLabelAppearance.lightOnDark
)
)

Additionally, Floating Label marker default size has been reduced slightly.

Path widths

When calculating path widths, we previously used scaled units. In v4 these are set in meters. The default nearRadius value in PathOptions has been changed from 20 to 1.8. Correspondingly the farRadius is now 2.3 * nearRadius by default. These values are approximately the same, however some variation may occur depending on the venue scale. oldNearRadiusInMetres = 20 * map.scale will give you the exact value to use with v4 to keep the path width identical.

The default for drawing a path was changed so that the path pulse fires only once and the animation takes longer.

Was this page helpful?