index_public.html 17.2 KB
Benjamin Herfort committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385
<!doctype html>
<html class="no-js" lang="">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="x-ua-compatible" content="ie=edge">
        <title>GIScience MapSwipe Analytics</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link href="http://www2.geog.uni-heidelberg.de/media/favicon.ico?v=2" rel="shortcut icon">
        <!-- Place favicon.ico in the root directory -->

        <link rel="stylesheet" href="css/normalize.css">
        <link rel="stylesheet" href="css/main.css">
        <script src="js/vendor/modernizr-2.8.3.min.js"></script>
		
		 <script src="js/jquery.min.js"></script>
		 <link rel="stylesheet" href="css/leaflet.css" />
		 <script src="js/leaflet.js"></script>
		 <script src="js/leaflet.ajax.js"></script>
		 <script src="js/leaflet-search.js"></script>
		 <script src="js/bing.min.js"></script>
		 <script src="js/L.TileLayer.BetterWMS.js"></script>
		
		<script src="js/bootstrap.min.js"></script>
		 <link href="css/bootstrap.min.css" rel="stylesheet">
		 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
		 
		<script>
		
		function searchTable() {
		  // Declare variables
		  var input, filter, table, tr, td, i;
		  input = document.getElementById("myInput");
		  filter = input.value.toUpperCase();
		  console.log(filter)
		  table = document.getElementById("myTable2");
		  tr = table.getElementsByTagName("tr");

		  // Loop through all table rows, and hide those who don't match the search query
		  for (i = 0; i < tr.length; i++) {
			td = tr[i].getElementsByTagName("td")[0];
			td2 = tr[i].getElementsByTagName("td")[1];
			td3 = tr[i].getElementsByTagName("td")[2];
			td4 = tr[i].getElementsByTagName("td")[3];
			td5 = tr[i].getElementsByTagName("td")[4];
			td6 = tr[i].getElementsByTagName("td")[5];
			if (td) {
			  if ((td.innerHTML.toUpperCase().indexOf(filter) > -1) || (td2.innerHTML.toUpperCase().indexOf(filter) > -1)|| (td3.innerHTML.toUpperCase().indexOf(filter) > -1)|| (td4.innerHTML.toUpperCase().indexOf(filter) > -1) || (td5.innerHTML.toUpperCase().indexOf(filter) > -1) || (td6.innerHTML.toUpperCase().indexOf(filter) > -1) )  {
				tr[i].style.display = "";
			  } else {
				tr[i].style.display = "none";
			  }
			}
		  }
		}

		function show_map(){
			// Crete the map
			console.log("map should be shown");
			
			map = L.map('leaflet_map', {
				center: [0, 0],
				zoom: 3,
				maxZoom: 18
			});
			
			map.on('zoomend', function () {
				if (map.getZoom() >= 7 && map.hasLayer(points_layer) ) {
					map.removeLayer(points_layer);
					}
				if (map.getZoom() >= 7 && map.hasLayer(polygon_layer)==false ) {
					map.addLayer(polygon_layer);
					}
				if (map.getZoom() < 7 && map.hasLayer(points_layer)==false ) {
					map.addLayer(points_layer);
					}
				if (map.getZoom() < 7 && map.hasLayer(polygon_layer)) {
					map.removeLayer(polygon_layer);
					}
			});
			
			
			// Bing Layer
			var bing_key = 'XXXX' // Insert your Bing-Key here!
			var bing = L.tileLayer.bing(bing_key)
			
			//map.addLayer(bing)
			
			//var osmUrl='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
			var osmUrl='http://korona.geog.uni-heidelberg.de/tiles/roads/x={x}&y={y}&z={z}';
			var osmAttrib='Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, tiles <a href="http://www.geog.uni-heidelberg.de/gis/index_en.html">GIScience Research Group @ Heidelberg University</a>';
			var osm = new L.TileLayer(osmUrl, {attribution: osmAttrib});

			map.addLayer(osm);
			

			url = 'data/projects.geojson'
			
			polygon_layer = new L.GeoJSON.AJAX(url, {
				style: function (feature) {
					if ((feature.properties.progress < 100) && (feature.properties.state == 3) ){
						return {weight: 0, fill: false}
						//return { color: 'grey', weight: 2, fillColor: 'grey' };
					}
					if ((feature.properties.progress < 100) && (feature.properties.state == 0) ){
						return { color: 'black', weight: 2, fillColor: 'yellow', fillOpacity: 0.7 }
					}
					else {
						return { color: 'white', weight: 2, fillColor: 'green', fillOpacity: 0.7 };
					  }
					},
				onEachFeature: function (feature, layer) {
					
					if ((feature.properties.progress < 100) && (feature.properties.state == 0)) {
						var featureState = 'active'
					} else if ((feature.properties.progress < 100) && (feature.properties.state == 3)){
						var featureState = 'paused'
					 }
					 else {
						var featureState = 'finished'
					}
					
					 popup_content = '<p><b>'+feature.properties.project_id+': '+feature.properties.name+'</b></p><img src="'+feature.properties.image+'" width="200px"><p>Status: '+featureState+'</br>Progress: '+feature.properties.progress+'%</br>Contributors: '+feature.properties.contributors+'</br>Data: <a href="http://mapswipe.geog.uni-heidelberg.de/download/'+feature.properties.project_id+'/">Download</a></br>Last Check: '+feature.properties.last_check+'</p>'
					 layer.bindPopup(popup_content);
				 }
			})

			var myStyle = {
				"color": "#ff7800",
				"weight": 5,
				"opacity": 0.65
			};
			
			
			var geojsonMarkerOptions_green = {
				radius:6,
				fillColor: "green",
				color: "#000",
				weight: 1,
				opacity: 1,
				fillOpacity: 0.8
			};
			
			var geojsonMarkerOptions_yellow_active = {
				radius:10,
				fillColor: "yellow",
				color: "#000",
				weight: 1,
				opacity: 1,
				fillOpacity: 0.8
			};
			
			var geojsonMarkerOptions_yellow_not_active = {
				radius:0,
				fillColor: "grey",
				color: "#000",
				weight: 0,
				opacity: 1,
				fillOpacity: 0.8
			};
			
			var featureNames = [];
			
			
			url = 'data/projects_points.geojson'
			points_layer = new L.GeoJSON.AJAX(url, {
				pointToLayer: function (feature, latlng) {
					if ((feature.properties.progress < 100) && (feature.properties.state == 0) ){
						return L.circleMarker(latlng, geojsonMarkerOptions_yellow_active)
					}
					if ((feature.properties.progress < 100) && (feature.properties.state == 3) ){
						return L.circleMarker(latlng, geojsonMarkerOptions_yellow_not_active)
						//return {}
					}
					else {
						return L.circleMarker(latlng, geojsonMarkerOptions_green)
					}		
				},
				onEachFeature: function (feature, layer) {
					 
					 var table = document.getElementById("myTable2")
					 var row = table.insertRow(1)
					 timestamp = feature.properties.last_check
					 
					  if ((feature.properties.progress < 100) && (feature.properties.state == 0)) {
						var featureState = 'active'
						 var featureId = feature.properties.project_id;
						 var featureName = feature.properties.name; 
						 var featureProgress = feature.properties.progress;
						 var featureContributors = feature.properties.contributors;
						 var featureObjects = feature.properties.look_for
						 
						 row_content = '<td>'+featureId+'</td><td>'+featureName+'</td><td>'+featureState+'</td><td>'+featureProgress+'</td><td>'+featureContributors+'</td><td>'+featureObjects+'</td><td><a href="http://mapswipe.geog.uni-heidelberg.de/download/'+featureId+'/">Download</a></td><td>'+timestamp+'</td>'
						 row.innerHTML = row_content
					 }
					 else if ((feature.properties.progress < 100) && (feature.properties.state == 3)){
						var featureState = 'paused'
					 }
					 else {
						var featureState = 'finished'
						var featureId = feature.properties.project_id;
						 var featureName = feature.properties.name; 
						 var featureProgress = feature.properties.progress;
						 var featureContributors = feature.properties.contributors;
						 var featureObjects = feature.properties.look_for
						 row_content = '<td>'+featureId+'</td><td>'+featureName+'</td><td>'+featureState+'</td><td>'+featureProgress+'</td><td>'+featureContributors+'</td><td>'+featureObjects+'</td><td><a href="http://mapswipe.geog.uni-heidelberg.de/download/'+featureId+'/">Download</a></td><td>'+timestamp+'</td>'
						 row.innerHTML = row_content
					 }
					 
					 
					 popup_content = '<p><b>'+featureId+': '+featureName+'</b></p><img src="'+feature.properties.image+'" width="200px"><p>Status: '+featureState+'</br>Progress: '+featureProgress+'%</br>Contributors: '+featureContributors+'</br>Data: <a href="http://mapswipe.geog.uni-heidelberg.de/download/'+featureId+'/">Download</a></br>Last Check: '+timestamp+'</p>'
					 layer.bindPopup(popup_content);
					 
				 }

			})
			

			
			
			//map.addLayer(polygon_layer)
			map.addLayer(points_layer)

			// Create and Add Layer Controls
			var baseLayers = {
				"Microsoft Bing": bing,
				"OpenStreetMap": osm
			};
			var overlays = {
				//"Settlements": Settlements
			};
			L.control.layers(baseLayers, overlays, {collapsed: false}).addTo(map);
			//
			
			map.addControl( new L.Control.Search({
				container: 'SearchField',
				layer: polygon_layer,
				propertyName: 'name',
				moveToLocation: function(latlng, title, map) {
					map.fitBounds( latlng.layer.getBounds() );
					//var zoom = map.getBoundsZoom(latlng.layer.getBounds());
					//map.setView(latlng, zoom); // access the zoom
				},
				initial: false,
				collapsed: false}) );
			
			map.removeLayer(polygon_layer)


			
		}
		
		</script>
		<style>
			#searchtext9{
				display: block;
				width: 100%;
				height: 46px;
			}
			.search-tooltip {
				width: 100%;
				min-width: 150px;
				background-color: 'white';
			}
			.leaflet-control-search .search-cancel {
				position: static;
				float: left;
				background: rgba(256, 256, 256, 0.6);
			}
			.leaflet-control-search {
				width: 100%;
				position: static;
				float: left;
				background: rgba(256, 256, 256, 0.6);
			}
		
		</style>
    </head>
    <body onload="show_map()">

		<div  id="header" style="width: 100%;display: block">
			
			
			<div class="col-md-6" style="padding-top: 10px; padding-bottom: 10px" >
			<a href="http://www.geog.uni-heidelberg.de/gis/index_en.html" target="blank"><img  src="img/logo_giscience_hd_web.png" height="70px"></a>
			<a href="http://mapswipe.org/" target="blank"><img src="img/mapswipe-logo.svg" height="70px"></a>
			<span style="font-size:25px">Analytics<sup>beta</sup></span>
			
			</div>
			
			<div class="col-md-3" style="padding-top: 22px; padding-bottom: 22px; height: 90px">
				<div id="SearchField" style="width: 90%; height: 46px; z-index: 1200"></div>
				<div id="TableSearchField" style="width: 90%; position: absolute; height: 46px; display: none">
					<input style="display: None;width: 100%; height: 46px;" type="text" id="myInput" onkeyup="searchTable()" placeholder="Search...">
				</div>
			</div>
			
			<div class="col-md-3" style="min-height: 90px;padding-top: 22px; padding-bottom: 22px">
			
			
			<button id="MapViewBtn" onclick="document.getElementById('ContactBtn').style.display = 'inline';document.getElementById('contact').style.display = 'none';document.getElementById('table_view').style.display = 'none';document.getElementById('leaflet_map').style.display = 'block';document.getElementById('TableViewBtn').style.display = 'inline';document.getElementById('myInput').style.display = 'none';document.getElementById('MapViewBtn').style.display = 'none';document.getElementById('SearchField').style.display = 'block';document.getElementById('TableSearchField').style.display = 'none'" class="btn btn-primary btn-lg" style="margin-right: 10px; width: 150px; display: None"><i class="fa fa-exchange" aria-hidden="true"></i> Map View</button>
			
			<button id="TableViewBtn" onclick="document.getElementById('ContactBtn').style.display = 'inline';document.getElementById('contact').style.display = 'none';document.getElementById('table_view').style.display = 'block';document.getElementById('leaflet_map').style.display = 'none';document.getElementById('myInput').style.display = 'block';document.getElementById('TableViewBtn').style.display = 'none';document.getElementById('MapViewBtn').style.display = 'inline';document.getElementById('SearchField').style.display = 'None';document.getElementById('TableSearchField').style.display = 'block'" class="btn btn-primary btn-lg" style="margin-right: 10px; width: 150px"><i class="fa fa-exchange" aria-hidden="true"></i> Table View</button>
			
			<button id="ContactBtn" href="#" onclick="document.getElementById('TableViewBtn').style.display = 'inline';document.getElementById('contact').style.display = 'block';document.getElementById('leaflet_map').style.display = 'none';document.getElementById('table_view').style.display = 'none';document.getElementById('MapViewBtn').style.display = 'inline';document.getElementById('SearchField').style.display = 'none';document.getElementById('myInput').style.display = 'none';document.getElementById('ContactBtn').style.display = 'none'" class="btn btn-primary btn-lg" style="margin-right: 10px; width: 150px">Info & Contact</button>
			</div>
			

		</div>
		
		<div class="col-md-12" id="table_view" style="display: None;padding: 25px;background: white; height: calc(100vH - 91px); overflow: scroll">
			<table id="myTable2" style="width: 100%" class="table table-striped table-hover">
			  <tr class="thead-inverse">
				<th onclick="sortTable(0)">ID</th>
				<th onclick="sortTable(1)">Name</th>
				<th onclick="sortTable(2)">Status</th>
				<th onclick="sortTable(3)">Progress</th>
				<th onclick="sortTable(3)">Contributors</th>
				<th onclick="sortTable(3)">Look for</th>
				<th>Download Data</th>
				<th>Last Check</th>
			  </tr>
			</table>
			<p> </p>
		</div>
		
		<div class="col-md-12" id="contact" style="display: None; padding: 25px; background: white; height: calc(100vH - 91px); overflow: scroll">
		<!-- <div class="col-md-12" style="padding: 25px; overflow:auto; background: rgba(255, 255, 255, 0.95); position: fixed; top: 5%; left: 2.5%; z-index: 9999; display: None; width: 95%" id="contact"> -->
			<h3>Info & Feedback</h3>
			<p>MapSwipe Analytics is a website that brings together everything related to MapSwipe projects. This includes a visualisation of the results (e.g. settlement layer), but also additional characteristics like agreement among volunteers, which is an important indicator for quality. Furthermore, you can monitor the progress of individual MapSwipe projects. Please note that <b>we are still in the beta mode</b>. We are working on improving the design as well as the analytical features. Your feedback is always welcome. <a href="https://gitlab.com/giscience/MapSwipe/MapSwipeAnalytics" target="blank">Just post an issue to our GitLab repository.</a></p>
			<p> </p>
			<p>We already got some prototypes with more detailed information on individual projects for you!
				<ul>
				<li><a href="/4743.html">MapSwipe Nigeria for MSF 2</a>
				<li><a href="/4877.html">MapSwipe Nigeria for MSF 3</a>
				</ul>
			<p> </p>
			<p><b>Looking for processed MapSwipe data?</b> Here you go! <a href="http://mapswipe.geog.uni-heidelberg.de/download/">MapSwipe Data Repository </a></p>
			<p> </p>
			<p>We also provide you with the tools (written in python) to process the data on your own. This gives you the possibility to download and process MapSwipe data at any time and as often as you like. As we are trying to improve the scripts step by step, have a look at the <a href="https://gitlab.com/giscience/MapSwipe/MapSwipeTools">GitLab repo</a> and always get the latest version.</p>
			
			<p>You can find more information related to MapSwipe at <a href="http://mapswipe.org/" target="blank">mapswipe.org</a> and the <a href="http://k1z.blog.uni-heidelberg.de/?s=MapSwipe" target="blank">GIScience News Blog</a>.
			<p> </p>
			
			<h3>Acknowledgements</h3>
			<p>This work has kindly been supported by the Klaus Tschira Foundation (KTS) Heidelberg in the context of establishing the Heidelberg Institute for Geoinformation Technology (HeiGIT).</p>
			
			<p> </p>

			<h3>Contact</h3>
			<img style="float: left;margin-right: 10px;" src="/img/logo_giscience_hd_web.png" height="60px">
				Chair of GIScience<br>
				Department of Geography<br>
				Heidelberg University, Germany
				<p style="clear: both;">
					<a href="http://www.geog.uni-heidelberg.de/giscience.html" target="_blank">http://www.geog.uni-heidelberg.de/giscience.html</a>
					<br><br>
					Email:
					<br>
					herfort[at]uni-heidelberg.de
				</p>
				<p>This Website was created by Marcel Reinmuth and Benjamin Herfort. Special Thanks go to Jess Cahill for the work on improving the design. </p>
		</div>
		
		<div class="col-md-12" id="leaflet_map" style="height: calc(100vH - 91px)">
		
			
			<div style="padding-bottom: 25px; padding-left: 10px; position: absolute; bottom: 0px; z-index: 997">
				<button onclick="window.location.href='http://tasks.hotosm.org/?sort_by=priority&direction=asc&search=MapSwipe'" class="btn btn-danger btn-lg">View HOT Tasking Manager projects!</button></br>
				<button onclick="window.location.href='http://mapswipe.geog.uni-heidelberg.de/download/'" class="btn btn-success btn-lg" style="margin-top: 10px">Go to data repository!</button></br>
				<button onclick="window.location.href='http://mapswipe.geog.uni-heidelberg.de/4877.html'" class="btn btn-success btn-lg" style="margin-top: 10px">View details for MapSwipe Nigeria for MSF 3!</button>
			</div>
		
		</div>
		


        <script src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
        <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.12.0.min.js"><\/script>')</script>
        <script src="js/plugins.js"></script>
        <script src="js/main.js"></script>

    </body>
</html>