← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2041: (GIS) Drilldown on polygon click implemented for mapsource: database.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 2041 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: trunk
timestamp: Thu 2010-09-02 18:20:59 +0530
message:
  (GIS) Drilldown on polygon click implemented for mapsource: database.
modified:
  dhis-2/dhis-web/dhis-web-mapping/src/main/resources/org/hisp/dhis/mapping/i18n_module.properties
  dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/i18n.vm
  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/pointShapefile.vm
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/polygonShapefile.vm
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Symbol.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/resources/org/hisp/dhis/mapping/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/resources/org/hisp/dhis/mapping/i18n_module.properties	2010-08-30 13:58:52 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/resources/org/hisp/dhis/mapping/i18n_module.properties	2010-09-02 12:46:20 +0000
@@ -196,4 +196,8 @@
 aggregating_map_values				= Aggregating map values..
 loading_geojson						= Loading geojson..
 date_type							= Date type
-saved_as_date_type					= saved as date type.
\ No newline at end of file
+saved_as_date_type					= saved as date type.
+start_date							= Start date
+end_date							= End date
+fixed_periods						= Fixed periods
+start_end_dates						= Start-end dates
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml	2010-08-31 10:40:24 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml	2010-09-02 12:28:43 +0000
@@ -370,6 +370,7 @@
 			<result name="Point" type="velocity-json">/dhis-web-mapping/pointShapefile.vm</result>
 			<result name="Polygon" type="velocity-json">/dhis-web-mapping/polygonShapefile.vm</result>
 			<result name="MultiPolygon" type="velocity-json">/dhis-web-mapping/polygonShapefile.vm</result>
+			<result name="None" type="velocity-json">/dhis-web-mapping/polygonShapefile.vm</result>
 		</action>
 
 		<action name="getGeoJsonFromFile"

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/i18n.vm'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/i18n.vm	2010-08-30 13:58:52 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/i18n.vm	2010-09-02 12:46:20 +0000
@@ -195,4 +195,8 @@
 var i18n_aggregating_map_values = '$encoder.jsEscape($i18n.getString( 'aggregating_map_values' ) , "'")';
 var i18n_loading_geojson = '$encoder.jsEscape($i18n.getString( 'loading_geojson' ) , "'")';
 var i18n_date_type = '$encoder.jsEscape($i18n.getString( 'date_type' ) , "'")';
-var i18n_saved_as_date_type = '$encoder.jsEscape($i18n.getString( 'saved_as_date_type' ) , "'")';
\ No newline at end of file
+var i18n_saved_as_date_type = '$encoder.jsEscape($i18n.getString( 'saved_as_date_type' ) , "'")';
+var i18n_start_date = '$encoder.jsEscape($i18n.getString( 'start_date' ) , "'")';
+var i18n_end_date = '$encoder.jsEscape($i18n.getString( 'end_date' ) , "'")';
+var i18n_fixed_periods = '$encoder.jsEscape($i18n.getString( 'fixed_periods' ) , "'")';
+var i18n_start_end_dates = '$encoder.jsEscape($i18n.getString( 'start_end_dates' ) , "'")';
\ No newline at end of file

