3

新库,类 SKAnnotation 没有方法:

annotation.setImagePath(mImagePath);

4

1 回答 1

0

请使用如下代码

SKAnnotation annotation = new SKAnnotation(itemId);
annotation.setLocation(new SKCoordinate(lat, lon));    
SKAnnotationView annotationView = new SKAnnotationView();
RelativeLayout customView = (RelativeLayout) ((LayoutInflater)getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(
               R.layout.layout_custom_pin, null, false);
annotationView.setView(customView);
annotation.setAnnotationView(annotationView);    
mapView.addAnnotation(annotation, SKAnimationSettings.ANIMATION_NONE);
于 2017-04-14T08:32:35.397 回答