android - Appcelerator Ti.map 选定的注释图像
问题描述
我正在使用 Appcelerator 上的 ti.map 模块,似乎找不到任何解决方案来更改选择后的注释图像。如何才能做到这一点?
需要使用 Titanium SDK 7.2 支持 iOS 和 Android
解决方案
尝试使用自定义视图作为注释:
var myAnnotationView = Ti.UI.createView({
backgroundImage: '/my_image.png',
});
var customAnnotation = map.createAnnotation({
customView: myAnnotationView,
latitude: lat,
longitude: lon,
title: 'My custom pin'
});
myAnnotationView.backgroundImage = '/my_image2.png';
推荐阅读
- java - 打印通用类列表
- c# - 使用命令在 .NET 项目中添加外部 DLL 文件作为“参考”
- c# - 使用 libgit2sharp(或其他 c# 库)镜像 repo
- ngrx - 带有 NGRX 的 Angular 组件库项目?
- python - 如何修复“str”对象没有“加密”属性?
- c - 队列返回的指针不能在没有分段错误的情况下被取消引用
- jpa - 使用 JPQL 左连接元素集合
- c# - 为什么我的“使用”语句之外的代码无法访问?
- python - 在尝试安装 Fiona 时使用 GDAL_CONFIG 环境变量错误提供 gdal-config 的路径
- c - 函数 ptr 分配类型转换