【问题标题】:In skobbler 3.0 how to set a custom image in an annotation on a map在 skobbler 3.0 中,如何在地图的注释中设置自定义图像
【发布时间】:2016-08-19 14:22:13
【问题描述】:

新库,SKAnnotation 类没有方法:

annotation.setImagePath(mImagePath);

【问题讨论】:

    标签: android android-studio skobbler-maps


    【解决方案1】:

    请使用如下代码

    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);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多