【发布时间】:2014-06-19 10:21:12
【问题描述】:
如标题所示,我尝试将自己的图像放在地图上的注释中。 为此,我使用以下代码:
annotation.setImagePath (mImagePath);
annotation.setImageSize (4096);
annotation.setOffset (mSKScreenPoint));
没有错误但什么也没有出现。
但我遵循了文档的指示:
"Sets the absolute path of the image file to be added as an annotation.
The picture must be a square image and the size must be a power of 2.
_ (32x32, 64x64, etc.)."
我的图片大小是 64 * 64。
感谢这篇文章,我有了第一个迹象,但没有出现任何迹象:
How do I set a custom image on an map annotation?
所以我将图像转换为 png-24,但仍然没有结果。 (((
【问题讨论】:
-
mImagePath 应该是图像文件的绝对路径 - 对吗?
-
请发送电子邮件至 dev@skobbler.com 并附上您尝试使用的图标以及您现在为 mImagePath 和 mSKScreenPoint 设置的值
-
带有
64px图像的你应该将图像大小设置为64而不是4096。 -
自定义图像在我这边也不起作用。这是我正在使用的图像:cl.ly/image/0l0T2n1B3O07(Photoshop 生成,64x64,24 位透明 PNG)SKAnnotation *annotation = [SKAnnotation annotation]; // 设置唯一 ID // 设置位置 annotation.imagePath = [[NSBundle mainBundle] pathForResource:@"purpleAlert" ofType:@"png"]; [self.mapView addAnnotation:annotation];没运气。什么都没有显示。
标签: android image annotations skmaps