Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4260] Android: leftView, leftButton will not display a view on map annotaion

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-06-06T16:25:36.000+0000
Affected Version/sRelease 1.7.0, Release 1.6.2
Fix Version/sSprint 2011-23, Release 1.8.0
ComponentsAndroid
Labelsn/a
ReporterAlan Leard
AssigneeNatalie Huynh
Created2011-05-31T12:47:12.000+0000
Updated2011-08-25T11:05:42.000+0000

Description

If a user wants to display an image that has been resized, or any type of a view on a map annotation, you can only pass a local or remote path to an image on android. The sample code demonstrates the issue on android, and how it should work on iOS:
var win = Titanium.UI.createWindow();

var isAndroid = false;
if (Titanium.Platform.name == 'android') {
	isAndroid = true;
}

var atlantaParams = {
		latitude:33.74511,
		longitude:-84.38993,
		title:"Atlanta, GA",
		subtitle:'Atlanta Braves Stadium\nfoo',
		animate:true,
		leftView:Ti.UI.createImageView( {
          image:   'default_app_logo.png'
        , width:   30
        , height:  30
      } )
};

if (!isAndroid) {
	atlantaParams.pincolor = Titanium.Map.ANNOTATION_PURPLE;
} else {
	atlantaParams.pinImage = "map-pin.png";
}
var atlanta = Titanium.Map.createAnnotation(atlantaParams);

var regionAtlanta = {latitude:33.74511,longitude:-84.38993,animate:true,latitudeDelta:0.04, longitudeDelta:0.04};

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,
	annotations:[atlanta]
});

if (!isAndroid) {
	mapview.addAnnotation(atlanta);
}
mapview.selectAnnotation(atlanta);
win.add(mapview);

win.open();

Attachments

FileDateSize
tsDefault.zip2011-06-06T14:18:15.000+00005298445

Comments

  1. Don Thorp 2011-06-01

    Also check rightButton and rightView
  2. Opie Cyrus 2011-06-06

    test app to verify against
  3. Opie Cyrus 2011-06-06

    pull request merged with master
  4. Natalie Huynh 2011-08-25

    Tested with 1.8.0.v20110819142548 iPhone 4.3.4 iPad2 4.3.2 Motorola Xoom 3.2 Nexus One 2.2.2

JSON Source