Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13882] iOS: When dynamically adding route points to a map over time causes app to crash

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionCannot Reproduce
Resolution Date2017-06-22T20:04:44.000+0000
Affected Version/sRelease 3.1.1
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterParas Mishra
AssigneeEric Merriman
Created2013-05-16T11:45:25.000+0000
Updated2017-06-22T20:04:44.000+0000

Description

iOS: When dynamically adding route points to a map over time causes app to crash Steps to reproduce: 1. Run the following app.
                var win1 = Titanium.UI.createWindow({  
                 title:'window 1',
                 backgroundColor:'#fff'
                  });

 
		var maproute = {
		    name : 'runtrackerroute',
		    points : [{
		        latitude : 42.3353,
		        longitude : -71.1715
		    }, {
		        latitude : 42.3355,
		        longitude : -71.1725
		    }, {
		        latitude : 42.3359,
		        longitude : -71.1735
		    }],
		    color : 'blue',
		    width : 4
		};
		 
		var map = Titanium.Map.createView({
		    mapType : Titanium.Map.STANDARD_TYPE,
		    region : {
		        latitude : 42.3366,
		        longitude : -71.1689,
		        latitudeDelta : 0.01,
		        longitudeDelta : 0.01
		    }
		});
		map.addRoute(maproute);
		 
		function UpdateMapRoute(lat, lon)
		{
		    //remove route
		    map.removeRoute(maproute);
		 
		    //add new points
		    maproute.points.push({
		        'latitude' : lat,
		        'longitude' : lon
		    });
		 
		    //add route
		    map.addRoute(maproute);
		     
		    map.setLocation({
		        latitude : lat,
		        longitude : lon,
		        animate : true,
		        latitudeDelta : 0.001,
		        longitudeDelta : 0.004
		    });
		 
		}
		 
		var lat = 42.3359;
		var lon = -71.1735;
		 
		setInterval(function(){
		    UpdateMapRoute(lat,lon);
		    lat = lat + .002;
		    lon = lon + .002;
		},500);
		 
		 
		 
		win1.add(map);
                win1.open();
Expected: App should not crash. It should display a map and the map should keep on adding route points. Actual: App crashes on execution.

Comments

  1. Lee Morris 2017-06-22

    I am unable to reproduce this issue with the following environment; iPhone 7 (10.2) Studio 4.9.0.201705302345 Ti SDK 6.1.1.v20170620103414 Appc NPM 4.2.9 Appc CLI 6.2.1 Ti CLI 5.0.13 Alloy 1.9.11 Arrow 2.0.0 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131

JSON Source