diff geotemco/js/Map/MapWidget.js @ 8:8f05c2a84bba

Apply new platin and Add tree layers
author nylin@mpiwg-berlin.mpg.de
date Wed, 07 Oct 2015 11:09:20 +0200
parents 57bde4830927
children
line wrap: on
line diff
--- a/geotemco/js/Map/MapWidget.js	Fri Sep 04 16:16:10 2015 +0200
+++ b/geotemco/js/Map/MapWidget.js	Wed Oct 07 11:09:20 2015 +0200
@@ -1090,6 +1090,18 @@
 	 * updates the the object layer of the map after selections had been executed in timeplot or table or zoom level has changed
 	 */
 	highlightChanged : function(mapObjects) {
+		var hideEmptyCircles = false;
+
+		if (this.config.options.hideUnselected){
+			var overallCnt = 0;
+			for (var i in mapObjects){
+				overallCnt += mapObjects[i].length;
+			}
+			if (overallCnt > 0){
+				hideEmptyCircles = true;
+			}
+		}
+		
 		if( !GeoTemConfig.highlightEvents ){
 			return;
 		}
@@ -1103,10 +1115,19 @@
 		var polygon = this.openlayersMap.getExtent().toGeometry();
 		for (var i in points ) {
 			for (var j in points[i] ) {
+				var point = points[i][j];
+				
+				if (hideEmptyCircles){
+					point.feature.style.display = 'none';
+				} else {
+					point.feature.style.display = '';
+				} 
+					
 				this.updatePoint(points[i][j], polygon);
 			}
 		}
 		this.displayConnections();
+		this.objectLayer.redraw();
 	},
 
 	selectionChanged : function(selection) {