首页 > 解决方案 > 初始化后无法更改注释图像属性

问题描述

我创建了一个带有自定义本地图像的地图模块并且工作正常但后来我想为其他本地图像更改它并且图像在Android上没有改变,调试我发现变量“anno.image”确实改变了图像的值我想要但不会在地图上渲染的图像。这是我用来创建和更改图像属性的方式。谢谢指教。

anno.image = "/Imagenes/carrito1.png";

标签: javascriptandroidappcelerator

解决方案


不知道为什么它不渲染新图像,但您可以删除并重新添加相同的注释,它的行为方式完全相同。所以基本上你可以做这样的事情:

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

推荐阅读