custom images for Annotation pin?
Hi,
is it possible to use a custom image as marker on the Titanium.Map.view? (or is there a nice ducktape-code-snippet?) If not: Would love to see this within the next version! :)
thank you,
flo
4 Answers
-
For iPhone, you can use the 'image' property to replace the pin, but it needs to be a local image.
-
Hi, I dun think you can customize it. If you find a way, do let us know :-)
-
There seems to be an example in the KitchenSink?
var atlantaParams = { latitude:33.74511, longitude:-84.38993, title:"Atlanta, GA", subtitle:'Atlanta Braves Stadium', animate:true, leftButton:'../images/atlanta.jpg', rightButton: Titanium.UI.iPhone.SystemButton.DISCLOSURE, myid:3 // CUSTOM ATTRIBUTE THAT IS PASSED INTO EVENT OBJECTS }; if (!isAndroid) { atlantaParams.pincolor = Titanium.Map.ANNOTATION_PURPLE; } else { atlantaParams.pinImage = "../images/map-pin.png"; } var atlanta = Titanium.Map.createAnnotation(atlantaParams);
-
This is now possible in both Android and iOS.
Using the Annotation.image property, you can specify an image path to view instead of the pin.
var atlantaParams = { latitude:33.74511, longitude:-84.38993, title:"Atlanta, GA", subtitle:'Atlanta Braves Stadium', animate:true, image: 'images/cityIcon.png', leftButton:'../images/atlanta.jpg', rightButton: Titanium.UI.iPhone.SystemButton.DISCLOSURE, myid:3 }; var atlanta = Titanium.Map.createAnnotation(atlantaParams);