Grab & run code below. Console output log event multiple times. If you monitor through out DDMS the event will be fired only once.
var thisView = Ti.UI.createView({
width:45,
height:45
});
var win = Ti.UI.createWindow();
var pin1 = Titanium.Map.createAnnotation({
latitude:37.390749,
longitude:-122.081651,
title:"Appcelerator Headquarters",
subtitle:'Mountain View, CA',
pincolor:Titanium.Map.ANNOTATION_RED,
animate:true,
image: 'map-pin.png',
pinImage:'map-pin.png',
selectPinImage:'map-pin-selected.png'
});
var pin2 = Titanium.Map.createAnnotation({
latitude: 31.390749,
longitude:-121.081651,
title:"Other one",
subtitle:'Mountain View, CA',
pincolor: Titanium.Map.ANNOTATION_RED,
animate:true,
image: 'map-pin.png',
pinImage:'map-pin.png',
selectPinImage:'map-pin-selected.png'
});
var pin3 = Titanium.Map.createAnnotation({
latitude: 30.390749,
longitude:-122.081651,
title:"Other one",
subtitle:'Mountain View, CA',
pincolor: Titanium.Map.ANNOTATION_RED,
animate:true,
image: 'map-pin.png',
pinImage:'map-pin.png',
selectPinImage:'map-pin-selected.png'
});
var mapView = Titanium.Map.createView({
mapType: Titanium.Map.STANDARD_TYPE,
animate:true,
regionFit:true,
userLocation: false,
annotations: [pin1, pin2, pin3]
});
win.add(mapView);
win.open();
var selectedPin = null;
mapView.addEventListener('click', function(e) {
if(e.clicksource === 'pin'){
Ti.API.info(" e.clicksource: "+ e.clicksource);
e.annotation.setImage(e.annotation.selectPinImage);
if(selectedPin){
selectedPin.setImage(selectedPin.pinImage);
selectedPin = e.annotation;
} else {
selectedPin = e.annotation;
}
}
});
The developer need to test different approaches yet where this issue makes difficult click event functionality.
Issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 iOS iPhone Simulator: iOS SDK version: 6.0
This issue can't be reproduced with TISDK 3.2 or higher. Therefore, marking it as resolved.
Closing issue as cannot reproduce. Tested on: Appcelerator Studio, build: 3.2.1.201402061120 SDK build: 3.2.1.GA CLI: 3.2.1 Alloy: 1.3.1 Xcode: 5.0.2 Devices: ipad air (7.0.3), iphone 4s (6.0.1)