Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4599] iOS Regression: MapView Region Doesn't Set in 1.7.0+

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionDuplicate
Resolution Date2011-07-25T14:42:24.000+0000
Affected Version/sRelease 1.7.0, Release 1.7.1, Release 1.8.0
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterDawson Toth
AssigneeReggie Seagraves
Created2011-07-06T12:52:26.000+0000
Updated2017-03-09T21:35:22.000+0000

Description

Regression

The region of a map view in a tab group is no longer respected, so the initial view of a map view is always fully zoomed out (showing the whole world).

Reproduction

Drop the following in an app.js. If you use 1.7.0 through the latest 1.8.0 builds with the iPhone Simulator, you will see the whole world. But use 1.6.2 and you will see a specific region.
var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
var map = Ti.Map.createView({
    mapType: Ti.Map.STANDARD_TYPE,
    regionFit: true,
    region: { latitude: 60, longitude: 10.760797, latitudeDelta: 0.035, longitudeDelta: 0.035 }
});
win.add(map);

var tabGroup = Ti.UI.createTabGroup();
tabGroup.addTab(Ti.UI.createTab({
    window: win
}));
tabGroup.open();

// WORKAROUND 1: Don't use a tab group (comment lines 9-13)
//win.open();

// WORKAROUND 2: Don't add the map to the window until the open event fires (comment line 7)
//win.addEventListener('open', function() { win.add(map); });

Workarounds

There are two workarounds documented in the code above. The first is to take out the tab groups; if you use a normal window, this bug doesn't manifest. The second is to wait to add the map to the window until after the window opens.

Associated Helpdesk Ticket

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

Comments

  1. Lee Morris 2017-03-09

    Closing ticket as duplicate.

JSON Source