Closed c0dd3vi11 closed 4 years ago
Hi,
I'll create another issue for zoom-in/out. About rotating, you can use your own animator, like so:
private fun animateMapViewToNorth() {
/* Wrapper class, necessary for the the animator to work (which uses reflection to infer
* method names..) */
@Suppress("unused")
val wrapper = object {
fun setAngle(angle: Float) {
mapView?.setAngle(angle)
}
fun getAngle(): Float {
return referentialData.angle
}
}
ObjectAnimator.ofFloat(wrapper, "angle", 0f).apply {
interpolator = DecelerateInterpolator()
duration = 800
start()
}
}
Thank you! I tried animateMapViewToNorth
and it works very well!
Also about zoom-in/out. I've just found the mistake... I did the same calculation on referentialData.scale (data.scale = 1.5f) before I was calling `mapView.smoothScaleFromCenter(mapView.scale 1.5f)`. So, after I removed all started working well too!
Sorry for misleading you 🤗
Hello, @peterLaurence! I got one more problem.
I was trying to make buttons to zoom in/out and rotate back to north-up position.
Zooming in/out. I found this:
mapView.smoothScaleFromCenter(mapView.scale * 1.5f)
. And the opposite ismapView.smoothScaleFromCenter(mapView.scale / 1.5f)
. But when I call the functions too fast then MapView starts blinking.Rotating. The best way is do
mapView.setAngle(referentialData.angle)
. But this performs without animation. Could you help me how to do it proper with animation?p.s. Perfect SDK, btw) Thank you for making it!