diff --git a/play-services-maps/core/hms/src/main/kotlin/org/microg/gms/maps/hms/GoogleMap.kt b/play-services-maps/core/hms/src/main/kotlin/org/microg/gms/maps/hms/GoogleMap.kt index d12096dacc..ff4f0ddde4 100644 --- a/play-services-maps/core/hms/src/main/kotlin/org/microg/gms/maps/hms/GoogleMap.kt +++ b/play-services-maps/core/hms/src/main/kotlin/org/microg/gms/maps/hms/GoogleMap.kt @@ -309,13 +309,6 @@ class GoogleMapImpl(private val context: Context, var options: GoogleMapOptions) override fun setOnCameraChangeListener(listener: IOnCameraChangeListener?) = afterInitialize { Log.d(TAG, "setOnCameraChangeListener"); cameraChangeListener = listener - it.setOnCameraIdleListener { - try { - cameraChangeListener?.onCameraChange(map?.cameraPosition?.toGms()) - } catch (e: Exception) { - Log.w(TAG, e) - } - } } override fun setOnCircleClickListener(listener: IOnCircleClickListener?) = afterInitialize { hmap -> @@ -509,7 +502,15 @@ class GoogleMapImpl(private val context: Context, var options: GoogleMapOptions) cameraMoveListener = listener it.setOnCameraMoveListener { try { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + if(mapView != null){ + if(mapView!!.parent != null){ + mapView!!.parent.onDescendantInvalidated(mapView!!,mapView!!) + } + } + } cameraMoveListener?.onCameraMove() + cameraChangeListener?.onCameraChange(map?.cameraPosition?.toGms()) } catch (e: Exception) { Log.w(TAG, e) }