Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4352] Android: MapView does not refresh map if created before the parent window is open

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionWon't Do
Resolution Date2020-01-09T19:11:55.000+0000
Affected Version/sRelease 1.7.0, Release 1.6.2
Fix Version/sn/a
ComponentsAndroid
Labelsmapview, tbs-1.9.0
ReporterJon Alter
AssigneeUnknown
Created2011-06-08T11:17:43.000+0000
Updated2020-01-09T19:11:55.000+0000

Description

If you create and add a mapView to its parent window before that window is open then the map image will not load when you zoom in and out. Step 1: run the code below Step 2: notice that when you move the map or zoom out, the map does not refresh Step 3: remove the comments from the open event listener Step 4: run the code again Step 5: notice that the map image refreshes when you zoom in or out
var win = Titanium.UI.createWindow({  
    backgroundColor:'#fff',
  fullscreen:true
});

win.open();

// win.addEventListener('open', function(e){
  var mapview = Titanium.Map.createView({
    mapType: Titanium.Map.STANDARD_TYPE,
    region:{latitude:33.74511, longitude:-84.38993, latitudeDelta:0.5, longitudeDelta:0.5},
    animate:true,
    regionFit:true,
    userLocation:true
  });

  win.add(mapview);
// });

Workaround

create and add the mapview to the window in the window open event listener.

Associated Helpdesk Ticket

http://appc.me/c/APP-399811

Comments

  1. Marshall Culpepper 2011-08-22

    Known workarounds exist, and the fix requires some major architecture changes -- moving into 1.9.0
  2. Anh Nguyen 2014-04-09

    Did any one fix this issue? any update from Appcelerator?
  3. Alan Hutton 2020-01-09

    It has been decided that this issue should be closed as “Won’t do.” This issue is out of date with our current supported SDK release (7.5.2.GA as of the date of closure), and out of date with mobile OS versions. Updating, or creating code may not reproduce the issue reported, or be a valid test case. If community members feel that the issue is still valid, please create a new ticket. Please reference this closed ticket number, include SDK used, comments, and code that demonstrates/reproduces the issue.

JSON Source