On Android, I don't see the click event firing if the background
of the annotation is clicked.
Using this code, you might see 'title' in the info message (if
you actually click the title element) but you won't see
'annotation'. The reason this is important is because a user might
fail to click through to another page if they happen to miss one of
the elements in the annotation.
// this sets the background color of the master UIView (when
there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
var map = Titanium.Map.createView({
mapType: Titanium.Map.STANDARD_TYPE,
animate: true,
regionFit: true,
region: {latitude: 37.390749, longitude: -122.081651,latitudeDelta: 0.01, longitudeDelta: 0.01 }
});
var myAnot = Titanium.Map.createAnnotation({
latitude: 37.390749,
longitude: -122.081651,
title: 'You Clicked Me!',
pincolor: Titanium.Map.ANNOTATION_PURPLE,
animate: true
});
map.addAnnotation(myAnot);
map.addEventListener('click', function(e) {
Titanium.API.info(e.clicksource); });
win.add(map);
win.open();