Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10808] Android: Refactor/Optimize MapView addRoute/removeRoute logic

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-09-07T13:18:26.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sRelease 3.0.0, Sprint 2012-18 API
ComponentsAndroid
Labelsapi
ReporterHieu Pham
AssigneeHieu Pham
Created2012-09-06T18:08:01.000+0000
Updated2012-12-05T18:21:48.000+0000

Description

Refactor MapView add/removeRoute to improve performance and memory usage. Functionality test:
var win = Ti.UI.createWindow({ backgroundColor: '#00f' });
var map = Titanium.Map.createView({
    mapType: Titanium.Map.STANDARD_TYPE,
    region: {
        latitude: 42.3366, longitude: -71.1689,
        latitudeDelta: 0.001, longitudeDelta: 0.004
    }
});
map.addRoute({
    name: '1',
    points: [
        {latitude: 42.3353, longitude: -71.1705 },
        {latitude: 42.3383, longitude: -71.1690 },
        {latitude: 42.3358, longitude: -71.1670 },
        {latitude: 42.3353, longitude: -71.1705 }
    ],
    color: 'red',
    width: 4
});
map.addRoute({
    name: '2',
    points: [
        {latitude: 42.3363, longitude: -71.1682 },
        {latitude: 42.3370, longitude: -71.1686 },
        {latitude: 42.3369, longitude: -71.1692 },
        {latitude: 42.3366, longitude: -71.1695 },
        {latitude: 42.3361, longitude: -71.1690 },
        {latitude: 42.3368, longitude: -71.1685 }
    ],
    color: 'red',
    width: 4
});
win.add(map);
win.open();

Comments

  1. Hieu Pham 2012-09-07

    The bulk of this ticket is to refactor MapView add/removeRoute to improve memory usage. The performance increase is small/negligible.
  2. Natalie Huynh 2012-12-05

    Tested with 3.0.0v20121204144658 on Droid 1 2.2.3

JSON Source