← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13355: (GIS) Event layer mouse handlers updated.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 13355 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-12-20 16:40:53 +0100
message:
  (GIS) Event layer mouse handlers updated.
modified:
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.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/core.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js	2013-12-20 14:43:05 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js	2013-12-20 15:40:10 +0000
@@ -177,7 +177,7 @@
 
 	GIS.core.createSelectHandlers = function(gis, layer) {
 		var isRelocate = !!GIS.app ? (gis.init.user.isAdmin ? true : false) : false,
-
+			options = {},
 			window,
 			infrastructuralPeriod,
 			onHoverSelect,
@@ -524,11 +524,14 @@
 			menu.showAt([gis.olmap.mouseMove.x, gis.olmap.mouseMove.y]);
 		};
 
-		selectHandlers = new OpenLayers.Control.newSelectFeature(layer, {
-			onHoverSelect: onHoverSelect,
-			onHoverUnselect: onHoverUnselect,
-			onClickSelect: onClickSelect
-		});
+		options.onHoverSelect = onHoverSelect;
+		options.onHoverUnselect = onHoverUnselect;
+console.log(layer);
+		if (layer.id !== 'event') {
+			options.onClickSelect = onClickSelect;
+		}
+
+		selectHandlers = new OpenLayers.Control.newSelectFeature(layer, options);
 
 		gis.olmap.addControl(selectHandlers);
 		selectHandlers.activate();
@@ -916,6 +919,7 @@
                         }
 
                         obj[gis.conf.finals.widget.value] = 0;
+                        obj['label'] = obj.ouname;
 
                         events.push(obj);
                     }