Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8553] Android : Map - v8 - Adding subviews (buttons) to a map view is ignoring the top and left properties that were set upon creation of the view

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionWon't Fix
Resolution Date2017-07-25T22:42:25.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterMichael Pettiford
AssigneeEric Merriman
Created2012-04-05T12:30:57.000+0000
Updated2017-07-25T22:42:25.000+0000

Description

Steps to reproduce: 1. Create a default mobile app and copy/paste the following code

var _window = Ti.UI.createWindow({
    backgroundColor:'blue'
});

var mountainView1 = Titanium.Map.createAnnotation({
			latitude : 37.390749,
			longitude : -122.081651,
			// title:"Appcelerator Headquarters",
			subtitle : 'Mountain View, CA',
			image : 'map_pin.png',
			animate : true,
			myid : 1 // Custom property to uniquely identify this annotation.
		});

		var mountainView2 = Titanium.Map.createAnnotation({
			latitude : 37.380749,
			longitude : -122.071651,
			// title:"Appcelerator Headquarters",
			subtitle : 'Mountain View, CA',
			image : 'appicon.png',
			animate : true,
			myid : 1 // Custom property to uniquely identify this annotation.
		});

		var mountainView3 = Titanium.Map.createAnnotation({
			latitude : 37.370749,
			longitude : -122.061651,
			// title:"Appcelerator Headquarters",
			subtitle : 'Mountain View, CA',
			image : 'appicon.png',
			animate : true,
			myid : 1 // Custom property to uniquely identify this annotation.
		});

		var mountainView4 = Titanium.Map.createAnnotation({
			latitude : 37.360749,
			longitude : -122.051651,
			title : "Appcelerator Headquarters",
			subtitle : 'Mountain View, CA',
			image : 'appicon.png',
			animate : true,
			myid : 1 // Custom property to uniquely identify this annotation.
		});

		var arr = [mountainView1, mountainView2, mountainView3, mountainView4];

		var mapview = Titanium.Map.createView({
			mapType : Titanium.Map.STANDARD_TYPE,
			region : {
				latitude : 37.375749,
				longitude : -122.066651,
				latitudeDelta : 0.01,
				longitudeDelta : 0.01
			},
			animate : true,
			regionFit : true,
			userLocation : true,
			annotations : arr
		});

		var btnUpdate1 = Titanium.UI.createButton({
			title : 'Update anno 1',
			top : 1,
			left : 0,
			width : 80,
			height : 50
		});
		btnUpdate1.addEventListener('click', function(e) {
			updateAnnotations(0);
		});

		var btnUpdate2 = Titanium.UI.createButton({
			title : 'Update anno 2',
			top : 1,
			left : 80,
			width : 80,
			height : 50
		});
		btnUpdate2.addEventListener('click', function(e) {
			updateAnnotations(1);
		});

		var btnUpdate3 = Titanium.UI.createButton({
			title : 'Update anno 3',
			top : 1,
			left : 160,
			width : 80,
			height : 50
		});
		btnUpdate3.addEventListener('click', function(e) {
			updateAnnotations(2);
		});

		var btnUpdate4 = Titanium.UI.createButton({
			title : 'Update anno 4',
			top : 1,
			left : 240,
			width : 80,
			height : 50
		});
		btnUpdate4.addEventListener('click', function(e) {
			updateAnnotations(3);
		});

		mapview.add(btnUpdate1);
		mapview.add(btnUpdate2);
		mapview.add(btnUpdate3);
		mapview.add(btnUpdate4);
		_window.add(mapview);
                _window.open();
 
2. Add the attached images to your resources folder 3. Run the app Actual result: Only the last button is shown in the top left of the map view Expected result: The buttons are added sequentially across the top of the map view *Note* There wasn't anything error or waning output to the log

Attachments

FileDateSize
appicon.png2012-04-05T12:30:57.000+00004275
map_pin.png2012-04-05T12:30:57.000+00001853

Comments

  1. Lee Morris 2017-07-25

    Closing due to inactivity. If this issue still exists, please raise a new ticket.

JSON Source