Feature description
When clicking on a map annotation, a callout is always shown. Need to avoid the callout to be displayed, and fire the click event anyway.
Testing Code:
var MapModule = require('ti.map');
var win = Ti.UI.createWindow({fullscreen: false});
var anno2 = MapModule.createAnnotation({latitude: -33.86365, pincolor: MapModule.ANNOTATION_BLUE, longitude: 151.21689, title: "Anno2", subtitle: "This is anno2", draggable: true});
var anno4 = MapModule.createAnnotation({latitude: -33.86365, longitude: 151.22689, title: "Anno4", subtitle: "This is anno4", draggable: true});
var map = MapModule.createView({
userLocation: true,
mapType: MapModule.NORMAL_TYPE,
animate: true,
annotations: [anno2, anno4],
region: {latitude: -33.87365, longitude: 151.20689, latitudeDelta: 0.1, longitudeDelta: 0.1 }, //Sydney
top: '30%'
});
win.add(map);
map.addEventListener('click', function(e) {
Ti.API.info("Latitude: " + e.latitude);
Ti.API.info("Source: " + e.clicksource);
});
var button = Ti.UI.createButton({top: 0, left: 0, title: "Blue Anno Info Window Enabled"});
button.addEventListener('click', function(e) {
if (!anno2.showInfoWindow) {
anno2.showInfoWindow = true;
button.title = "Blue Anno Info Window Enabled";
} else {
anno2.showInfoWindow = false;
button.title = "Blue Anno Info Window Disabled";
}
});
var button2 = Ti.UI.createButton({top: 100, left: 0, title: "Red Anno Info Window Enabled"});
button2.addEventListener('click', function(e) {
if (!anno4.showInfoWindow) {
anno4.showInfoWindow = true;
button2.title = "Red Anno Info Window Enabled";
} else {
anno4.showInfoWindow = false;
button2.title = "Red Anno Info Window Disabled";
}
});
win.add(button);
win.add(button2);
win.open();
1. Run code, toggle the property, make sure window info doesn't show when showInfoWindow is false.
Map Module only
Master PR: https://github.com/appcelerator-modules/ti.map/pull/15