Problem description
With iOS, custom annotation on Ti.Map are not working. Same code is fine in Android.
Steps to reproduce
Use the following code to see the issue:
var win1 = Titanium.UI.createWindow({
backgroundColor:'#fff'
});
var myAnnotations = [];
var mapview = Titanium.Map.createView({
mapType: Titanium.Map.STANDARD_TYPE,
region: {latitude:45,longitude:11,latitudeDelta:0.010, longitudeDelta:0.018}
});
win1.add(mapview);
var customView = Ti.UI.createView({
layout:'vertical',
height:Ti.UI.SIZE,
width:Ti.UI.SIZE
});
var storeText = Ti.UI.createLabel({
width:Ti.UI.SIZE,
left:5,
top:2,
text:"Current location",
color: '#FFF',
height:Ti.UI.SIZE,
font:{fontSize:16,fontWeight: 'bold',fontFamily:'Helvetica Neue'}
});
customView.add(storeText);
var address = Ti.UI.createLabel({
width:Ti.UI.SIZE,
left:5,
top:2,
text:"Chennai",
color: '#FFF',
height:Ti.UI.SIZE
});
customView.add(address);
var phoneNumber = Ti.UI.createLabel({
width:Ti.UI.SIZE,
left:5,
top:0,
text:'+91999999999',
color: '#FFF',
height:Ti.UI.SIZE
});
customView.add(phoneNumber);
var cLocation = Titanium.Map.createAnnotation({
latitude:45,
longitude:11,
leftView: customView,
//title: ' '
});
myAnnotations.push(cLocation);
mapview.annotations = myAnnotations;
win1.open();
Running on Android, everything looks nice (see screenshot); on iOS, the annotation is not shown. If I uncomment the line with 'title', the annotation appears, but the default iOS background appears, and the custom view is not visible (screenshot as well).
iOS limitation. Need the title property if the callout needs to appear. Leftview and rightview callout properties must have a height of 32 or less
Closing ticket with reference to the above comment.