@kfir I'm working Kotlin so below is the converted code - took me a while because of the nullable variables. This works but it zooms to exactly the same level as setLinearZoom()
in my original code - absolutely no difference. Really unclear as to why there are two ways to do exactly the same thing.
val P = zoomSliderPos * 100f // my slider value was already in the 0.0 - 1.0 range so this corrects it for your code
val minZoom = controller.cameraInfo?.zoomState?.value?.minZoomRatio
val maxZoom = controller.cameraInfo?.zoomState?.value?.maxZoomRatio
Log.d(TAG, "minZoom and maxZoom: $minZoom - $maxZoom")
if (minZoom != null && maxZoom != null) {
val translatedValue = Math.pow((maxZoom / minZoom).toDouble(), (P / 100f).toDouble()).toFloat() * minZoom
Log.d("translatedValue", "translatedValue: $translatedValue")
controller.cameraControl?.setZoomRatio(translatedValue)
}