mapkit-android-demo icon indicating copy to clipboard operation
mapkit-android-demo copied to clipboard

Анимация клстеризации пинов на карте

Open donik opened this issue 4 years ago • 6 comments

collection.clusterPlacemarks(withClusterRadius: 60, minZoom: 15)

при добавлении новых точек обновляя кластеризацию пины начинают появляться с анимацией даже если они уже есть внутри кластера. Есть ли возможность отключить анимацию появления?

donik avatar Feb 13 '21 04:02 donik

Привет. У меня такая же проблема. Не удалось решить?

DemaFay avatar Mar 04 '21 10:03 DemaFay

Я написал в поддержку, служба отвечает, а разрабы нет 🤣

donik avatar Mar 04 '21 11:03 donik

Невозможно кластерами пользоваться - всё моргает как новогодняя ёлка!

cream-cheeze avatar Aug 10 '21 17:08 cream-cheeze

Вон такой же issue аж с 2020 года висит...

cream-cheeze avatar Aug 10 '21 17:08 cream-cheeze

Привет. У меня такая же проблема. Не удалось решить?

я решил проблему костылём

 fun updateItems(newItems: List<ChargingStation>) {
        val newCollection =
            this.mapView.mapWindow.map.mapObjects.addClusterizedPlacemarkCollection(this)

        for (item in newItems) {
            val marker = newCollection.addPlacemark(
                Point(
                    item.location.getLocation().latitude,
                    item.location.getLocation().longitude
                ),
                ImageProvider.fromBitmap(
                    if (item.type == "info") {
                        infoIconMarker?.toBitmap()
                    } else {
                        iconMarker?.toBitmap()
                    }
                ),
                IconStyle(
                    PointF(0.5f, 0.5f),
                    RotationType.ROTATE,
                    1.0f,
                    true,
                    true,
                    1.0f,
                    null
                )
            )
            marker.userData = item
            marker.addTapListener(this)
        }

        newCollection.clusterPlacemarks(40.0, 12)
        newCollection.setVisible(false, Animation(Animation.Type.LINEAR, 0.0f), null)

        val weakSelf by weak(this)
        UIKit.post({
            val strongSelf = weakSelf ?: return@post
            try {
                strongSelf.mapView.mapWindow.map.mapObjects.remove(strongSelf.collection)
            } catch (_: Exception) {
            }

            strongSelf.collection = newCollection
            newCollection.setVisible(true, Animation(Animation.Type.LINEAR, 0.0f), null)
        }, 300)
    }

создал новую коллекцию, добавил на карту и после тайм-аута отобразиил

в айосе все аналогично

donik avatar Nov 16 '21 18:11 donik

Пожалуйста, пришлите нам минимальный собранный пример, демонстрирующий описанную ситуацию. Вы можете выложить его проектом на GitHub, прикрепить к переписке в архиве или загрузить на Яндекс Диск и указать ссылку.

Мы постараемся помочь.

2021-11-16 18:18:25, donik [email protected]:

Привет. У меня такая же проблема. Не удалось решить?

я решил проблему костылём

 fun updateItems(newItems: List<ChargingStation>) {
        val newCollection =
            this.mapView.mapWindow.map.mapObjects.addClusterizedPlacemarkCollection(this)

        for (item in newItems) {
            val marker = newCollection.addPlacemark(
                Point(
                    item.location.getLocation().latitude,
                    item.location.getLocation().longitude
                ),
                ImageProvider.fromBitmap(
                    if (item.type == "info") {
                        infoIconMarker?.toBitmap()
                    } else {
                        iconMarker?.toBitmap()
                    }
                ),
                IconStyle(
                    PointF(0.5f, 0.5f),
                    RotationType.ROTATE,
                    1.0f,
                    true,
                    true,
                    1.0f,
                    null
                )
            )
            marker.userData = item
            marker.addTapListener(this)
        }

        newCollection.clusterPlacemarks(40.0, 12)
        newCollection.setVisible(false, Animation(Animation.Type.LINEAR, 0.0f), null)

        val weakSelf by weak(this)
        UIKit.post({
            val strongSelf = weakSelf ?: return@post
            try {
                strongSelf.mapView.mapWindow.map.mapObjects.remove(strongSelf.collection)
            } catch (_: Exception) {
            }

            strongSelf.collection = newCollection
            newCollection.setVisible(true, Animation(Animation.Type.LINEAR, 0.0f), null)
        }, 300)
    }

создал новую коллекцию, добавил на карту и после тайм-аута отобразиил

в айосе все аналогично

YandexMapKit avatar Dec 16 '22 17:12 YandexMapKit