From 56e6c3da02e2bdd35b660cce74d9e9c05a53a57d Mon Sep 17 00:00:00 2001 From: Tim Sutton Date: Sun, 9 Apr 2017 23:56:58 +0200 Subject: [PATCH] Work in progress for issue 71 - support OSM project areas and user defined AOI's for reporting --- reporter/templates/base.html | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/reporter/templates/base.html b/reporter/templates/base.html index 797a9d8..9636dc5 100644 --- a/reporter/templates/base.html +++ b/reporter/templates/base.html @@ -64,6 +64,16 @@

OpenStreetMap Reporter

Filters


+
+

Area of Interest:

+ +

Feature Type :

-
+

Date From :

-
+

Date To :

-
+
@@ -212,7 +222,26 @@

{{ current_tag_name|capitalize|replace('_', ' ')}} Contributors

clickable: false }).addTo(map); window.bbox = map.getBounds().toBBoxString(); + + // Add AOI's to the map + polyLayer = L.geoJson(null, {filter: layerFilter, onEachFeature: addProjectToList}).addTo(map); + $.getJSON("https://s3.amazonaws.com/tm-projects-vt/hotprojects.geojson", function(data) { + polyLayer.addData(data); + }); + }); + + //polyLayer will only include feature + function layerFilter(feature) { + if (feature.properties.name != "") return true + } + //for every HOT project area, add an entry to the select widget + function addProjectToList(feature, layer) { + projectName = feature.properties.name; + var projectsWidget = $("#aoi_select"); + projectsWidget.append(""); + } + $(function () { {# Pie chart for all users #} var myData = [