我对地图视图有疑问。
当我使用钛 sdk 3.0.2.GA 时,标题和副标题会显示在 pin 上,但是当我使用钛 sdk 3.1.0.GA 时,标题和副标题不会显示在 pin 上。
我的代码如下
function LocationUIWindow(title) {
var self = Ti.UI.createWindow({
title:title,
backgroundColor:'#222222'
});
self.barColor = '#c61b17';
var h = Ti.Platform.displayCaps.platformHeight;
self.orientationModes = [Titanium.UI.PORTRAIT];
createMapView(self,33.74511,-84.38993);
return self;
};
function createMapView(win,lat,lng){
var atlantaParams = {
latitude:lat,
longitude:lng,
title:"Atlanta, GA",
subtitle:'Atlanta Braves Stadium\nfoo',
animate:true,
myid:3, // CUSTOM ATTRIBUTE THAT IS PASSED INTO EVENT OBJECTS
pincolor : Titanium.Map.ANNOTATION_PURPLE
};
var atlanta = Titanium.Map.createAnnotation(atlantaParams);
// 创建地图视图
var presetAnnotations = [atlanta];
var mapview = Titanium.Map.createView({
mapType: Titanium.Map.STANDARD_TYPE,
region:{latitude:lat, longitude:lng, latitudeDelta:0.5, longitudeDelta:0.5},
animate:true,
regionFit:true,
userLocation:true,
annotations:presetAnnotations
});
mapview.addAnnotation(atlanta);
mapview.selectAnnotation(atlanta);
win.add(mapview);
}
module.exports = LocationUIWindow;
如何在钛 sdk 3.1.0.GA 中修复它?谢谢