Problem
While using addAnnotations method with Android it throws an error: "TypeError: Cannot find function addAnnotations in object [Ti.Map.View].". This method works correctly on iOS.
Reproducible Steps
1. Execute the sample code (the error message would appear)
Description of addAnnotations method
http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Map.MapView-object
Sample Code
var win = Ti.UI.createWindow();
var atlantaParams = {
latitude:33.74511,
longitude:-84.38993,
title:"Atlanta, GA",
subtitle:'Atlanta Braves Stadium\nfoo',
animate:true,
rightButton: Titanium.UI.iPhone.SystemButton.DISCLOSURE,
myid:3
};
atlantaParams.pincolor = Titanium.Map.ANNOTATION_PURPLE;
var atlanta = [];
atlanta.push(Titanium.Map.createAnnotation(atlantaParams));
var mapview = Titanium.Map.createView({
mapType: Titanium.Map.STANDARD_TYPE,
region:{latitude:33.74511, longitude:-84.38993, latitudeDelta:0.5, longitudeDelta:0.5},
animate:true,
regionFit:true,
userLocation:true
});
win.add(mapview);
mapview.addAnnotations(atlanta);
win.open();
Solution found here: http://developer.appcelerator.com/question/123043/addannotations-on-android#answer-218731
Closing bug. Verified fix on: SDK build: 1.9.0.v20120112153134 Runtime: V8, Rhino Titanium Studio, build: 1.0.8.201201122152 Device: Droid 3 (2.3.4) Note: Bug is reproducible in 1.7.5 and 1.8.0.1
Editing comment