Setting map pin image - iPhone only?
I was going to play around with the map view, see what can be set and not set to change its visuals. And found that the pin can be set using pinImage by looking at kitchen sink demo at (http://github.com/appcelerator/titanium_mobile/blob/master/demos/KitchenSink/Resources/images/map-pin.png).
But the if statement leads me to think that this only works on iPhone, is this true? Also, is there anywhere in the API docs which tell us which commands/attributes work on which devices?
if (!isAndroid) {
atlantaParams.pincolor = Titanium.Map.ANNOTATION_PURPLE;
} else {
atlantaParams.pinImage = "/images/map-pin.png";
}
5 Answers
-
Accepted Answer
Android has 3 standard pins (red, green and purple), same on iPhone. But on the iPhone you have the possibility to add your own custom pins. You can do that with the command you subscribed
-
What?? no customized pin for Android?? shoot!
-
Okay, thanks, so I can't do this on android, shame. Sadly the pin I get in the android preview doesn't even look like a pin, just a circle (which is why I wanted to use an image).
-
yeah i know, i dont like those dots eighter, hopefully in one of the next releases this will be adjusted.
-
Just for information if somebody come to this subject.
It is possible with this code :
mapview.addAnnotation(Ti.Map.createAnnotation({ animate: true, title: 'Annotation title', subtitle: 'Subtitle', latitude: geo.LATITUDE_BASE, longitude: geo.LONGITUDE_BASE, leftButton: '/images/delete.png', image: '/images/red-dot.png', }));