Skip to content

Commit

Permalink
Merge pull request #49 from milafrerichs/32-metadata-layers
Browse files Browse the repository at this point in the history
32 metadata layers
  • Loading branch information
jj0hns0n committed May 22, 2015
2 parents 71e59c9 + c6e0da5 commit 1ab4b66
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 22 deletions.
6 changes: 2 additions & 4 deletions source/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,9 @@ title: Recovery Dashboard
%input(type="checkbox" ng-model="layer.displayed" ng-change="toggleVisibility()")
%label
.name(ng-model="visibleLayers" ng-click="toggleDisplayed()") {{layer.metadata.name}}
.info(ng-model="layer.metadata.show" ng-mouseover="showMetadata()" ng-mouseout="hideMetadata()") i
.info(ng-model="layer.metadata.show" ng-click="toggleMetadata()") i
.sub-styles(ng-show="layer.styleOptions")
.subcheck( ng-model="styleOptions" ng-repeat="styleOptions in layer.styleOptions")
%input(type="radio" name="layerSubStyle" ng-model="layer.selectedStyle" ng-value="styleOptions.styleParam" ng-change="changeStyle()")
%p {{styleOptions.styleName}}
.metadata(ng-show="layer.metadata.show")
.name Name: {{layer.metadata.name}}
.source Source: {{layer.metadata.source}}
= partial "partials/metadata_info"
7 changes: 4 additions & 3 deletions source/javascripts/components/dashboard_controller.coffee
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
class RecoveryDashboardCtrl
constructor: ($scope, $http, olData, olHelpers, layerListService, styleHelper) ->
$scope.hideMetadata = () ->
this.layer.metadata.show = false
$scope.showMetadata = () ->
this.layer.metadata.show = true
$scope.metadata.show = false
$scope.toggleMetadata = () ->
this.layer.metadata.show = !this.layer.metadata.show
$scope.metadata = this.layer.metadata
$scope.toggleVisibility = ->
this.layer.visible = this.layer.displayed
$scope.toggleDisplayed = ->
Expand Down
22 changes: 15 additions & 7 deletions source/javascripts/components/layerListModel.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ angular.module('dashboard').service('layerListModel', ['$rootScope', 'styleHelpe
}
metadata: {
name: "Damaged Buildings"
source: "Worldbank"
source: ""
text: "Using remotely sensed data, international organizations have been interpreting damage to structures building by building. The GFDRR team has collated and standardized the damage levels used in all three datasets by applying some assumptions and merged into a single GIS data layer. Areas covered are limited to areas where cloud free images were available.
During past events (2010 Haiti EQ, 2011 Christchurch EQ), it was understood that this type of damage assessment underestimates the number of destroyed and damaged buildings significantly due to the fact that some types of damage to structures are not visible from above.
The practical usage of this data is still being debated. Without baseline statistics on the number of buildings in the area, it would be difficult to assess the percentage of impacted buildings, which would be a useful starting point for housing assessment. Currently, OpenStreetMap (OSM) volunteers are mapping building footprints using pre-event images, if OSM building footprints are delineated for entire districts, it is possible to estimate the percentage of structures impacted per district with the caveat that it will be an underestimate, judging from past experiences. "
}
}
povertyLayer = {
Expand Down Expand Up @@ -55,6 +60,7 @@ angular.module('dashboard').service('layerListModel', ['$rootScope', 'styleHelpe
metadata: {
name: "Poverty Levels"
source: "Worldbank"
text: "The World Bank Poverty Global Practice group have prepared poverty data for Nepal that can be visualized on a map. This layer will be useful for social protection, as well as to prioritize areas for resources in light of the level of damage estimated using the landslide inventory map, and building damage map above. "
}
}
schoolPolygonLayer = {
Expand Down Expand Up @@ -166,7 +172,7 @@ angular.module('dashboard').service('layerListModel', ['$rootScope', 'styleHelpe
}
metadata: {
name: "Landslides BGS"
source: "Worldbank"
source: ""
}
}
mediaLayer = {
Expand All @@ -180,7 +186,9 @@ angular.module('dashboard').service('layerListModel', ['$rootScope', 'styleHelpe
}
metadata: {
name: "Mainstream Media text"
source: "Worldbank"
source: ""
text: "The World Bank ITS unit has been extracting information on damage being reported in mainstream media since the 25th of April. The information is linked to a place on the map and is available in GIS format. Photographs and video footage are also available. This would be useful for validation of other data sources on damage.
"
}
}
valleyLandslidesLayer= {
Expand All @@ -194,7 +202,7 @@ angular.module('dashboard').service('layerListModel', ['$rootScope', 'styleHelpe
}
metadata: {
name: "Valley Landslides"
source: "Worldbank"
source: ""
}
}
valleyBlockingLayer = {
Expand All @@ -208,7 +216,7 @@ angular.module('dashboard').service('layerListModel', ['$rootScope', 'styleHelpe
}
metadata: {
name: "Valley Blockings"
source: "Worldbank"
source: ""
}
}
landslideLayer = {
Expand All @@ -222,7 +230,7 @@ angular.module('dashboard').service('layerListModel', ['$rootScope', 'styleHelpe
}
metadata: {
name: "Landslides"
source: "Worldbank"
source: ""
}
}
damagedBuildingsLayer = {
Expand All @@ -236,7 +244,7 @@ angular.module('dashboard').service('layerListModel', ['$rootScope', 'styleHelpe
}
metadata: {
name: "Damages Buildings"
source: "Worldbank"
source: ""
}
}
nasaLayer = {
Expand Down
8 changes: 8 additions & 0 deletions source/partials/_metadata_info.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#metadata-info(ng-model="metadata" ng-show="metadata.show")
.metadata
.close(ng-click="hideMetadata()")
x
%h2.name {{metadata.name}}
.content
%p.source Source: {{metadata.source}}
%p {{metadata.text}}
2 changes: 1 addition & 1 deletion source/partials/_sidebar.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.close(ng-click="toggleSidebar()")
.content
%h1 Recovery Dashboard: Nepal Earthquake
%p This project is ...
%p Following the Mw 7.8 earthquake in Nepal, the World Bank Nepal response team has been collating and curating spatial data useful for damage assessments and recovery planning generated by the International community. Below is a summary of the datasets that are in the public domain, with a brief mention of their usefulness and limitations. Baseline spatial datasets available from KLL and OpenCities are described elsewhere.
= link_to "http://gfdrr.org", target: "_blank" do
= image_tag "images/logo.png"
= link_to "http://worldbank.org", target: "_blank" do
Expand Down
24 changes: 24 additions & 0 deletions source/stylesheets/_main.sass
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,28 @@
padding: 0
.dashboard-map
height: 100%
#metadata-info
position: absolute
top: 30%
left: 35%
width: 450px
background: rgba(200,200,200,0.9)
.metadata
postion: relative
border: 1px solid #dcdcdc
.close
position: absolute
right: 5px
top: 5px
border: 1px solid #fff
cursor: pointer
padding: 0 5px
h2
background: #ddd
border-bottom: 1px solid #dcdcdc
padding: 10px
.content
padding: 10px
max-height: 400px
overflow: auto

7 changes: 0 additions & 7 deletions source/stylesheets/components/_layers.sass
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@
color: white
line-height: 20px
text-align: center
.metadata
position: absolute
right: -150px
top: 0px
width: 150px
background: rgba(200,200,200,0.7)
padding: 10px
.sub-styles
clear: left
float: left
Expand Down

0 comments on commit 1ab4b66

Please sign in to comment.