Answer the question
In order to leave comments, you need to log in
How to delete a specific Point in the yandex map kit 3.0 library?
Good afternoon everyone, I add a label (point) to the map, after clicking on the location button, this label should be removed and added in another place on the map with different coordinates, below is the code
mainPoint = new Point(geoPosition.getLatitude(), geoPosition.getLongitude());
mapView.getMap().move(
new CameraPosition(mainPoint, 15.0f, 0.0f, 0.0f),
new Animation(Animation.Type.SMOOTH, 0),
null);
mapView.getMap().getMapObjects().addPlacemark(mainPoint,ImageProvider.fromResource(this, R.drawable.mygeo_light_icon));
mapView.getMap().getMapObjects().remove((MapObject) mainPoint);
mainPoint = new Point(geoPosition.getLatitude(), geoPosition.getLongitude());
Answer the question
In order to leave comments, you need to log in
the addPlacemark method returns a PlacemarkMapObject, you need to remember it. It can be removed, and you can also change the position (setGeometry).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question