Skip to content

Commit

Permalink
Maps/HMS: Simulate onCameraChange from onCameraMove (#2385)
Browse files Browse the repository at this point in the history
Fixed the problem of Uber point selection movement and inability to obtain point selection information
  • Loading branch information
DaVinci9196 authored Aug 4, 2024
1 parent 284eae3 commit b7e547c
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,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 ->
Expand Down Expand Up @@ -512,7 +505,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)
}
Expand Down

0 comments on commit b7e547c

Please sign in to comment.