← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1813: (GIS) Feature popup ready to use + bug fixed.

 

------------------------------------------------------------
revno: 1813
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: gis
timestamp: Mon 2010-05-03 17:17:30 +0200
message:
  (GIS) Feature popup ready to use + bug fixed.
modified:
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js	2010-04-28 15:28:40 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js	2010-05-03 15:17:30 +0000
@@ -1402,23 +1402,23 @@
 		}
 	});
 	
-    // var typeComboBox = new Ext.form.ComboBox({
-        // id: 'type_cb',
-        // editable: false,
-        // displayField: 'name',
-        // valueField: 'name',
-		// emptyText: emptytext,
-		// hideLabel: true,
-        // width: combo_width,
-        // minListWidth: combo_width,
-        // triggerAction: 'all',
-        // mode: 'local',
-        // value: 'Polygon',
-        // store: new Ext.data.SimpleStore({
-            // fields: ['name'],
-            // data: [['Polygon']]
-        // })
-    // });
+    var typeComboBox = new Ext.form.ComboBox({
+        id: 'type_cb',
+        editable: false,
+        displayField: 'name',
+        valueField: 'name',
+		emptyText: emptytext,
+		hideLabel: true,
+        width: combo_width,
+        minListWidth: combo_width,
+        triggerAction: 'all',
+        mode: 'local',
+        value: 'Polygon',
+        store: new Ext.data.SimpleStore({
+            fields: ['name'],
+            data: [['Polygon']]
+        })
+    });
 
 	var newNameColumnComboBox = new Ext.form.ComboBox({
         id: 'newnamecolumn_cb',
@@ -3062,14 +3062,25 @@
 /* Section: select features */
 var popup;
 
-var featureMenu = new Ext.menu.Menu({});
-featureMenu.add({
+var featureWindow = new Ext.Window({
+    title: 'tittel',
+    closeAction: 'hide',
+    items: [
+        {
+            xtype: 'menu',
+            id: 'feature_m',
+            floating: false
+        }
+    ]
+});
+
+Ext.getCmp('feature_m').add({
 	html: 'Centre',
 	iconCls: 'no-icon',
 	listeners: {
 		'click': {
 			fn: function() {
-				alert(1);
+				MAP.setCenter(FEATURE.geometry.getBounds().getCenterLonLat());
 			}
 		}
 	}
@@ -3125,7 +3136,12 @@
 		mapping.relation = feature.attributes[MAPDATA.nameColumn];
     }
 	else {
-		// featureMenu.showAt([300,200]);
+        // var x = Ext.getCmp('east').x - 100;
+        // var y = Ext.getCmp('center').y + 41; 
+		// featureMenu.showAt([x,y]);
+        featureWindow.setPagePosition(Ext.getCmp('east').x - 120, Ext.getCmp('center').y + 41);
+        featureWindow.setTitle(FEATURE.attributes[MAPDATA.nameColumn]);
+        featureWindow.show();
 		// MAP.setCenter(feature.geometry.getBounds().getCenterLonLat(), MAP.getZoom()+1);
 		// sc(feature.attributes[MAPDATA.nameColumn], Ext.getCmp('indicator_cb').getRawValue());
 	}