If you create a map view with userLocation:true and add
annotations with custom images, the annotation images cover the
userLocation marker. The following example code illustrates the
bug, assuming you have an annotation.jpg, a trivial example of
which I attached.
Titanium.UI.setBackgroundColor('#000');
var win = Titanium.UI.createWindow({
title:'Map Bug',
backgroundColor:'#fff'
});
var mapview = Titanium.Map.createView({
mapType: Titanium.Map.STANDARD_TYPE,
region: {latitude:0, longitude:0,
latitudeDelta:90, longitudeDelta:180},
animate:true,
regionFit:true,
userLocation:true
});
win.add(mapview);
function updateMapLocation(e) {
if (!e.success) { return; }
var longitude = e.coords.longitude;
var latitude = e.coords.latitude;
var annotation = Ti.Map.createAnnotation({
latitude:latitude,
longitude:longitude,
title:'Overlapping annotation',
image:'images/annotation.jpg'
});
mapview.addAnnotation(annotation);
var region = {latitude:latitude, longitude:longitude, latitudeDelta:0.05, longitudeDelta:0.05, animate:true};
mapview.setLocation(region);
}
Titanium.Geolocation.purpose = "For testing";
var b = Ti.UI.createButton({title:'Add Annotation', style:Titanium.UI.iPhone.SystemButtonStyle.BORDERED});
b.addEventListener('click', function(e) {
if (Titanium.Platform.model == 'Simulator') {
var l = {success:true, coords:{latitude:37.3317, longitude:-122.0307}};
updateMapLocation(l);
} else {
Titanium.Geolocation.getCurrentPosition(updateMapLocation);
}
});
var flexSpace = Titanium.UI.createButton({
systemButton:Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE
});
var tb = Titanium.UI.createToolbar({bottom:0, items:[flexSpace,b,flexSpace]});
win.add(tb);
win.open();
Expected behavior.