Using Android 2.3 SDK
I have a map with pins. Clicking the pin brings up an annotation, but clicking the annotation does nothing.
It works just fine in iOS.
Code is below
var annotation = Titanium.Map.createAnnotation(annotationParams); annotation.addEventListener('click', function(e) { if(e.clicksource == "title" || e.clicksource == "subtitle") { var win1 = Titanium.UI.createWindow({ url:"club.js", club_id:e.annotation.myid, title:e.annotation.title, hasChild:true }); Titanium.UI.currentTab.open(win1,{animated:true}); } });
2 Answers
Accepted Answer
Try removing hasChild:true - not sure why you would use that outside a tableview context. Or add rightButton:Titanium.UI.iPhone.SystemButton.DISCLOSURE to the annotation and add it to the eventlistener as clicksource == 'rightButton'
For me, it worked on android emulator with the code below:
mapView.addEventListener('click',function(e){ if(e.clicksource=='rightPane'){ var detailWin = Titanium.UI.createWindow({ cliente:e.annotation.customVar, url:'windows/details.js', navBarHidden: true, }); detailWin.open({animate:true}); } });
Your Answer
Think you can help? Login to answer this question!