=== 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-09-01 12:30:00 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js	2010-09-02 12:46:20 +0000
@@ -363,7 +363,7 @@
                                     zoom: zoom
                                 },
 								success: function(r) {
-									Ext.message.msg(true, 'The view <span class="x-msg-hl">' + vn + '</span> ' + i18n_was_registered);
+									Ext.message.msg(true, 'The view <span class="x-msg-hl">' + vn + '</span> ' + i18n_was_registered + '.');
 									Ext.getCmp('view_cb').getStore().load();
 									Ext.getCmp('mapview_cb').getStore().load();
 									Ext.getCmp('viewname_tf').reset();
@@ -932,7 +932,7 @@
                         params: { id: ls },
 
                         success: function(r) {
-                            Ext.message.msg(true, i18n_legend_set+'<span class="x-msg-hl">' + lsrw + '</span> ' + i18n_was_updated);
+                            Ext.message.msg(true, i18n_legend_set+' <span class="x-msg-hl">' + lsrw + '</span> ' + i18n_was_updated);
                             Ext.getCmp('automaticmaplegendset_cb').getStore().load();
                         },
                         failure: function() {
@@ -2887,7 +2887,7 @@
 						minListWidth: combo_width_fieldset,
                         store: new Ext.data.SimpleStore({
                             fields: ['value', 'text'],
-                            data: [[map_date_type_fixed, 'Fixed periods'], [map_date_type_start_end, 'Start-end date']]
+                            data: [[map_date_type_fixed, i18n_fixed_periods], [map_date_type_start_end, i18n_start_end_dates]]
                         }),
                         listeners: {
                             'select': {
@@ -4153,8 +4153,32 @@
 	var east_panel = Ext.getCmp('east');
 	var x = east_panel.x - 210;
 	var y = east_panel.y + 41;
-	
-    if (ACTIVEPANEL == organisationUnitAssignment) {
+    
+    if (ACTIVEPANEL == thematicMap && MAPSOURCE == map_source_type_database) {
+        Ext.getCmp('map_tf').setValue(feature.data.name);
+        
+        for (var i = 0; i < feature.layer.features.length; i++) {
+            if (feature.data.name == feature.layer.features[i].attributes.name) {
+                Ext.getCmp('map_tf').value = feature.layer.features[i].attributes.id;
+                break;
+            }
+        }
+        
+        choropleth.loadFromDatabase(Ext.getCmp('map_tf').value);
+    }
+    else if (ACTIVEPANEL == thematicMap2 && MAPSOURCE == map_source_type_database) {
+        Ext.getCmp('map_tf2').setValue(feature.data.name);
+        
+        for (var i = 0; i < feature.layer.features.length; i++) {
+            if (feature.data.name == feature.layer.features[i].attributes.name) {
+                Ext.getCmp('map_tf2').value = feature.layer.features[i].attributes.id;
+                break;
+            }
+        }
+        
+        proportionalSymbol.loadFromDatabase(Ext.getCmp('map_tf2').value);
+    }
+    else if (ACTIVEPANEL == organisationUnitAssignment) {
 		if (popup) {
 			popup.destroy();
 		}

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/pointShapefile.vm'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/pointShapefile.vm	2010-08-27 17:51:04 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/pointShapefile.vm	2010-09-02 11:58:04 +0000
@@ -14,6 +14,7 @@
         },
       "properties":
         {
+          "id":"$!{unit.id}",
           "name":"$!encoder.jsEncode( ${unit.name} )",
           "type":"Facility"
         }

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/polygonShapefile.vm'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/polygonShapefile.vm	2010-08-27 17:51:04 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/polygonShapefile.vm	2010-09-02 11:58:04 +0000
@@ -14,6 +14,7 @@
         },
       "properties":
         {
+          "id":"$!{unit.id}",
           "name":"$!encoder.jsEncode( ${unit.name} )"
         }
     }#if( $velocityCount < $size ),#end

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js	2010-09-01 12:26:15 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js	2010-09-02 12:46:20 +0000
@@ -919,7 +919,7 @@
         {
             xtype: 'datefield',
             id: 'startdate_df',
-            fieldLabel: 'Start date',
+            fieldLabel: i18n_start_date,
             format: 'Y-m-d',
             hidden: true,
             emptyText: emptytext,
@@ -938,7 +938,7 @@
         {
             xtype: 'datefield',
             id: 'enddate_df',
-            fieldLabel: 'End date',
+            fieldLabel: i18n_end_date,
             format: 'Y-m-d',
             hidden: true,
             emptyText: emptytext,

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Symbol.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Symbol.js	2010-09-01 12:26:15 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Symbol.js	2010-09-02 12:48:17 +0000
@@ -919,7 +919,7 @@
         {
             xtype: 'datefield',
             id: 'startdate_df2',
-            fieldLabel: 'Start date',
+            fieldLabel: i18n_start_date,
             format: 'Y-m-d',
             hidden: true,
             emptyText: emptytext,
@@ -938,7 +938,7 @@
         {
             xtype: 'datefield',
             id: 'enddate_df2',
-            fieldLabel: 'End date',
+            fieldLabel: i18n_end_date,
             format: 'Y-m-d',
             hidden: true,
             emptyText: emptytext,