[Commits] r2501 - sandbox/cmoullet/ux/Mobile/app

commits at geoext.org commits at geoext.org
Sun Nov 28 07:50:15 CET 2010


Author: cmoullet
Date: 2010-11-28 07:50:15 +0100 (Sun, 28 Nov 2010)
New Revision: 2501

Removed:
   sandbox/cmoullet/ux/Mobile/app/point.png
Modified:
   sandbox/cmoullet/ux/Mobile/app/init.js
Log:
Create a first layer selector

Modified: sandbox/cmoullet/ux/Mobile/app/init.js
===================================================================
--- sandbox/cmoullet/ux/Mobile/app/init.js	2010-11-28 05:27:43 UTC (rev 2500)
+++ sandbox/cmoullet/ux/Mobile/app/init.js	2010-11-28 06:50:15 UTC (rev 2501)
@@ -1,3 +1,7 @@
+Ext.regModel('layer', {
+    fields: ['layerid', 'layertopic', 'layername']
+});
+
 Ext.setup({
     icon: 'icon.png',
     tabletStartupScreen: 'tablet_startup.png',
@@ -43,14 +47,46 @@
         });
 
         // Layer Manager Definition
+        var layerStore = new Ext.data.Store({
+            model  : 'layer',
+            sorters: 'layername',
+            getGroupString : function(record) {
+                return record.get('layername')[0];
+            },
+            data: [
+                {
+                    layerid: 'ch.swisstopo.fixpunkte-agnes',
+                    layername: 'Agnes',
+                    layertopic: 'Base Data / Coordinate reference systems'
+                },
+                {
+                    layerid: 'ch.swisstopo.hiks-dufour',
+                    layername: 'Dufour',
+                    layertopic: 'Base Data / Geographical names'
+                }
+            ]
+        });
         var layerManagerPanel = new Ext.Panel({
             title: 'Layer Manager',
-            iconCls: 'settings'
+            iconCls: 'settings',
+            fullscreen: true,
+            items: [
+                {
+                    xtype: 'list',
+                    store: layerStore,
+                    itemTpl: '<div><h1>{layername}</h1>{layertopic}</div>',
+                    onItemDisclosure: function(record, btn, index) {
+                        Ext.Msg.alert('Add layer', 'Layer: ' + record.get('layerid') + ' has been added to the map', Ext.emptyFn);
+                        Ext.getCmp('mainTabPanel').setActiveItem(0);
+                    }
+                }
+            ]
 
         });
 
         // Global Tab Panel
         var tabPanel = new Ext.TabPanel({
+            id: 'mainTabPanel',
             tabBar: {
                 dock: 'bottom',
                 layout: {
@@ -69,7 +105,8 @@
             },
             items: [
                 mapPanel,
-                layerManagerPanel]
+                layerManagerPanel
+            ]
         });
     }
 });
\ No newline at end of file

Deleted: sandbox/cmoullet/ux/Mobile/app/point.png
===================================================================
(Binary files differ)



More information about the Commits mailing list