Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

#68 Add different icons for each natural event type

Taylor Gunnoe0645f8022ff0
diff --git a/web/css/wv.events.css b/web/css/wv.events.css
index 855c02cfe..45e4eba80 100644
--- a/web/css/wv.events.css
+++ b/web/css/wv.events.css
@@ -98,6 +98,31 @@
color: red;
}
+/******************** Categories *************************/
+
+#wv-events li i.map-marker {
+ background: url('../images/natural-events/other.svg');
+ height:26px;
+ width:26px;
+}
+#wv-events li.volcanoes i.map-marker{
+ background: url('../images/natural-events/volcano.svg');
+}
+#wv-events li.dust-and-haze i.map-marker{
+ background: url('../images/natural-events/sandstorm.svg');
+}
+#wv-events li.severe-storms i.map-marker{
+ background: url('../images/natural-events/weather.svg');
+}
+#wv-events li.wildfires i.map-marker{
+ background: url('../images/natural-events/fire.svg');
+}
+#wv-events li.manmade i.map-marker{
+ background: url('../images/natural-events/manmade.svg');
+}
+
+/*********************************************************/
+
/******************** Notifications **********************/
.notify-alert {
diff --git a/web/images/natural-events/fire.svg b/web/images/natural-events/fire.svg
new file mode 100644
index 000000000..cf02e8ecc
--- /dev/null
+++ b/web/images/natural-events/fire.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 1000 1000" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><circle cx="500" cy="500" r="500" style="fill:#a53935;"/><path d="M691.239,671.792c46.905,107.539 -16.329,251.107 -180.843,250.213c-120.171,-0.653 -158.146,-76.949 -181.337,-119.373c-23.191,-42.424 -36.862,-160.915 47.85,-279.826c144.084,-202.251 -62.14,-268.471 107.68,-444.815c-31.041,90.996 32.926,174.157 83.859,238.931c19.689,-29.997 32.749,-62.888 10.648,-119.087c195.039,205.566 28,281.045 112.143,473.957Zm-234.819,-122.299c-122.176,245.041 64.528,317.626 120.843,260.139c75.596,-77.169 -41.165,-139.634 -8.314,-283.826c-31.275,30.431 -40.664,107.673 -34.244,160.321c-12.874,-3.949 -78.385,-45.493 -78.285,-136.634Zm-181.88,171.005c-4.349,-277.77 90.991,-206.239 0,-386.995c26.228,144.738 -93.893,110.478 0,386.995Zm450.372,-102c5.086,-100.209 84.619,-130.073 -6.372,-233.995c26.228,83.215 -44.085,124.962 6.372,233.995Zm-221.558,-5.038c12.275,-141.346 116.773,-113.266 57.094,-210.458c-19.249,92.571 -105.283,77.542 -57.094,210.458Zm-113.232,-268.817c6.473,41.102 1.877,66.19 -40.189,130.673c31.052,-129.138 -77.756,-112.879 31.355,-295.847c-16.507,94.717 0.142,109.988 8.834,165.174Z" style="fill:#fff;"/></svg>
\ No newline at end of file
diff --git a/web/images/natural-events/manmade.svg b/web/images/natural-events/manmade.svg
new file mode 100644
index 000000000..29778c7f5
--- /dev/null
+++ b/web/images/natural-events/manmade.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 1000 1000" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><circle cx="500" cy="500" r="500" style="fill:#262626;"/><path d="M119.427,740.105c112.275,-8.74 277.992,-20.105 380.573,-20.105c102.581,0 268.298,11.365 380.573,20.105c-79.77,126.095 -220.462,209.895 -380.573,209.895c-160.111,0 -300.803,-83.8 -380.573,-209.895Zm604.45,-630.472c51.13,29.408 95.951,68.572 131.912,114.944l-143.731,147.938c17.689,145.292 -60.75,161.545 -107.457,259.294c-6.204,12.984 -36.746,-8.335 -11.616,-61.082c18.858,-39.584 61.739,-71.669 27.697,-100.887c-5.084,-4.363 -31.01,-12.47 -78.432,10.941c-79.527,39.261 -123.105,112.022 -150.26,144.036c-16.454,19.398 -39.047,3.986 -26.564,-31.692c7.821,-22.356 81.377,-121.186 140.05,-153.06c-92.402,26.146 -154.13,110.857 -169.771,133.263c-25.957,37.186 -53.438,8.685 -32.384,-29.172c16.296,-29.3 52.138,-86.68 164.122,-150.568c-84.013,22.064 -141.437,91.774 -156.561,108.031c-31.236,33.579 -50.687,1.857 -25.778,-31.692c15.39,-20.729 47.461,-67.004 134.61,-110.214c-31.282,4.765 -83.583,28.767 -122.987,73.83c-24.546,28.072 -45.492,7.073 -19.635,-27.353c59.332,-78.996 225.476,-126.313 291.223,-137.722c25.599,-4.442 90.632,-77.845 155.562,-158.835Z" style="fill:#fff;"/></svg>
\ No newline at end of file
diff --git a/web/images/natural-events/other.svg b/web/images/natural-events/other.svg
new file mode 100644
index 000000000..8318b4144
--- /dev/null
+++ b/web/images/natural-events/other.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 1000 1000" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><circle cx="500" cy="500" r="500" style="fill:#707070;"/><path d="M500,682.5c41.394,0 75,33.606 75,75c0,41.394 -33.606,75 -75,75c-41.394,0 -75,-33.606 -75,-75c0,-41.394 33.606,-75 75,-75Zm30,-65c0,0 45,-247.5 45,-375c0,-41.394 -33.606,-75 -75,-75c-41.394,0 -75,33.606 -75,75c0,103.967 45,375 45,375c0,0 13.893,-4 30,-4c16.107,0 30,4 30,4Z" style="fill:#fff;"/></svg>
\ No newline at end of file
diff --git a/web/images/natural-events/sandstorm.svg b/web/images/natural-events/sandstorm.svg
new file mode 100644
index 000000000..a2ee0628c
--- /dev/null
+++ b/web/images/natural-events/sandstorm.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 1000 1000" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><circle cx="500" cy="502.125" r="500" style="fill:#b8aa45;"/><path d="M909.366,687c-71.047,155.128 -227.708,263 -409.366,263c-181.658,0 -338.319,-107.872 -409.366,-263l818.732,0Zm-361.054,-34.685c-174.564,0.14 -364.875,0.415 -364.875,0.415c199.935,-27.709 177.556,-134.08 321.115,-73.854c-61.615,-64.251 66.309,-163.357 155.814,-97.364c-14.045,-24.479 -56.434,-39.845 -93.387,-28.679c-28.316,-45.488 46.907,-126.521 121.927,-90.948c133.737,-41.093 190.421,70.364 186.467,103.221c80.67,40.984 18.808,188.61 -43.759,187.346c-11.99,-0.242 -115.1,-0.251 -235.687,-0.171c-2.743,0.35 -5.492,0.498 -8.241,0.435c-5.673,-0.131 -19.589,-0.266 -39.374,-0.401Zm-363.898,-60.791c-82.857,-87.342 90.784,-220.946 211.781,-131.203c-18.946,-33.239 -76.351,-54.233 -126.49,-39.238c-38.21,-61.775 90.389,-147.655 165.642,-92.823c48.858,-67.054 167.019,-56.706 192.818,2.626c-42.063,-5.488 -114.429,41.218 -95.186,117.947c-32.541,8.161 -72.076,38.639 -68.479,92.691c-120.545,-36.644 -123.977,95.034 -375.511,109.068c67.912,-14.48 94.079,-56.116 95.425,-59.068Zm160.086,27.976c5.519,0 10,4.481 10,10c0,5.519 -4.481,10 -10,10c-5.519,0 -10,-4.481 -10,-10c0,-5.519 4.481,-10 10,-10Zm-235.432,-9c5.519,0 10,4.481 10,10c0,5.519 -4.481,10 -10,10c-5.519,0 -10,-4.481 -10,-10c0,-5.519 4.481,-10 10,-10Zm262.432,-12c5.519,0 10,4.481 10,10c0,5.519 -4.481,10 -10,10c-5.519,0 -10,-4.481 -10,-10c0,-5.519 4.481,-10 10,-10Zm-218.432,-17.932c5.519,0 10,4.481 10,10c0,5.519 -4.481,10 -10,10c-5.519,0 -10,-4.481 -10,-10c0,-5.519 4.481,-10 10,-10Zm31.346,10.956l0.176,0.187c-0.051,-0.283 -0.107,-0.338 -0.176,-0.187Zm349.898,-35.648c5.519,0 10,4.48 10,10c0,5.519 -4.481,10 -10,10c-5.519,0 -10,-4.481 -10,-10c0,-5.52 4.481,-10 10,-10Zm-403.244,-1.308c5.519,0 10,4.481 10,10c0,5.519 -4.481,10 -10,10c-5.519,0 -10,-4.481 -10,-10c0,-5.519 4.481,-10 10,-10Zm695.967,-78.302c44.448,10.076 69.802,61.979 41.011,96.204c16.227,-48.485 -33.1,-106.04 -101.835,-86.872c17.937,-12.974 33.821,-14.351 46.838,-11.936c-8.523,-43.047 -57.275,-44.05 -90.749,-30.851c31.178,-36.054 99.254,-18.91 104.735,33.455Zm-630.621,71.234c5.519,0 10,4.481 10,10c0,5.519 -4.481,10 -10,10c-5.519,0 -10,-4.481 -10,-10c0,-5.519 4.481,-10 10,-10Zm324.377,-24.777c5.519,0 10,4.48 10,10c0,5.519 -4.481,10 -10,10c-5.519,0 -10,-4.481 -10,-10c0,-5.52 4.481,-10 10,-10Zm29.521,-18.125c5.519,0 10,4.48 10,10c0,5.519 -4.481,10 -10,10c-5.519,0 -10,-4.481 -10,-10c0,-5.52 4.481,-10 10,-10Zm-321.812,-28.332c5.519,0 10,4.481 10,10c0,5.519 -4.481,10 -10,10c-5.519,0 -10,-4.481 -10,-10c0,-5.519 4.481,-10 10,-10Zm27,-20.766c5.519,0 10,4.481 10,10c0,5.519 -4.481,10 -10,10c-5.519,0 -10,-4.481 -10,-10c0,-5.519 4.481,-10 10,-10Zm-44,-29.689c5.519,0 10,4.481 10,10c0,5.519 -4.481,10 -10,10c-5.519,0 -10,-4.481 -10,-10c0,-5.519 4.481,-10 10,-10Zm384,-14.728c5.519,0 10,4.481 10,10c0,5.519 -4.481,10 -10,10c-5.519,0 -10,-4.481 -10,-10c0,-5.519 4.481,-10 10,-10Zm-355,-4.762c5.519,0 10,4.481 10,10c0,5.52 -4.481,10 -10,10c-5.519,0 -10,-4.48 -10,-10c0,-5.519 4.481,-10 10,-10Zm378.665,-21.821c5.519,0 10,4.481 10,10c0,5.519 -4.481,10 -10,10c-5.519,0 -10,-4.481 -10,-10c0,-5.519 4.481,-10 10,-10Zm-324.665,-3c5.519,0 10,4.481 10,10c0,5.519 -4.481,10 -10,10c-5.519,0 -10,-4.481 -10,-10c0,-5.519 4.481,-10 10,-10Zm44,0c5.519,0 10,4.481 10,10c0,5.519 -4.481,10 -10,10c-5.519,0 -10,-4.481 -10,-10c0,-5.519 4.481,-10 10,-10Zm-22,-28c5.519,0 10,4.481 10,10c0,5.519 -4.481,10 -10,10c-5.519,0 -10,-4.481 -10,-10c0,-5.519 4.481,-10 10,-10Z" style="fill:#fff;"/></svg>
\ No newline at end of file
diff --git a/web/images/natural-events/volcano.svg b/web/images/natural-events/volcano.svg
new file mode 100644
index 000000000..236b2f11a
--- /dev/null
+++ b/web/images/natural-events/volcano.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 1000 1000" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><circle cx="500" cy="502.125" r="500" style="fill:#c8703c;"/><path d="M882.676,736.748c-79.384,127.962 -221.149,213.252 -382.676,213.252c-162.145,0 -304.375,-85.943 -383.583,-214.722l261.583,-361.383c81.711,38.617 156.612,38.05 225,0l279.676,362.853Zm-277.149,-223.108c0,0 63.555,203.154 97.498,287.522c3.475,8.636 13.307,12.826 21.942,9.352c8.636,-3.475 12.826,-13.306 9.352,-21.942c-33.944,-84.368 -128.792,-274.932 -128.792,-274.932Zm-243.34,-11.515c0,0 -100.019,135.302 -136.671,196.981c-4.755,8.002 -2.119,18.359 5.883,23.114c8.003,4.756 18.36,2.119 23.115,-5.883c36.651,-61.679 107.673,-214.212 107.673,-214.212Zm178.23,-30.544c0,0 -0.443,124.746 6.007,177.395c1.048,8.551 8.84,14.642 17.391,13.595c8.55,-1.048 14.642,-8.84 13.594,-17.391c-6.45,-52.649 -36.992,-173.599 -36.992,-173.599Zm-40.417,-97.686c-4.129,-71.774 -0.23,-146.809 25.757,-229.947l15.875,3.5c-29.774,84.418 -38.009,155.923 -41.632,226.447Zm-70.895,-25.231c-30.403,-51.745 -57.675,-84.923 -112.749,-133.375l10.31,-10.879c47.087,43.985 79.25,92.698 102.439,144.254Zm136.688,-1.266c3.418,-54.594 18.31,-104.066 56.826,-142.988l11.924,11.442c-39.149,29.312 -56.526,75.131 -68.75,131.546Zm-249.386,-184.87l-40.559,-17.08l-18.236,5.335l-5.201,38.079l11.014,2.951l14.814,32.023l17.266,-2.62l25.627,-41.346l-4.725,-17.342Zm343.028,57.564l42.347,-10.966l22.818,-27.419l-25.903,-31.204l-28.259,3.377l-32.415,-5.387l-13.904,36.9l35.316,34.699Zm-74.156,-102.402l-3.802,-22.778l-34.088,-27.439l-18.372,4.927l-23.934,15.814l6.666,33.475l56.395,17.287l17.135,-21.286Z" style="fill:#fff;"/></svg>
\ No newline at end of file
diff --git a/web/images/natural-events/weather.svg b/web/images/natural-events/weather.svg
new file mode 100644
index 000000000..681bca36a
--- /dev/null
+++ b/web/images/natural-events/weather.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 1000 1000" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><circle cx="500" cy="500" r="500" style="fill:#2f5581;"/><path d="M256.934,515.679c-0.428,0.044 -108.07,11.054 -101.237,-85.494c2.212,-31.256 37.022,-61.722 58.204,-58.589c-10.193,-16.45 -1.902,-75.423 66.015,-101.478c34.584,-13.267 92.354,-20.649 158.133,11.704c0,0 -13.265,-20.021 -43.268,-27.745c35.553,-91.35 264.047,-63.553 266.205,-19.027c1.738,-13.317 -5.919,-24.842 -23.818,-30.329c42.842,-21.123 162.02,46.594 128.789,143.875c61.449,-11.905 102.102,85.454 46.678,118.712c0.101,-14.332 -7.297,-24.388 -7.962,-24.087c8.844,53.763 -38.465,72.36 -38.716,72.458l-203.764,0l-26.461,54.161l79.259,14.816l-204.796,278.666l102.232,-229.187l-69.278,-14.212l38.536,-104.244l-224.751,0Zm404.052,-158.294c-8.967,-36.942 -56.935,-88.906 -122.173,-44.952c68.834,-20.614 125.558,30.809 106.149,107.986c11.116,-15.914 18.002,-31.479 17.024,-47.001c55.963,11.235 55.812,60.96 35.758,93.89c35.278,-24.756 31.71,-101.18 -36.758,-109.923Zm-280.675,2.313c-39.954,-57.727 -163.857,-0.627 -96.316,93.856c-29.322,-92.656 64.547,-124.468 96.316,-93.856Z" style="fill:#fff;"/></svg>
\ No newline at end of file
diff --git a/web/js/naturalEvents/wv.naturalEvents.model.js b/web/js/naturalEvents/wv.naturalEvents.model.js
index 4d77919cd..a203b17c8 100644
--- a/web/js/naturalEvents/wv.naturalEvents.model.js
+++ b/web/js/naturalEvents/wv.naturalEvents.model.js
@@ -46,7 +46,6 @@ wv.naturalEvents.model = wv.naturalEvents.model || function(models, config) {
self.layers = config.naturalEvents.layers;
self.ignored = config.naturalEvents.skip || [];
-
self.data = {};
var init = function() {
@@ -54,11 +53,26 @@ wv.naturalEvents.model = wv.naturalEvents.model || function(models, config) {
//self.events.on( "select", onSelect );
self.query();
};
- // TODO: Reuse permalinks when we have historical events
+
var onQueryResults = function(){
if ( self.data ) {
querySuccessFlag = true;
-
+
+ // prune the events of types we don't want
+ var pruned = [];
+ _.each( self.data.events, function( event ) {
+ // this is assuming there is ever only one category per event.
+ // may need to be updated if any events have multiple categories
+ if ( !self.ignored.includes( event.categories[0].title ) ) {
+ // make a usuable css class from category name
+ event.categories[0].css = event.categories[0].title
+ .toLowerCase()
+ .replace(' ', '-');
+ pruned.push( event );
+ }
+ });
+ self.data.events = pruned;
+ // TODO: Reuse permalinks when we have historical events
//models.link.register(self);
//models.link.load(self);
}
@@ -101,7 +115,7 @@ wv.naturalEvents.model = wv.naturalEvents.model || function(models, config) {
var url = self.apiURL + "/categories";
$.getJSON(url, function(data) {
self.data.types = data.categories;
- self.events.trigger('queryResults');
+ //self.events.trigger('queryResults');
});
};
@@ -109,7 +123,7 @@ wv.naturalEvents.model = wv.naturalEvents.model || function(models, config) {
var url = self.apiURL + "/sources";
$.getJSON(url, function(data) {
self.data.sources = data.sources;
- self.events.trigger('queryResults');
+ //self.events.trigger('queryResults');
});
};
diff --git a/web/js/naturalEvents/wv.naturalEvents.ui.js b/web/js/naturalEvents/wv.naturalEvents.ui.js
index f3c652dee..827991f8b 100644
--- a/web/js/naturalEvents/wv.naturalEvents.ui.js
+++ b/web/js/naturalEvents/wv.naturalEvents.ui.js
@@ -195,7 +195,6 @@ wv.naturalEvents.ui = wv.naturalEvents.ui || function(models, ui, config) {
eventItem = event.geometries[0];
}
-
category = "Default";
categories = event.categories;
if ( categories.constructor !== Array ) {
@@ -272,12 +271,7 @@ wv.naturalEvents.ui = wv.naturalEvents.ui || function(models, ui, config) {
};
var refreshEvent = function($content, event, index) {
- if ((event.categories[0].title === 'Floods') ||
- (event.categories[0].title === 'Earthquakes') ||
- (event.categories[0].title === 'Drought') ||
- (event.categories[0].title === 'Landslides')) {
- return;
- }
+
var geoms = toArray(event.geometries);
eventDate = wv.util.parseDateUTC(geoms[0].date);
@@ -292,6 +286,7 @@ wv.naturalEvents.ui = wv.naturalEvents.ui || function(models, ui, config) {
var $item = $("<li></li>")
.addClass("selectorItem")
.addClass("item")
+ .addClass(event.categories[0].css)
.attr("data-index", index);
var $title = $("<h4></h4>")
.addClass("title")
@@ -301,7 +296,7 @@ wv.naturalEvents.ui = wv.naturalEvents.ui || function(models, ui, config) {
.html(event.description)
.hide();
var $mapMarker = $("<i></i>")
- .addClass('fa fa-map-marker fa-2x');
+ .addClass('map-marker');
var $dates = $("<ul></ul>").addClass("dates").hide();
if ( event.geometries.length > 1 ) {