Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
donik opened this issue Feb 13, 2021 · 6 comments
Open

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

donik opened this issue Feb 13, 2021 · 6 comments

Comments

@donik
Copy link

donik commented Feb 13, 2021

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

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

@DemaFay
Copy link

DemaFay commented Mar 4, 2021

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

@donik
Copy link
Author

donik commented Mar 4, 2021 via email

@cream-cheeze
Copy link

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

@cream-cheeze
Copy link

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

@donik
Copy link
Author

donik commented Nov 16, 2021

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

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

 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
Copy link
Collaborator

Пожалуйста, пришлите нам минимальный собранный пример, демонстрирующий описанную ситуацию. Вы можете выложить его проектом на 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)
    }

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants