【问题标题】:Can't change annotation image property once is initialized初始化后无法更改注释图像属性
【发布时间】:2018-09-25 15:13:53
【问题描述】:
我创建了一个带有自定义本地图像的地图模块并且工作正常,但后来我想为其他本地图像更改它并且图像在 Android 上没有改变,调试我发现变量“anno.image”确实改变了带有我想要的图像但不会在地图上呈现的图像。
这是我用来创建和更改图像属性的方式。
感谢您的建议。
anno.image = "/Imagenes/carrito1.png";
【问题讨论】:
标签:
javascript
android
appcelerator
【解决方案1】:
不确定为什么它不渲染新图像,但您可以删除并重新添加相同的注释,它的行为方式完全相同。所以基本上你可以这样做:
anno = Map.createAnnotation({
latitude : anno.latitude,
longitude : anno.longitude,
image : "/Imagenes/carrito1.png",
..... // copy other properties whatever you had on this anno
});
MapView.addAnnotations([anno]);