android - 在 skobbler 3.0 中如何在 map 上的注释中设置自定义图像

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

关于android - 在 skobbler 3.0 中如何在 map 上的注释中设置自定义图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39041405/

相关文章:

Android IPC 和 ContentProvider 的区别

java - Kotlin 中的 CountDownTimer 解释

javascript - React Native 版本不匹配。无法在Android Studio中生成构建,但通过VS代码react-native run-android可以正常运行

ios - Skobbler didFinishRouteCalculationWithInfo 数组异常

ios - 在 SKmap 中设置从 Gpx 绘制的折线的宽度

android - ActivityThread错误

Android ClassLoader.loadClass JNI 崩溃

java - 在 Android 9 (Pie) 上使用 Retrofit 服务时出现空对象引用?

android - 使用 Realm 存储 unicode 字符

java - Skobbler map 。注释显示为黑色方 block 。安卓