Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/220.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 在Skobbler3.0中,如何在地图上的注释中设置自定义图像_Android_Android Studio_Skobbler Maps - Fatal编程技术网

Android 在Skobbler3.0中,如何在地图上的注释中设置自定义图像

Android 在Skobbler3.0中,如何在地图上的注释中设置自定义图像,android,android-studio,skobbler-maps,Android,Android Studio,Skobbler Maps,新库、类SKAnnotation没有以下方法: annotation.setImagePath(mImagePath) 请使用如下代码 SKAnnotation annotation = new SKAnnotation(itemId); annotation.setLocation(new SKCoordinate(lat, lon)); SKAnnotationView annotationView = new SKAnnotationView(); RelativeLayout c

新库、类SKAnnotation没有以下方法:


annotation.setImagePath(mImagePath)

请使用如下代码

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