javascript - 初始化后无法更改注释图像属性
问题描述
我创建了一个带有自定义本地图像的地图模块并且工作正常但后来我想为其他本地图像更改它并且图像在Android上没有改变,调试我发现变量“anno.image”确实改变了图像的值我想要但不会在地图上渲染的图像。这是我用来创建和更改图像属性的方式。谢谢指教。
anno.image = "/Imagenes/carrito1.png";
解决方案
不知道为什么它不渲染新图像,但您可以删除并重新添加相同的注释,它的行为方式完全相同。所以基本上你可以做这样的事情:
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]);
推荐阅读
- xaml - Xamarin Forms 列表视图中的弹出窗口
- xamarin.forms - Xamarin Forms - xUnit 设置未按预期工作
- java - Kakfa - 在运行时更改拓扑属性
- c++ - 具有任意大小世界的游戏中交互的有效数据结构或方法
- angular - HighChart 世界地图未在 Angular 7 中呈现
- http - 更改 HTTP 响应文件名
- hive - 与 Hive 表中的重复行设置差异
- sql - 基于上一行的sql更新
- yaml - 为 YAML 文件中 HTML 标签中的元素添加样式
- java - 为文件 tensorflow_jni.dll 加载本机库失败