Skip to content

Instantly share code, notes, and snippets.

@AppWerft
Last active August 29, 2015 14:16
Show Gist options
  • Save AppWerft/73129b6ca56a788f00a6 to your computer and use it in GitHub Desktop.
Save AppWerft/73129b6ca56a788f00a6 to your computer and use it in GitHub Desktop.
mapview in drawer
var Geo = new (require('controls/geotracking'))(),
Map = require('ti.map'),
region = Ti.App.Properties.getObject('REGION', {
latitude : 50.4,
longitude : 11,
latitudeDelta : 20,
longitudeDelta : 20
});
var stations = ['dlf', 'drk', 'drw'];
var TiDrawerLayout = require('com.tripvi.drawerlayout');
Ti.App.Properties.setObject('REGION', region);
module.exports = function(args) {
var self = require('ui/generic.window')({
title : 'Deutschlandradio',
});
self.container4mapview = Ti.UI.createView();
var mapView = Map.createView({
mapType : Map.TERRAIN_TYPE,
region : region,
animate : false,
width : Ti.UI.FILL,
height : Ti.UI.FILL,
});
self.container4mapview.add(mapView);
var leftView = Ti.UI.createTableView({
backgroundColor : '#ccc'
});
var drawer = TiDrawerLayout.createDrawer({
contentView : self.container4mapview,
leftView : leftView,
leftDrawerWidth : "50%",
width : Ti.UI.FILL,
height : Ti.UI.FILL,
});
self.add(drawer);
self.addEventListener('focus', function() {
drawer.drawerIndicatorEnabled = true;
});
self.addEventListener('blur', function() {
drawer.drawerIndicatorEnabled = false;
});
return self;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment