android - Android 中的 SKMaps 不显示注释

标签 android skmaps

我创建了一个演示应用程序来了解 SKMaps,它在添加注释方面效果很好。但是,现在我已将代码移至具有相同要求的实际项目中。添加的注释未显示。我尝试使用 SKAnnotationView(自定义 View )和默认注释类型,如 SKAnnotation.SK_ANNOTATION_TYPE_RED 和 SKAnnotation.SK_ANNOTATION_TYPE_PURPLE。未向 map 添加任何内容。

我在同一屏幕上有一个自定义 View 寻呼机,我删除了它并检查仍然没有用。 SKMapViewHolder 是动态添加的。

动态添加SKMapViewHolder的代码 fragment :

SKMapViewHolder mMapHolder = new SKMapViewHolder(OfflineMapScreen.this);
mMapHolder.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));
RelativeLayout outerLayout = (RelativeLayout) findViewById(R.id.outer_layout);
outerLayout.addView(mMapHolder);
RelativeLayout.LayoutParams rlp = (android.widget.RelativeLayout.LayoutParams) mMapHolder.getLayoutParams();
rlp.addRule(RelativeLayout.BELOW, R.id.header);
mMapHolder.setLayoutParams(rlp);

mOSMMapView = mMapHolder.getMapSurfaceView();
mOSMMapView.setMapSurfaceListener(this);
mOSMMapView.getMapSettings().setFollowerMode(SKMapFollowerMode.NONE);
mOSMMapView.getMapSettings().setMapPanningEnabled(true);
mOSMMapView.getMapSettings().setInertiaPanningEnabled(true);
mOSMMapView.getMapSettings().setCompassShown(false);
mOSMMapView.getMapSettings().setCurrentPositionShown(false);
mOSMMapView.setZoomSmooth(14f, 500);

有人有解决办法吗?添加注释的代码 fragment 可以在这里看到:http://postimg.org/image/sdbwzej9z/

最佳答案

在您提供的图像中,我们注意到在设置位置时,您对纬度和经度重复使用了相同的值。使用类似的东西:

 annotationDrawable.setLocation(new SKCoordinate(Double.valueOf(aPlace.getLongitude()),Double.valueOf(aPlace.getLatitude())) ;

关于android - Android 中的 SKMaps 不显示注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27229459/

相关文章:

ios - 如何在 Skobbler SDK for iOS 中更改视觉顾问颜色

android - 可以使用不同的 viapoints 设置替代路线吗?

ios - SKMapView initWithFrame : crash

java - 在android中为编辑文本使用输入过滤器

android - 如何开启PDF417对条码扫描的支持?

android - 需要如何从 Android Activity 调用/使用 Java Web 服务的工作示例

ios - SKMaps Skobbler 实现错误 XMLParser.m :14:9: 'SDKTools/SKTMaps/SKTMapsObject.h' file not found

ios - skobbler 我可以缓存 json 数据吗?

java - 安卓 : SMSManager - Attempt to get length of null array

java - 他们是如何在 Android 上制作 imo/ebuddy 应用程序的?