Good day to all, I add a point to the map, after clicking on the location button, this label should be removed and added elsewhere 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)); so I add a label to the map, it works. Then I try to remove it from the map and add a new one with updated coordinates.
mapView.getMap().getMapObjects().remove((MapObject) mainPoint); mainPoint = new Point(geoPosition.getLatitude(), geoPosition.getLongitude()); There are two questions:
- Is it possible not to delete the label and just move it with new ones?
coordinates? - If the first item disappears, then how to remove a specific label? In my version does not work due to the fact that Point is impossible
convert to MapObject