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

Failed to remove MapObject #81

Closed
abdlkdrisiktan opened this issue Mar 29, 2019 · 2 comments
Closed

Failed to remove MapObject #81

abdlkdrisiktan opened this issue Mar 29, 2019 · 2 comments

Comments

@abdlkdrisiktan
Copy link

I try to remove PlaceMarkObject with 2 way
the first one is :>yandexMap.getMap().getMapObjects().addCollection().remove(object)
second :> yandexMap.getMap().getMapObjects().remove(object)
these methods are not working properly I don't know why here is the exception log :
java.lang.RuntimeException: Failed to remove MapObject
at com.yandex.mapkit.map.internal.MapObjectCollectionBinding.remove(Native Method)

Yandex Version -- 3.3.1

Can you help me ?
Any help would be appreciated

@vbazhenov
Copy link
Contributor

This error message means that you are trying to remove placemark from wrong collection. You can try to use this snippet:

object.getParent().remove(object);

@abdlkdrisiktan
Copy link
Author

Thanks a lot @vbazhenov 👍

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