=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/labels.png' Binary files dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/labels.png 2010-09-14 14:08:09 +0000 and dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/labels.png 2011-04-06 11:44:07 +0000 differ === added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/search2.png' Binary files dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/search2.png 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/search2.png 2011-04-06 11:44:07 +0000 differ === added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/transparency2.png' Binary files dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/transparency2.png 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/transparency2.png 2011-04-06 11:44:07 +0000 differ === 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 2011-03-07 20:53:01 +0000 +++ dhis-2/dhis-web/dhis-web-mapping/src/main/resources/org/hisp/dhis/mapping/i18n_module.properties 2011-04-06 11:44:07 +0000 @@ -18,6 +18,9 @@ cancelled = cancelled apply = Apply applied = applied +show = Show +hide = Hide +toggle = Toggle boundary = Boundary level = Level === 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 2011-03-07 20:53:01 +0000 +++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/i18n.vm 2011-04-06 11:44:07 +0000 @@ -21,6 +21,9 @@ cancelled: '$encoder.jsEscape($i18n.getString( 'cancelled' ) , "'")', apply: '$encoder.jsEscape($i18n.getString( 'apply' ) , "'")', applied: '$encoder.jsEscape($i18n.getString( 'applied' ) , "'")', + show: '$encoder.jsEscape($i18n.getString( 'show' ) , "'")', + hide: '$encoder.jsEscape($i18n.getString( 'hide' ) , "'")', + toggle: '$encoder.jsEscape($i18n.getString( 'toggle' ) , "'")', boundary: '$encoder.jsEscape($i18n.getString( 'boundary' ) , "'")', level: '$encoder.jsEscape($i18n.getString( 'level' ) , "'")', === modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/css/style.css' --- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/css/style.css 2011-03-30 12:12:38 +0000 +++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/css/style.css 2011-04-06 11:44:07 +0000 @@ -112,10 +112,10 @@ font:10px lucida sans unicode,ubuntu,arial; } .menu-layeroptions-locate { - background-image:url('../../../images/magnifier.png'); + background:url('../../../images/search2.png') center bottom; } .menu-layeroptions-opacity { - background-image:url('../../../images/transparency.png'); + background-image:url('../../../images/transparency2.png'); } .menu-layeroptions-labels { background-image:url('../../../images/labels.png'); @@ -126,53 +126,58 @@ .no-icon-menu .x-menu-item-icon { display: none; } +.x-menu-item-icon { + width:14px; + height:14px; + top:4px; +} .menu-layeroptions-opacity-10 { - background-image:url('../../../images/transparency.png'); + background-image:url('../../../images/transparency2.png'); opacity:0.1; filter:alpha(opacity=10); } .menu-layeroptions-opacity-20 { - background-image:url('../../../images/transparency.png'); + background-image:url('../../../images/transparency2.png'); opacity:0.2; filter:alpha(opacity=20); } .menu-layeroptions-opacity-30 { - background-image:url('../../../images/transparency.png'); + background-image:url('../../../images/transparency2.png'); opacity:0.3; filter:alpha(opacity=30); } .menu-layeroptions-opacity-40 { - background-image:url('../../../images/transparency.png'); + background-image:url('../../../images/transparency2.png'); opacity:0.4; filter:alpha(opacity=40); } .menu-layeroptions-opacity-50 { - background-image:url('../../../images/transparency.png'); + background-image:url('../../../images/transparency2.png'); opacity:0.5; filter:alpha(opacity=50); } .menu-layeroptions-opacity-60 { - background-image:url('../../../images/transparency.png'); + background-image:url('../../../images/transparency2.png'); opacity:0.6; filter:alpha(opacity=60); } .menu-layeroptions-opacity-70 { - background-image:url('../../../images/transparency.png'); + background-image:url('../../../images/transparency2.png'); opacity:0.7; filter:alpha(opacity=70); } .menu-layeroptions-opacity-80 { - background-image:url('../../../images/transparency.png'); + background-image:url('../../../images/transparency2.png'); opacity:0.8; filter:alpha(opacity=80); } .menu-layeroptions-opacity-90 { - background-image:url('../../../images/transparency.png'); + background-image:url('../../../images/transparency2.png'); opacity:0.9; filter:alpha(opacity=90); } .menu-layeroptions-opacity-100 { - background-image:url('../../../images/transparency.png'); + background-image:url('../../../images/transparency2.png'); opacity:1.0; filter:alpha(opacity=100); } @@ -230,8 +235,8 @@ .x-btn .icon-assign { background-image:url('../../../images/accept.png'); } -.x-btn .icon-export { - background-image:url('../../../images/export2.png'); +.x-btn .icon-labels { + background-image:url('../../../images/labels.png'); } .aa_med button { color:#333; @@ -341,6 +346,18 @@ font:bold 11px arial; color:#111; } +#window-labels-title { + padding:0 0 3px 21px; + background:url('../../../images/labels.png') no-repeat 0 0 transparent; + font:bold 11px arial; + color:#111; +} +#window-locate-title { + padding:0 0 3px 21px; + background:url('../../../images/search2.png') no-repeat 0 0 transparent; + font:bold 11px arial; + color:#111; +} /* Ext Panel */ .panel-title { === modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/global.js' --- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/global.js 2011-03-29 09:15:25 +0000 +++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/global.js 2011-04-06 11:44:07 +0000 @@ -160,7 +160,7 @@ }, labels: { - getActivatedOpenLayersStyleMap: function() { + getActivatedOpenLayersStyleMap: function(fsize, fweight, fstyle) { return new OpenLayers.StyleMap({ 'default' : new OpenLayers.Style( OpenLayers.Util.applyDefaults({ @@ -169,8 +169,9 @@ 'strokeWidth': 1, 'label': '${labelString}', 'fontFamily': 'arial,lucida sans unicode', - 'fontWeight': 'normal', - 'fontSize': 13 + 'fontSize': fsize ? fsize : 13, + 'fontWeight': fweight ? 'bold' : 'normal', + 'fontStyle': fstyle ? 'italic' : 'normal' }, OpenLayers.Feature.Vector.style['default']) ), @@ -198,9 +199,9 @@ }) }); }, - toggleFeatureLabels: function(widget) { + toggleFeatureLabels: function(widget, fsize, fweight, fstyle) { function activateLabels() { - widget.layer.styleMap = this.getActivatedOpenLayersStyleMap(); + widget.layer.styleMap = this.getActivatedOpenLayersStyleMap(fsize, fweight, fstyle); widget.labels = true; } function deactivateLabels(scope) { === 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-03-30 12:12:38 +0000 +++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/index.js 2011-04-06 12:01:31 +0000 @@ -488,7 +488,7 @@ if (params.featureType == G.conf.map_feature_type_multipolygon) { G.stores.polygonMapView.load(); } - else if (params.featureType == G.conf.map_feature_type_multipolygon) { + else if (params.featureType == G.conf.map_feature_type_point) { G.stores.pointMapView.load(); } Ext.getCmp('favoritename_tf').reset(); @@ -2021,7 +2021,7 @@ var locateFeatureWindow = new Ext.Window({ id: 'locatefeature_w', - title: 'Locate features', + title: 'Locate features', layout: 'fit', width: G.conf.window_width, height: G.util.getMultiSelectHeight() + 140, @@ -2122,31 +2122,123 @@ Ext.message.msg(false, '' + layer.name + ': No features rendered'); } }, + + showLabelWindow: function(item) { + if (item.labelWindow) { + item.labelWindow.show(); + } + else { + var labelWindow = new Ext.Window({ + title: 'Labels', + layout: 'fit', + closeAction: 'hide', + width: G.conf.window_width, + height: 170, + items: [ + { + xtype: 'form', + bodyStyle: 'padding:8px', + labelWidth: G.conf.label_width, + items: [ + {html: '
Show/hide feature labels
'}, + { + xtype: 'numberfield', + id: 'labelfontsize_nf', + fieldLabel: 'Font size', + labelSeparator: G.conf.labelseparator, + width: G.conf.combo_number_width_small, + enableKeyEvents: true, + allowDecimals: false, + allowNegative: false, + value: 13, + emptyText: 13, + listeners: { + 'keyup': function(nf) { + var layer = G.vars.map.getLayersByName(item.parentMenu.contextNode.attributes.layer)[0]; + if (layer.widget.labels) { + layer.widget.labels = false; + G.util.labels.toggleFeatureLabels(layer.widget, nf.getValue(), + Ext.getCmp('labelstrong_chb').getValue(), Ext.getCmp('labelitalic_chb').getValue()); + } + } + } + }, + { + xtype: 'checkbox', + id: 'labelstrong_chb', + fieldLabel: 'Bold', + labelSeparator: G.conf.labelseparator, + listeners: { + 'check': function(chb, checked) { + var layer = G.vars.map.getLayersByName(item.parentMenu.contextNode.attributes.layer)[0]; + if (layer.widget.labels) { + layer.widget.labels = false; + G.util.labels.toggleFeatureLabels(layer.widget, Ext.getCmp('labelfontsize_nf').getValue(), + checked, Ext.getCmp('labelitalic_chb').getValue()); + } + } + } + }, + { + xtype: 'checkbox', + id: 'labelitalic_chb', + fieldLabel: 'Italic', + labelSeparator: G.conf.labelseparator, + listeners: { + 'check': function(chb, checked) { + var layer = G.vars.map.getLayersByName(item.parentMenu.contextNode.attributes.layer)[0]; + if (layer.widget.labels) { + layer.widget.labels = false; + G.util.labels.toggleFeatureLabels(layer.widget, Ext.getCmp('labelfontsize_nf').getValue(), + Ext.getCmp('labelstrong_chb').getValue(), checked); + } + } + } + } + ] + } + ], + bbar: [ + '->', + { + xtype: 'button', + id: 'labelshow_b', + iconCls: 'icon-assign', + hideLabel: true, + text: G.i18n.toggle, + handler: function() { + var layer = G.vars.map.getLayersByName(item.parentMenu.contextNode.attributes.layer)[0]; + if (layer.features.length) { + G.util.labels.toggleFeatureLabels(layer.widget, Ext.getCmp('labelfontsize_nf').getValue(), + Ext.getCmp('labelstrong_chb').getValue(), Ext.getCmp('labelitalic_chb').getValue()); + } + else { + Ext.message.msg(false, '' + layer.name + ': No features rendered'); + } + } + } + ] + }); + + item.labelWindow = labelWindow; + item.labelWindow.setPagePosition(Ext.getCmp('east').x - (G.conf.window_width + 15 + 5), Ext.getCmp('center').y + 41); + item.labelWindow.show(); + } + }, items: [ { text: 'Locate feature', iconCls: 'menu-layeroptions-locate', - handler: function(item, e) { + handler: function(item) { item.parentMenu.showLocateFeatureWindow(item.parentMenu); } }, { - text: 'Show/hide labels', + text: 'Labels', iconCls: 'menu-layeroptions-labels', - handler: function(item, e) { - var layer = G.vars.map.getLayersByName(item.parentMenu.contextNode.attributes.layer)[0]; - - if (layer.features.length) { - if (layer.name == 'Polygon layer') { - G.util.labels.toggleFeatureLabels(layer.widget); - } - else if (layer.name == 'Point layer') { - G.util.labels.toggleFeatureLabels(layer.widget); - } - } - else { - Ext.message.msg(false, '' + layer.name + ': No features rendered'); - } + labelsWindow: null, + handler: function(item) { + item.parentMenu.showLabelWindow(item); } }, {