From b7cfd7eec3f712dd1e0fbb79f9b780d76e1ea2e5 Mon Sep 17 00:00:00 2001 From: DYurchenko Date: Wed, 15 Feb 2023 17:45:48 +0300 Subject: [PATCH 1/3] update yandex map to 4.2.2 vesion --- yandex-map/build.gradle | 6 +++--- .../main/java/ru/touchin/yandexmap/YandexMapManager.kt | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/yandex-map/build.gradle b/yandex-map/build.gradle index 0f4b147..de56a76 100644 --- a/yandex-map/build.gradle +++ b/yandex-map/build.gradle @@ -3,12 +3,12 @@ apply from: "../android-configs/lib-config.gradle" dependencies { implementation project(":base-map") - implementation "com.yandex.android:mapkit" + implementation "com.yandex.android:maps.mobile" constraints { - implementation("com.yandex.android:mapkit") { + implementation("com.yandex.android:maps.mobile") { version { - require '3.4.0' + require '4.2.2-full' } } } diff --git a/yandex-map/src/main/java/ru/touchin/yandexmap/YandexMapManager.kt b/yandex-map/src/main/java/ru/touchin/yandexmap/YandexMapManager.kt index 775df6b..e3d1249 100644 --- a/yandex-map/src/main/java/ru/touchin/yandexmap/YandexMapManager.kt +++ b/yandex-map/src/main/java/ru/touchin/yandexmap/YandexMapManager.kt @@ -10,7 +10,7 @@ import com.yandex.mapkit.geometry.Point import com.yandex.mapkit.layers.ObjectEvent import com.yandex.mapkit.map.CameraListener import com.yandex.mapkit.map.CameraPosition -import com.yandex.mapkit.map.CameraUpdateSource +import com.yandex.mapkit.map.CameraUpdateReason import com.yandex.mapkit.map.InputListener import com.yandex.mapkit.map.Map import com.yandex.mapkit.map.MapLoadStatistics @@ -23,8 +23,7 @@ import ru.touchin.basemap.AbstractMapManager @Suppress("detekt.TooManyFunctions") class YandexMapManager( - mapView: MapView, - private val isDebug: Boolean = false + mapView: MapView ) : AbstractMapManager(mapView), MapLoadedListener, CameraListener, InputListener, UserLocationObjectListener { companion object { @@ -58,7 +57,6 @@ class YandexMapManager( override fun initMap(map: Map) { super.initMap(map) - map.isDebugInfoEnabled = isDebug map.setMapLoadedListener(this) map.addCameraListener(this) map.addInputListener(this) @@ -80,7 +78,7 @@ class YandexMapManager( mapListener?.onMapLoaded() } - override fun onCameraPositionChanged(map: Map, cameraPosition: CameraPosition, cameraUpdateSource: CameraUpdateSource, finished: Boolean) { + override fun onCameraPositionChanged(map: Map, cameraPosition: CameraPosition, cameraUpdateSource: CameraUpdateReason, finished: Boolean) { mapListener?.onCameraMoved(finished) } From c431e7fe462f29c83113d489d2f64e3c2e7b7508 Mon Sep 17 00:00:00 2001 From: DYurchenko Date: Wed, 15 Feb 2023 20:46:03 +0300 Subject: [PATCH 2/3] add map tap listeners --- .../java/ru/touchin/yandexmap/YandexPlacemarkManager.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/yandex-map/src/main/java/ru/touchin/yandexmap/YandexPlacemarkManager.kt b/yandex-map/src/main/java/ru/touchin/yandexmap/YandexPlacemarkManager.kt index 65d38f9..ccdd1d7 100644 --- a/yandex-map/src/main/java/ru/touchin/yandexmap/YandexPlacemarkManager.kt +++ b/yandex-map/src/main/java/ru/touchin/yandexmap/YandexPlacemarkManager.kt @@ -48,10 +48,16 @@ class YandexPlacemarkManager( clusterizedCollection.clusterPlacemarks(clusterRadius, minZoom) placemarkCollection = clusterizedCollection + } + fun addTapListener(mapView: MapView) { mapView.map.mapObjects.addTapListener(this) } + fun removeTapListener(mapView: MapView) { + mapView.map.mapObjects.removeTapListener(this) + } + fun removeMarkers() { placemarkCollection?.clear() } From e9426acc2e678986f107464f370d1867717b5ad9 Mon Sep 17 00:00:00 2001 From: DYurchenko Date: Thu, 16 Feb 2023 10:33:42 +0300 Subject: [PATCH 3/3] change yandex map to lite version --- yandex-map/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yandex-map/build.gradle b/yandex-map/build.gradle index de56a76..3a4eac7 100644 --- a/yandex-map/build.gradle +++ b/yandex-map/build.gradle @@ -8,7 +8,7 @@ dependencies { constraints { implementation("com.yandex.android:maps.mobile") { version { - require '4.2.2-full' + require '4.2.2-lite' } } }