How to modify a Skobbler Annotation without re adding it

依然范特西╮ 提交于 2019-12-10 17:23:13

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/26781358/how-to-modify-a-skobbler-annotation-without-re-adding-it

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!