← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3711: Fixed bug: App crashed when polygons were loaded into symbol layer.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 3711 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-05-23 18:05:43 +0200
message:
  Fixed bug: App crashed when polygons were loaded into symbol layer.
modified:
  dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetGeoJsonAction.java
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/index.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/java/org/hisp/dhis/mapping/action/GetGeoJsonAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetGeoJsonAction.java	2011-05-13 10:42:19 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetGeoJsonAction.java	2011-05-23 16:04:37 +0000
@@ -129,7 +129,16 @@
                 }
             }
             
-            return OrganisationUnit.RESULTTYPE_SYMBOL;
+            if ( object.size() > 0 && object.iterator().next().getFeatureType().equals( OrganisationUnit.FEATURETYPE_POINT ) )
+            {
+                return OrganisationUnit.RESULTTYPE_SYMBOL;
+            }
+            
+            else
+            {
+                object.clear();
+                return NONE;
+            }
         }
 
         return object.size() > 0 ? object.iterator().next().getFeatureType() : NONE;

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/index.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/index.js	2011-05-20 15:46:34 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/index.js	2011-05-23 16:04:37 +0000
@@ -2768,15 +2768,15 @@
                         contentEl: 'featuredatatext'
 					},
                     {
-                        title: '<span class="panel-title">' + G.i18n.map_legend_polygon + '</span>',
+                        title: '<span class="panel-title">' + G.conf.thematic_layer_1 + ' legend</span>',
                         contentEl: 'polygonlegend'
                     },
                     {
-                        title: '<span class="panel-title">' + G.i18n.map_legend_point + '</span>',
+                        title: '<span class="panel-title">' + G.conf.thematic_layer_2 + ' legend</span>',
                         contentEl: 'pointlegend'
                     },
                     {
-                        title: '<span class="panel-title">Symbol legend</span>',
+                        title: '<span class="panel-title">Symbol layer legend</span>',
                         contentEl: 'symbollegend'
                     }
                 ]

=== 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	2011-05-19 08:48:09 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Symbol.js	2011-05-23 16:04:37 +0000
@@ -410,7 +410,7 @@
 								bodyStyle: 'padding:8px; background-color:#ffffff',
                                 labelWidth: G.conf.label_width,
 								items: [
-									{html: '<div class="window-info">Select organisation unit level</div>'},
+									{html: '<div class="window-info">Select point level</div>'},
 									{
 										xtype: 'combo',
 										fieldLabel: G.i18n.level,