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

Android MapObject->getParent() для плейсмарков в ClusterizedPlacemarkCollection #258

Open
cream-cheeze opened this issue Jul 22, 2021 · 2 comments

Comments

@cream-cheeze
Copy link

cream-cheeze commented Jul 22, 2021

Есть непонятный момент с кластеризованными коллекциями...

У обычной коллекции и кластеризованной общий предок - MapObject, при этом и та и другая могут содержать внутри одинаковые плейсмарки.

При этом, метод MapObject->getParent() возвращает не MapObject, а MapObjectCollection.

В итоге, когда я пытаюсь получить родителя плейсмарка, находящегося внутри ClusterizedPlacemarkCollection, то получаю ошибку вида:

F/exmapkitexampl( 3003): runtime.cc:685] JNI DETECTED ERROR IN APPLICATION: attempt to return an instance of com.yandex.mapkit.map.internal.ClusterizedPlacemarkCollectionBinding from com.yandex.mapkit.map.MapObjectCollection com.yandex.mapkit.map.internal.MapObjectBinding.getParent()
F/exmapkitexampl( 3003): runtime.cc:685] from com.yandex.mapkit.map.MapObjectCollection com.yandex.mapkit.map.internal.MapObjectBinding.getParent()
F/libc ( 3003): Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 3003 (exmapkitexample), pid 3003 (exmapkitexample)

Видимо потому, что у плеймарка фактический родитель класса ClusterizedPlacemarkCollection, а в методе объявлено - MapObjectCollection.

P.S. Аналогичная история с наследованием и в iOS, но там ошибок при обращении к getParent() не возникает.

@cream-cheeze
Copy link
Author

Попытался решить в обход (мне нужно определить, какие плейсмарки находятся внутри коллекции) – так traverse тоже не работает:

E/exmapkitexampl: JNI ERROR (app bug): attempt to pass an instance of com.yandex.mapkit.map.internal.ClusterizedPlacemarkCollectionBinding as argument 1 to boolean com.unact.yandexmapkit.YandexMapController$1.onCollectionVisitStart(com.yandex.mapkit.map.MapObjectCollection)
A/exmapkitexampl: java_vm_ext.cc:578] JNI DETECTED ERROR IN APPLICATION: bad arguments passed to boolean com.unact.yandexmapkit.YandexMapController$1.onCollectionVisitStart(com.yandex.mapkit.map.MapObjectCollection) (see above for details)

Объект ClusterizedPlacemarkCollection передаётся в onCollectionVisitStart, который ожидает MapObjectCollection....

@YandexMapKit
Copy link
Collaborator

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

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

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

2 participants