The problem
The map annotations can be represented by an image with the "image" property. That image cannot be dynamically changed.
The test case:
var changeButton = Ti.UI.createButton({
title: 'change colour'
});
var win = Ti.UI.createWindow({
rightNavButton: changeButton
});
var map = Ti.Map.createView({
userLocation:false,
animate: true,
region: {
latitude:12,
longitude:12,
latitudeDelta:1,
longitudeDelta:1
}
});
var annot = Ti.Map.createAnnotation({
latitude:12,
longitude:12,
image: 'blue.png'
});
map.addAnnotation(annot);
win.add(map);
win.open({modal: true});
var isBlue = true;
changeButton.addEventListener('click', function(e){
annot.image = isBlue ? 'yellow.png' : 'blue.png';
isBlue = !isBlue;
});
To reproduce:
1. Copy and paste this code to app.js
2. Run the app and you'll see a blue pin
3. Click the right navigation button
4. The blue pin is still blue - it did not change to yellow.
(Attached are the two images)
Pull request ready: [2648](https://github.com/appcelerator/titanium_mobile/pull/2648)
Really hoping that this is a quick fix. I have 6 Apps that are waiting behind this issue. They are for Estate Agents here in the UK and as they sell houses, it's all about Maps and locations and showing pin selection is important. Thanks.
Re-opening to edit label
Reopening to add fixVersion
Closing after adding fixVersion