I'm developing an Android app in Appcelerator Studio.
In the app I have a map which displays annotations with different custom images. The annotations are created this way:
annotation = map.createAnnotation({
image: 'images/pin' + myNumber + '.png',
latitude: myLat,
longitude: myLong,
title: myTitle
});
Almost all of the annotations are displayed, but there are a few which for some reason are invisible. I've verified that 'images/pin' + myNumber + '.png' is the actual path to the image I want to display.
Image which is displayed:
Image which is NOT displayed:
Things getting weirder.
For testing purpose I created two ImageViews with the image property set to 'images/pin3.png' and 'images/pin163.png' respectively. Both images are displayed. But, as stated, when setting 'images/pin163.png' to an annotation's image property, it is invisble.
I would greatly appreciate your help as I don't have any idea what the issue might be.
Nexus 5, Android 6.0.1:
Sony Experia Z, Android 4.4:
Sony Experia Z, Android 5.Something:
I finally got it working.
Instead of setting the annotation's image property, I create a view, set the view's backgroundImage property to my image and then assign the view to the annotation's customView property.
var customAnnotationView = Ti.UI.createView({
backgroundImage: 'images/pin' + myNumber + '.png',
});
var annotation = map.createAnnotation({
customView: customAnnotationView,
latitude: myLat,
longitude: myLong,
title: myTitle
});