Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

UMOBILE-257 Fixed issue in MapProxy on Android, and made map ui autom…

…atically responsive to orientation changes.
  • Loading branch information...
commit d83664e78a1175e415bcd38d55130f6b7207a9d7 1 parent b0027ad
Jeff Cross jeffbcross authored
3  Resources/js/models/MapProxy.js
View
@@ -347,7 +347,8 @@ exports.retrieveLocationsByCategory = function (_catName, _numResults, _pageNum)
_resultSet.next();
}
- _result.totalResults = parseInt(_db.execute("SELECT COUNT(*) FROM map_locations WHERE categories LIKE ?", _catNameQuery).field(0), 10);
+ // Not used yet, but was causing errors. totalResults would be useful for paging UI, which hasn't yet been implemented.
+ // _result.totalResults = parseInt(_db.execute("SELECT COUNT(*) FROM map_locations WHERE categories LIKE ?", _catNameQuery).field(0), 10) || 0;
_resultSet.close();
_db.close();
7 Resources/js/style.js
View
@@ -502,7 +502,8 @@ exports.updateStyles = function () {
// MAP STYLES
exports.mapView= {
top: defaults.TITLEBAR_HEIGHT * 2 + 'dp',
- height: deviceProxy.retrieveHeight(true) - (defaults.TITLEBAR_HEIGHT * 2 + defaults.STATUSBAR_HEIGHT + 50) + 'dp',
+ // height: deviceProxy.retrieveHeight(true) - (defaults.TITLEBAR_HEIGHT * 2 + defaults.STATUSBAR_HEIGHT + 50) + 'dp',
+ bottom: '50dp',
mapType: Titanium.Map.STANDARD_TYPE,
regionFit: true,
animate: true,
@@ -513,7 +514,7 @@ exports.updateStyles = function () {
};
exports.mapTableView = {
top: defaults.TITLEBAR_HEIGHT * 2 + 'dp',
- height: deviceProxy.retrieveHeight(true) - (defaults.TITLEBAR_HEIGHT + defaults.TITLEBAR_HEIGHT + defaults.STATUSBAR_HEIGHT + 50) + 'dp'
+ bottom: '50dp'
};
exports.mapCategoryRow= {
font: {
@@ -535,7 +536,7 @@ exports.updateStyles = function () {
textAlign: 'center'
};
exports.mapNavView= {
- top: deviceProxy.retrieveHeight(true) - 50 - defaults.STATUSBAR_HEIGHT + 'dp',
+ bottom: 0,
height : '50dp',
backgroundGradient : defaults.SECONDARY_BAR_BACKGROUND_GRADIENT
};
16 Resources/js/views/MapWindowView.js
View
@@ -73,11 +73,6 @@ exports.saveActivityIndicatorMessage = function (message) {
};
exports.rotate = function (orientation) {
- styles = styles.updateStyles();
- if (mapView) mapView.height = styles.mapView.height;
- if (bottomNavView) bottomNavView.top = styles.mapNavView.top;
-
- if (categoryBrowsingView) categoryBrowsingView.height = styles.mapTableView.height;
};
exports.resetMapLocation = function () {
@@ -91,7 +86,7 @@ exports.searchBlur = function (e) {
exports.openCategoryBrowsingView = function (categories) {
_hideAllViews();
- if (categories.length === 1) return exports.openCategoryLocationsListView(require('/js/models/MapProxy').retrieveLocationsByCategory(categories[0].name));
+ if (categories.length === 1) return exports.openCategoryLocationsListView(mapProxy.retrieveLocationsByCategory(categories[0].name));
// If there isn't a categoryNavBar yet, go ahead and create one.
if (!categoryNavBar) _createAndAddCategoryNav();
@@ -144,11 +139,8 @@ exports.openCategoryBrowsingView = function (categories) {
})(categories);
// Create the view to hold tableviews listing categories and locations.
- categoryBrowsingView = Ti.UI.createTableView({
- data: _categoryBrowsingData,
- height: styles.mapTableView.height,
- top: styles.mapTableView.top
- });
+ categoryBrowsingView = Ti.UI.createTableView(styles.mapTableView);
+ categoryBrowsingView.setData(_categoryBrowsingData);
view.add(categoryBrowsingView);
};
@@ -167,7 +159,7 @@ exports.openCategoryLocationsListView = function (viewModel) {
if (!categoryNavBar) _createAndAddCategoryNav();
categoryNavBar.view.show();
- categoryNavBar.leftButton[require('/js/models/MapProxy').retrieveTotalCategories() > 1 ? 'show' : 'hide']();
+ categoryNavBar.leftButton[mapProxy.retrieveTotalCategories() > 1 ? 'show' : 'hide']();
categoryNavBar.titleLabel.text = viewModel.categoryName;
categoryNavBar.rightButton.title = localDictionary.map;
categoryNavBar.rightButton.show();
Please sign in to comment.
Something went wrong with that request. Please try again.