Merge pull request #282 from TouchInstinct/update_yandex_map_version

Update yandex map version
This commit is contained in:
styni 2023-02-20 11:20:28 +03:00 committed by GitHub
commit b7756fa31d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 8 deletions

View File

@ -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-lite'
}
}
}

View File

@ -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, Map, Point>(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)
}

View File

@ -48,10 +48,16 @@ class YandexPlacemarkManager<TPoint : PointModel>(
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()
}