Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24708] Android: Unable to add ti.map to a ListView

GitHub Issuen/a
TypeBug
PriorityHigh
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsvalidate
ReporterGary Mathews
AssigneeGary Mathews
Created2017-05-19T14:31:37.000+0000
Updated2020-06-30T15:24:22.000+0000

Description

mapView should be able to be added to an existing view without error.
var win = Ti.UI.createWindow({backgroundColor: 'gray', layout: 'vertical'});
    btn = Ti.UI.createButton({title: 'ADD MAP', height: '40dp'}),
    listView = Ti.UI.createListView(),
    sections = [],

    Map = require('ti.map'),
    mapView = Map.createView({
        mapType: Map.NORMAL_TYPE,
        region: {
            latitude: 37.3680, longitude: -121.9145,
            latitudeDelta: 0.1, longitudeDelta: 0.1
        }
    });

var header = Ti.UI.createView({
        backgroundColor: 'red',
        width: Ti.UI.FILL, height: '200dp',
    }),
    numberSection = Ti.UI.createListSection({headerView: header}),
    numberData = [
        {properties: { title: 'One', color: 'white'}},
        {properties: { title: 'Two', color: 'white'}},
        {properties: { title: 'Three', color: 'white'}}
    ];
numberSection.setItems(numberData);
sections.push(numberSection);
listView.sections = sections;

btn.addEventListener('click', function() {
    header.add(mapView);
});

win.add(btn);
win.add(listView);
win.open();

Comments

  1. Hans Knöchel 2017-05-19

    Does it work with other docs? [Docs](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.ListView-property-headerView) say the headerView is creation-only on Android (which would of cause be nice to be fixed for parity).
  2. Rick White 2017-10-06

    Can I get an estimate on when this will be fixed? JB Hunt needs this for a production app, and they have been waiting since May. Thanks.

JSON Source