Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12333] iOS: customized Ti.Map.Annotation not working

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionNot Our Bug
Resolution Date2017-03-29T16:28:00.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterDavide Cassenti
AssigneeIngo Muschenetz
Created2013-01-18T06:15:56.000+0000
Updated2017-03-29T16:28:04.000+0000

Description

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).

Attachments

FileDateSize
Screen Shot 2013-01-18 at 2.15.36 PM.png2013-01-18T06:15:56.000+000059751
Screen Shot 2013-01-18 at 2.15.51 PM.png2013-01-18T06:15:56.000+0000168531

Comments

  1. Vishal Duggal 2013-01-21

    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
  2. Lee Morris 2017-03-29

    Closing ticket with reference to the above comment.

JSON Source