Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5310] Android: addAnnotations method does not exist

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-03-11T22:25:23.000+0000
Affected Version/sRelease 1.7.2, Release 1.8.0
Fix Version/sSprint 2011-52, Release 2.0.0, Release 1.8.1
ComponentsAndroid
Labelsmodule_map, parity, qe-testadded
ReporterKarol Pomaski
AssigneeOpie Cyrus
Created2011-09-20T07:51:33.000+0000
Updated2012-03-11T22:25:23.000+0000

Description

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();

Attachments

FileDateSize
annotation.png2011-09-20T07:51:33.000+000054736

Comments

  1. Tyler Mulligan 2011-11-29

    Solution found here: http://developer.appcelerator.com/question/123043/addannotations-on-android#answer-218731
  2. Wilson Luu 2012-01-13

    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
  3. Wilson Luu 2012-01-13

    Editing comment

JSON Source