Skip to content

Scroll by Method

Note

You can find the full source code of this example in ScrollByActivity.kt of the MapLibreAndroidTestApp.

This example shows how you can move the map by x/y pixels.

maplibreMap.scrollBy(
    (seekBarX.progress * MULTIPLIER_PER_PIXEL).toFloat(),
    (seekBarY.progress * MULTIPLIER_PER_PIXEL).toFloat()
)
Screenshot of Example Activity to move the map by some pixels