dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #21706
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10352: (GIS) Background layer zoom bug fixed.
Merge authors:
Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 10352 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-03-20 14:10:31 +0100
message:
(GIS) Background layer zoom bug fixed.
modified:
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/plugin.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/webapp/dhis-web-mapping/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js 2013-03-19 17:53:03 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js 2013-03-20 13:09:12 +0000
@@ -572,6 +572,10 @@
updateItem: function(value) {
this.numberField.setDisabled(!value);
this.layer.setVisibility(value);
+
+ if (value && this.layer.layerType === gis.conf.finals.layer.type_base) {
+ gis.olmap.setBaseLayer(this.layer);
+ }
},
initComponent: function() {
var that = this,
@@ -583,13 +587,12 @@
listeners: {
change: function(chb, value) {
if (value && that.layer.layerType === gis.conf.finals.layer.type_base) {
- var layers = gis.util.map.getLayersByType(gis.conf.finals.layer.type_base),
- layer;
+ var layers = gis.util.map.getLayersByType(gis.conf.finals.layer.type_base);
+
for (var i = 0; i < layers.length; i++) {
- layer = layers[i];
- if (layer !== that.layer) {
- layer.item.checkbox.suppressChange = true;
- layer.item.disableItem();
+ if (layers[i] !== that.layer) {
+ layers[i].item.checkbox.suppressChange = true;
+ layers[i].item.disableItem();
}
}
}
@@ -4970,10 +4973,10 @@
afterRender = function() {
// Map tools
- document.getElementsByClassName('zoomInButton')[0].innerHTML = '<img src="images/zoomin_24.png" />';
- document.getElementsByClassName('zoomOutButton')[0].innerHTML = '<img src="images/zoomout_24.png" />';
- document.getElementsByClassName('zoomVisibleButton')[0].innerHTML = '<img src="images/zoomvisible_24.png" />';
- document.getElementsByClassName('measureButton')[0].innerHTML = '<img src="images/measure_24.png" />';
+ Ext.query('.zoomInButton')[0].innerHTML = '<img src="images/zoomin_24.png" />';
+ Ext.query('.zoomOutButton')[0].innerHTML = '<img src="images/zoomout_24.png" />';
+ Ext.query('.zoomVisibleButton')[0].innerHTML = '<img src="images/zoomvisible_24.png" />';
+ Ext.query('.measureButton')[0].innerHTML = '<img src="images/measure_24.png" />';
gis.olmap.events.register('click', null, function(e) {
if (gis.olmap.relocate.active) {
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js 2013-03-19 17:15:21 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js 2013-03-20 13:09:12 +0000
@@ -209,6 +209,7 @@
displayClass: 'olControlButton',
trigger: function() {
fn.call(gis.olmap);
+ gis.layer.googleHybrid.redraw();
}
});
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/plugin.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/plugin.js 2013-01-11 15:10:11 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/plugin.js 2013-03-20 13:09:12 +0000
@@ -94,13 +94,13 @@
gis.layer.googleStreets.setVisibility(true);
}
- var len = document.getElementsByClassName('zoomInButton').length;
+ var len = Ext.query('.zoomInButton').length;
for (var i = 0; i < len; i++) {
- document.getElementsByClassName('zoomInButton')[i].innerHTML = '<img src="images/zoomin_24.png" />';
- document.getElementsByClassName('zoomOutButton')[i].innerHTML = '<img src="images/zoomout_24.png" />';
- document.getElementsByClassName('zoomVisibleButton')[i].innerHTML = '<img src="images/zoomvisible_24.png" />';
- document.getElementsByClassName('measureButton')[i].innerHTML = '<img src="images/measure_24.png" />';
+ Ext.query('.zoomInButton')[i].innerHTML = '<img src="images/zoomin_24.png" />';
+ Ext.query('.zoomOutButton')[i].innerHTML = '<img src="images/zoomout_24.png" />';
+ Ext.query('.zoomVisibleButton')[i].innerHTML = '<img src="images/zoomvisible_24.png" />';
+ Ext.query('.measureButton')[i].innerHTML = '<img src="images/measure_24.png" />';
}
};