------------------------------------------------------------ revno: 293 committer: Jan Henrik Overland janhenrik.overl...@gmail.com branch nick: trunk timestamp: Fri 2009-05-15 13:55:18 +0200 message: Major map loading functionality upgrade. modified: gis/dhis-web-mapping/src/main/webapp/demos/geostat/geostat.js gis/dhis-web-mapping/src/main/webapp/mfbase/mapfish/widgets/geostat/Choropleth.js gis/dhis-web-mapping/src/main/webapp/mfbase/mapfish/widgets/geostat/Mapping.js
=== modified file 'gis/dhis-web-mapping/src/main/webapp/demos/geostat/geostat.js' --- gis/dhis-web-mapping/src/main/webapp/demos/geostat/geostat.js 2009-04-28 14:23:39 +0000 +++ gis/dhis-web-mapping/src/main/webapp/demos/geostat/geostat.js 2009-05-15 11:55:18 +0000 @@ -1117,6 +1117,7 @@ Ext.get('loading').fadeOut({remove: true}); }); + function onHoverSelectChoropleth(feature) { var center_panel = Ext.getCmp('center'); @@ -1148,7 +1149,7 @@ pe = '</p>'; var html = style + feature.attributes[mapData.nameColumn] + pe; - html += style + bs + 'Value:' + be + space + feature.attributes['value'] + pe; + html += style + bs + 'Value:' + be + space + feature.attributes.value + pe; popup_feature.html = html; popup_feature.show(); @@ -1156,7 +1157,7 @@ function onHoverUnselectChoropleth(feature) { - var infoPanel = Ext.getCmp('south-panel'); +// var infoPanel = Ext.getCmp('south-panel'); popup_feature.hide(); } @@ -1190,6 +1191,7 @@ var south_panel = Ext.getCmp('south-panel'); south_panel.body.dom.innerHTML = organisationUnit + '<font color="#444444"> assigned to </font>' + name + "!"; + Ext.getCmp('grid_gp').getStore().reload(); loadMapData('assignment'); }, failure: function() @@ -1206,44 +1208,7 @@ function onHoverSelectPoint(feature) { -/* - var center_panel = Ext.getCmp('center'); - var south_panel = Ext.getCmp('south-panel'); - - var height = 230; - var padding_x = 15; - var padding_y = 22; - - var x = center_panel.x + padding_x; - var y = south_panel.y - height - padding_y; - - popup_orgunit = new Ext.Window( - { - title: 'Organisation unit', - width: 190, - height: height, - layout: 'fit', - plain: true, - bodyStyle: 'padding:5px', - x: x, - y: y - }); - - style = '<p style="margin-top: 5px; padding-left:5px;">'; - - var html = style + '<b>' + shpcols[1][0].type + ': </b>' + feature.attributes[shpcols[pointLayer][0].parent1] + '</p>'; - html += style + '<b>' + shpcols[2][0].type + ': </b>' + feature.attributes[shpcols[pointLayer][0].parent2] + '</p>'; - html += style + '<b>' + shpcols[3][0].type + ': </b>' + feature.attributes[shpcols[pointLayer][0].parent3] + '</p>'; - html += style + '<b>' + shpcols[4][0].type + ': </b>' + feature.attributes[shpcols[pointLayer][0].name] + '</p>'; - html += '<br>'; - html += style + '<b>Value: </b>' + feature.attributes[shpcols[pointLayer][0].value] + '</p>'; - - popup_orgunit.html = html; - popup_orgunit.show(); - - var infoPanel_orgunit = Ext.getCmp('south-panel'); - infoPanel_orgunit.body.dom.innerHTML = 'More information about the selected organisation unit may be listed here.'; -*/ + } function onHoverUnselectPoint(feature) @@ -1408,6 +1373,21 @@ } features_choropleth = features; + + var options = {}; + + // hidden + choropleth.indicator = 'value'; + choropleth.indicatorText = 'Indicator'; + options.indicator = choropleth.indicator; + + options.method = 1; + options.numClasses = Ext.getCmp('numClasses').getValue(); + options.colors = choropleth.getColors(); + + choropleth.coreComp.updateOptions(options); + choropleth.coreComp.applyClassification(); + choropleth.classificationApplied = true; }, failure: function() { @@ -1463,4 +1443,24 @@ } features_mapping = features; + + var options = {}; + + // hidden + mapping.indicator = 'value'; + mapping.indicatorText = 'Indicator'; + options.indicator = mapping.indicator; + + options.method = 1; + options.numClasses = 2; + + var colorA = new mapfish.ColorRgb(); + colorA.setFromHex('#FFFFFF'); + var colorB = new mapfish.ColorRgb(); + colorB.setFromHex('#72FF63'); + options.colors = [colorA, colorB]; + + mapping.coreComp.updateOptions(options); + mapping.coreComp.applyClassification(); + mapping.classificationApplied = true; } \ No newline at end of file === modified file 'gis/dhis-web-mapping/src/main/webapp/mfbase/mapfish/widgets/geostat/Choropleth.js' --- gis/dhis-web-mapping/src/main/webapp/mfbase/mapfish/widgets/geostat/Choropleth.js 2009-04-28 14:23:39 +0000 +++ gis/dhis-web-mapping/src/main/webapp/mfbase/mapfish/widgets/geostat/Choropleth.js 2009-05-15 11:55:18 +0000 @@ -405,7 +405,6 @@ xtype: 'colorfield', fieldLabel: 'Color', id: 'colorA_cf', - width: 100, allowBlank: false, width: combo_width, value: "#FFFF00" @@ -415,15 +414,16 @@ xtype: 'colorfield', fieldLabel: 'Color', id: 'colorB_cf', - width: 100, allowBlank: false, width: combo_width, value: "#FF0000" }, + { html: '<br>' }, + { xtype: 'button', - text: 'Load map', + text: 'Refresh map', handler: function() { this.layer.setVisibility(true); @@ -513,21 +513,6 @@ } loadMapData('choropleth'); - - var options = {}; - - // hidden - this.indicator = 'value'; - this.indicatorText = 'Indicator'; - options.indicator = this.indicator; - - options.method = 1; - options.numClasses = Ext.getCmp('numClasses').getValue(); - options.colors = this.getColors(); - - this.coreComp.updateOptions(options); - this.coreComp.applyClassification(); - this.classificationApplied = true; }, /** === modified file 'gis/dhis-web-mapping/src/main/webapp/mfbase/mapfish/widgets/geostat/Mapping.js' --- gis/dhis-web-mapping/src/main/webapp/mfbase/mapfish/widgets/geostat/Mapping.js 2009-04-28 14:23:39 +0000 +++ gis/dhis-web-mapping/src/main/webapp/mfbase/mapfish/widgets/geostat/Mapping.js 2009-05-15 11:55:18 +0000 @@ -209,20 +209,6 @@ } }, - { - xtype: 'button', - text: 'Load map', - handler: function() - { - var mlp = Ext.getCmp('maps_cb').getValue(); - Ext.getCmp('grid_gp').getStore().baseParams = { mapLayerPath: mlp, format: 'json' }; - Ext.getCmp('grid_gp').getStore().reload(); - - this.classify(true); - }, - scope: this - }, - { html: '<br>' }, { @@ -236,13 +222,13 @@ style: 'left:0px', bbar: new Ext.StatusBar({ defaultText: '', - id: 'basic-statusbar', + id: 'relations_sb', items: [ { xtype: 'button', - id: 'removerelation_b0', - text: 'Remove relation', + id: 'removerelation_b', + text: 'Remove', isVisible: false, handler: function() { @@ -267,6 +253,8 @@ var mlp = Ext.getCmp('maps_cb').getValue(); Ext.getCmp('grid_gp').getStore().baseParams = { mapLayerPath: mlp, format: 'json' }; Ext.getCmp('grid_gp').getStore().reload(); + + mapping.classify(true); }, failure: function() { @@ -280,7 +268,7 @@ { xtype: 'button', id: 'removeallrelations_b', - text: 'Remove all relations', + text: 'Remove all', isVisible: false, handler: function() { @@ -297,6 +285,8 @@ var mlp = Ext.getCmp('maps_cb').getValue(); Ext.getCmp('grid_gp').getStore().baseParams = { mapLayerPath: mlp, format: 'json' }; Ext.getCmp('grid_gp').getStore().reload(); + + mapping.classify(true); }, failure: function() { @@ -387,27 +377,7 @@ return; } - loadMapData('assignment', url); - - var options = {}; - - // hidden - this.indicator = 'value'; - this.indicatorText = 'Indicator'; - options.indicator = this.indicator; - - options.method = 1; - options.numClasses = 2; - - var colorA = new mapfish.ColorRgb(); - colorA.setFromHex('#FFFFFF'); - var colorB = new mapfish.ColorRgb(); - colorB.setFromHex('#72FF63'); - options.colors = [colorA, colorB]; - - this.coreComp.updateOptions(options); - this.coreComp.applyClassification(); - this.classificationApplied = true; + loadMapData('assignment'); }, /** -- Trunk 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. _______________________________________________ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp