dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #00217
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 70: Config documentation + enhanced tooltip.
------------------------------------------------------------
revno: 70
committer: Jan Henrik Overland janhenrik.overland@xxxxxxxxx
branch nick: trunk
timestamp: Mon 2009-03-16 12:29:29 +0530
message:
Config documentation + enhanced tooltip.
modified:
gis/dhis-gis-geostat/demos/geostat/config.js
gis/dhis-gis-geostat/demos/geostat/index.html
gis/dhis-gis-geostat/mfbase/mapfish/widgets/geostat/Choropleth.js
=== modified file 'gis/dhis-gis-geostat/demos/geostat/config.js'
--- gis/dhis-gis-geostat/demos/geostat/config.js 2009-03-14 10:21:55 +0000
+++ gis/dhis-gis-geostat/demos/geostat/config.js 2009-03-16 06:59:29 +0000
@@ -1,16 +1,43 @@
+// TOMCAT PORT
+localhost_port = 8180;
+
+
// SHAPE FILES
-choropleth1 = '../../../geoserver/wfs?request=GetFeature&typename=who:admin0&outputformat=json&version=1.0.0'; // country
-choropleth2 = '../../../geoserver/wfs?request=GetFeature&typename=who:admin1&outputformat=json&version=1.0.0'; // provinces
-choropleth3 = '../../../geoserver/wfs?request=GetFeature&typename=who:admin2&outputformat=json&version=1.0.0'; // districts
-choropleth4 = '../../../geoserver/wfs?request=GetFeature&typename=who:admin3&outputformat=json&version=1.0.0'; // chiefdoms
+empty = '';
+level_1 = '../../../geoserver/wfs?request=GetFeature&typename=who:admin1&outputformat=json&version=1.0.0'; // provinces
+level_2 = '../../../geoserver/wfs?request=GetFeature&typename=who:admin2&outputformat=json&version=1.0.0'; // districts
+level_3 = '../../../geoserver/wfs?request=GetFeature&typename=who:admin3&outputformat=json&version=1.0.0'; // chiefdoms
-shapefiles = new Array(choropleth1, choropleth2, choropleth3, choropleth4);
+shapefiles = new Array(empty, level_1, level_2, level_3);
shpcols = {
- 1: [ { type: "Province", name: "NAME", geocode: "NAME", value: "value" } ],
- 2: [ { type: "District", name: "NAME", geocode: "NAME", value: "value", parent1: "ADM1_NAME" } ],
- 3: [ { type: "Chiefdom", name: "CHIEFDOM", geocode: "CHIEFDOM", value: "value", parent1: "PROVINCE", parent2: "DISTRICT" } ],
- 4: [ { type: "Org. unit", name: "name", geocode: "ID", value: "value", parent1: "PROVINCE", parent2: "DISTRICT", parent3: "CHIEFDOM" } ] };
+
+ 1: [ { type: "Province", // What kind of orgunit. Displayed in the info box.
+ name: "NAME", // Shapefile column holding the name of the orgunit. Displayed in the info box.
+ geocode: "NAME", // Shapefile column holding a unique value
+ value: "value" } ], // Must be set to "value"
+
+ 2: [ { type: "District",
+ name: "NAME",
+ geocode: "NAME",
+ value: "value", // Must be set to "value"
+ parent1: "ADM1_NAME" } ], // Shapefile column holding the name of the parent orgunit (1 level above)
+
+ 3: [ { type: "Chiefdom",
+ name: "CHIEFDOM",
+ geocode: "CHIEFDOM",
+ value: "value", // Must be set to "value"
+ parent1: "DISTRICT", // Shapefile column holding the name of the parent orgunit (1 level above)
+ parent2: "PROVINCE" } ], // (2 levels above)
+
+ 4: [ { type: "Org. unit",
+ name: "name",
+ geocode: "ID",
+ value: "value", // Must be set to "value"
+ parent1: "CHIEFDOM", // Shapefile column holding the name of the parent orgunit (1 level above)
+ parent2: "DISTRICT", // (2 levels above)
+ parent3: "PROVINCE" } ] // (3 levels above)
+};
pointLayer = 4; // the shpcols point layer number
@@ -20,9 +47,9 @@
propSymbolLayerName = "Proportional Symbol";
-// TOMCAT PORT
-localhost_port = 8180;
-
-
// LAYOUT
-gridpanel_width = 180;
\ No newline at end of file
+west_width = 270; // viewport west
+south_height = 100; // viewport south
+
+gridpanel_width = 255;
+combo_width = 150;
\ No newline at end of file
=== modified file 'gis/dhis-gis-geostat/demos/geostat/index.html'
--- gis/dhis-gis-geostat/demos/geostat/index.html 2009-03-14 10:21:55 +0000
+++ gis/dhis-gis-geostat/demos/geostat/index.html 2009-03-16 06:59:29 +0000
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>Geostat demo</title>
+ <title>DHIS2 Geostat</title>
<link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css"/>
<!-- <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/xtheme-gray.css" /> -->
@@ -231,7 +231,7 @@
contentEl: 'south',
id: 'south-panel',
split: true,
- height: 100,
+ height: south_height,
minSize: 100,
maxSize: 100,
collapsible: true,
@@ -274,7 +274,7 @@
title: '',
split: true,
collapsible: true,
- width: 250,
+ width: west_width,
minSize: 175,
maxSize: 500,
margins: '0 0 0 5',
@@ -338,25 +338,27 @@
style = '<p style="margin-top: 5px; padding-left:5px;">';
+ space = ' ';
+
if (choropleth.selectedLevel == 1) {
- var html = style + '<b>' + shpcols[choropleth.selectedLevel][0].type + ': </b>' + feature.attributes[shpcols[choropleth.selectedLevel][0].name] + '</p>';
+ var html = style + '<b>' + shpcols[choropleth.selectedLevel][0].type + ':</b>' + space + feature.attributes[shpcols[choropleth.selectedLevel][0].name] + '</p>';
html += '<br>';
- html += style + '<b>Value: </b>' + feature.attributes[shpcols[choropleth.selectedLevel][0].value] + '</p>';
+ html += style + '<b>Value:</b>' + space + feature.attributes[shpcols[choropleth.selectedLevel][0].value] + '</p>';
}
if (choropleth.selectedLevel == 2) {
- var html = style + '<b>' + shpcols[choropleth.selectedLevel-1][0].type + ': </b>' + feature.attributes[shpcols[choropleth.selectedLevel][0].parent1] + '</p>';
- html += style + '<b>' + shpcols[choropleth.selectedLevel][0].type + ': </b>' + feature.attributes[shpcols[choropleth.selectedLevel][0].name] + '</p>';
+ var html = style + '<b>' + shpcols[choropleth.selectedLevel][0].type + ':</b>' + space + feature.attributes[shpcols[choropleth.selectedLevel][0].name] + '</p>';
+ html += style + '<b>' + shpcols[choropleth.selectedLevel-1][0].type + ':</b>' + space + feature.attributes[shpcols[choropleth.selectedLevel][0].parent1] + '</p>';
html += '<br>';
- html += style + '<b>Value: </b>' + feature.attributes[shpcols[choropleth.selectedLevel][0].value] + '</p>';
+ html += style + '<b>Value:</b>' + space + feature.attributes[shpcols[choropleth.selectedLevel][0].value] + '</p>';
}
if (choropleth.selectedLevel == 3) {
- var html = style + '<b>' + shpcols[choropleth.selectedLevel-2][0].type + ': </b>' + feature.attributes[shpcols[choropleth.selectedLevel][0].parent2] + '</p>';
- html += style + '<b>' + shpcols[choropleth.selectedLevel-1][0].type + ': </b>' + feature.attributes[shpcols[choropleth.selectedLevel][0].parent1] + '</p>';
- html += style + '<b>' + shpcols[choropleth.selectedLevel][0].type + ': </b>' + feature.attributes[shpcols[choropleth.selectedLevel][0].name] + '</p>';
+ var html = style + '<b>' + shpcols[choropleth.selectedLevel][0].type + ':</b>' + space + feature.attributes[shpcols[choropleth.selectedLevel][0].name] + '</p>';
+ html += style + '<b>' + shpcols[choropleth.selectedLevel-1][0].type + ':</b>' + space + feature.attributes[shpcols[choropleth.selectedLevel][0].parent1] + '</p>';
+ html += style + '<b>' + shpcols[choropleth.selectedLevel-2][0].type + ':</b>' + space + feature.attributes[shpcols[choropleth.selectedLevel][0].parent2] + '</p>';
html += '<br>';
- html += style + '<b>Value: </b>' + feature.attributes[shpcols[choropleth.selectedLevel][0].value] + '</p>';
+ html += style + '<b>Value:</b>' + space + feature.attributes[shpcols[choropleth.selectedLevel][0].value] + '</p>';
}
popup_feature.html = html;
@@ -496,6 +498,8 @@
var indicatorId = Ext.getCmp('indicator_cb').getValue();
var periodId = Ext.getCmp('period_cb').getValue();
var level = Ext.getCmp('level_cb').getValue();
+
+alert(indicatorId + "\n" + periodId + "\n" + level);
if (choropleth.isDrillDown) {
level = choropleth.selectedLevel + 1;
@@ -585,7 +589,7 @@
for ( var i=0; i < dataLength; i++ )
{
- if (features[j].attributes[shpcols[level][0].geocode] == data.mapvalues[i].orgUnit)
+ if (features[j].attributes[shpcols[level][0].geocode] == data.mapvalues[i].geoCode)
{
features[j].attributes["value"] = data.mapvalues[i].value;
}
=== modified file 'gis/dhis-gis-geostat/mfbase/mapfish/widgets/geostat/Choropleth.js'
--- gis/dhis-gis-geostat/mfbase/mapfish/widgets/geostat/Choropleth.js 2009-03-14 10:21:55 +0000
+++ gis/dhis-gis-geostat/mfbase/mapfish/widgets/geostat/Choropleth.js 2009-03-16 06:59:29 +0000
@@ -159,7 +159,7 @@
});
indicatorStore = new Ext.data.JsonStore({
- url: 'http://localhost:' + localhost_port + '/dhis-webservice/getAllIndicators.service?format=jsonmin',
+ url: 'http://localhost:' + localhost_port + '/dhis-webservice/getIndicatorsByIndicatorGroup.service',
root: 'indicators',
fields: ['id', 'name'],
autoLoad: false
@@ -233,6 +233,7 @@
triggerAction: 'all',
emptyText: 'Select group',
selectOnFocus: true,
+ width: combo_width,
store: indicatorGroupStore,
listeners: {
'select': {
@@ -261,6 +262,7 @@
triggerAction: 'all',
emptyText: 'Select indicator',
selectOnFocus: true,
+ width: combo_width,
store: indicatorStore
},
{
@@ -276,6 +278,7 @@
triggerAction: 'all',
emptyText: 'Select period type',
selectOnFocus: true,
+ width: combo_width,
store: periodTypeStore,
listeners: {
'select': {
@@ -303,6 +306,7 @@
triggerAction: 'all',
emptyText: 'Select period',
selectOnFocus: true,
+ width: combo_width,
store: periodStore
},
@@ -319,13 +323,14 @@
triggerAction: 'all',
emptyText: 'Select level',
selectOnFocus: true,
+ width: combo_width,
store: levelStore,
listeners: {
'select': {
fn: function() {
- alert(shapefiles[this.form.findField('level_cb').getValue()]);
- this.selectedLevel = this.form.findField('level_cb').getValue();
- this.newUrl = shapefiles[this.form.findField('level_cb').getValue()];
+ var level = this.form.findField('level_cb').getValue();
+ this.selectedLevel = level;
+ this.newUrl = shapefiles[level];
this.classify(false);
},
scope: this
@@ -366,6 +371,7 @@
mode: 'local',
value: 5,
triggerAction: 'all',
+ width: combo_width,
store: new Ext.data.SimpleStore({
fields: ['value'],
data: [[0], [1], [2], [3], [4], [5], [6], [7], [8], [9]]
@@ -386,6 +392,7 @@
triggerAction: 'all',
emptyText: 'Select legend',
selectOnFocus: true,
+ width: combo_width,
store: legendStore,
listeners: {
'select': {
@@ -428,6 +435,7 @@
id: 'colorA_cf',
width: 100,
allowBlank: false,
+ width: combo_width,
value: "#FFFF00"
},{
xtype: 'colorfield',
@@ -436,6 +444,7 @@
id: 'colorB_cf',
width: 100,
allowBlank: false,
+ width: combo_width,
value: "#FF0000"
},{
xtype: 'button',
@@ -462,6 +471,7 @@
triggerAction: 'all',
emptyText: 'Select level',
selectOnFocus: true,
+ width: combo_width,
store: levelStore,
listeners: {
'select': {
@@ -500,6 +510,7 @@
{ id: 'name', dataIndex: 'name', sortable: true, width: gridpanel_width-2 }
],
autoHeight: true,
+ autoScroll: true,
width: gridpanel_width
}
--
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.