首页 > 解决方案 > Appcelerator Ti.map 选定的注释图像

问题描述

我正在使用 Appcelerator 上的 ti.map 模块,似乎找不到任何解决方案来更改选择后的注释图像。如何才能做到这一点?

需要使用 Titanium SDK 7.2 支持 iOS 和 Android

标签: androidiosmapstitaniumappcelerator

解决方案


尝试使用自定义视图作为注释:

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';

推荐阅读