Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10317] Android: Ti.Map.View crashes when inside TableView on scroll

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionWon't Fix
Resolution Date2013-03-27T16:29:18.000+0000
Affected Version/sRelease 2.1.0, Release 2.1.1
Fix Version/sn/a
ComponentsAndroid
Labelsapi, exalture, parity
ReporterMichael Walsh
AssigneeIngo Muschenetz
Created2012-07-19T18:39:35.000+0000
Updated2017-03-22T22:55:01.000+0000

Description

When embedding a Ti.Map.View inside a Ti.UI.TableViewRow on the Android platform, the app crashes after scrolling back to the map a second time. This does not occur on the iPhone platform.

Steps to reproduce.

Scroll down to view embedded MapView

Scroll back up to top of list, obscuring the MapView from the visible screen

Scroll back down to the MapView in the list

App crashes with 'MapView already created' exception

var mountainView = Titanium.Map.createAnnotation({
    latitude:37.390749,
    longitude:-122.081651,
    title:"Appcelerator Headquarters",
    subtitle:'Mountain View, CA',
    pincolor:Titanium.Map.ANNOTATION_RED,
    animate:true,
    myid:1
});
var mapview = Titanium.Map.createView({
    mapType: Titanium.Map.STANDARD_TYPE,
    region: {latitude:33.74511, longitude:-84.38993, 
            latitudeDelta:0.01, longitudeDelta:0.01},
    animate:true,
    regionFit:true,
    userLocation:true,
    annotations:[mountainView],
    height:300
});
var maprow = Ti.UI.createTableViewRow();
maprow.add(mapview);
 
var table = Ti.UI.createTableView();
table.setData([
    Ti.UI.createTableViewRow({ title:'buffer row' }),
    Ti.UI.createTableViewRow({ title:'buffer row' }),
    Ti.UI.createTableViewRow({ title:'buffer row' }),
    Ti.UI.createTableViewRow({ title:'buffer row' }),
    Ti.UI.createTableViewRow({ title:'buffer row' }),
    Ti.UI.createTableViewRow({ title:'buffer row' }),
    Ti.UI.createTableViewRow({ title:'buffer row' }),
    Ti.UI.createTableViewRow({ title:'buffer row' }),
    Ti.UI.createTableViewRow({ title:'buffer row' }),
    Ti.UI.createTableViewRow({ title:'buffer row' }),
    Ti.UI.createTableViewRow({ title:'buffer row' }),
    Ti.UI.createTableViewRow({ title:'buffer row' }),
    Ti.UI.createTableViewRow({ title:'buffer row' }),
    Ti.UI.createTableViewRow({ title:'buffer row' }),
    Ti.UI.createTableViewRow({ title:'buffer row' }),
    Ti.UI.createTableViewRow({ title:'buffer row' }),
    Ti.UI.createTableViewRow({ title:'buffer row' }),
    Ti.UI.createTableViewRow({ title:'buffer row' }),
    Ti.UI.createTableViewRow({ title:'buffer row' }),
    Ti.UI.createTableViewRow({ title:'buffer row' }),
    Ti.UI.createTableViewRow({ title:'buffer row' }),
    maprow
]);
 
var win = Ti.UI.createWindow();
win.add(table);
win.open();

Exceptions

{quote} 07-18 16:03:26.202: E/TiApplication(2041): (main) [6561,11060] Sending event: exception on thread: main msg:java.lang.IllegalStateException: MapView already created. Android can support one MapView per Application.; Titanium 2.0.2,2012/04/18 12:19,0684d32 07-18 16:03:26.202: E/TiApplication(2041): java.lang.IllegalStateException: MapView already created. Android can support one MapView per Application. {quote}

Comments

  1. Ingo Muschenetz 2013-03-27

    Note that this is possible by using the new Google maps module on SDK 3.0.2 and above: https://marketplace.appcelerator.com/apps/5005?1856365980
  2. Lee Morris 2017-03-22

    Closing ticket as "Won't Fix".

JSON Source