I have to modify the image of a SKAnnotation. Annotation builder code:
private SKAnnotation getAnnotationFromView (int id,int minZoomLvl, View view) {
SKAnnotation annotation = new SKAnnotation();
SKAnnotationView annotationView = new SKAnnotationView();
annotationView.setView(view);
annotation.setUniqueID(id);
annotation.setOffset(new SKScreenPoint(annotationView.getWidth()/2, annotationView.getHeight()/2));
annotation.setAnnotationView(annotationView);
annotation.setMininumZoomLevel(minZoomLvl);
return annotation;
}
Now my problem is to update the annotation/image to the current state (position, orientation). Is there a way doing that without re adding the annotation? Looking into the documentation I found mapView.updateAnnotation()
but it seems to work just for images added with annotation.setImagePath(imagePath)
Can someone help me with that?
Unfortunately no.
There is an inconsistency in the implementation (we'll address that in a future update) that allows one to reposition only annotations with the icon taken from an file.
If you'd like to reposition an (any) annotation you could/should remove it and add it again.
If you'd like to change the icon/view - then the updateAnnotation
API should do the job