[TIMOB-4260] Android: leftView, leftButton will not display a view on map annotaion
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-06-06T16:25:36.000+0000 |
Affected Version/s | Release 1.7.0, Release 1.6.2 |
Fix Version/s | Sprint 2011-23, Release 1.8.0 |
Components | Android |
Labels | n/a |
Reporter | Alan Leard |
Assignee | Natalie Huynh |
Created | 2011-05-31T12:47:12.000+0000 |
Updated | 2011-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
File | Date | Size |
---|---|---|
tsDefault.zip | 2011-06-06T14:18:15.000+0000 | 5298445 |
Also check rightButton and rightView
test app to verify against
pull request merged with master
Tested with 1.8.0.v20110819142548 iPhone 4.3.4 iPad2 4.3.2 Motorola Xoom 3.2 Nexus One 2.2.2