Skip to content

Commit

Permalink
Merge pull request #3374 from Vizzuality/feature/biodiversity-signifi…
Browse files Browse the repository at this point in the history
…cance

Biodiversity Significance Layer 3.0
  • Loading branch information
edbrett committed Apr 25, 2018
2 parents 79108fb + 1341504 commit 04f06c1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
2 changes: 0 additions & 2 deletions app/assets/javascripts/map/templates/layersNav.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@
<span class="onoffswitch"><span></span></span>
<span class="layer-title">Protected areas<a href='#' data-source='wdpa_protected_areas' class='source source-shape-info'><svg><use xlink:href="#shape-info"></use></svg></a></span>
</li>
{{#if staging}}
<li class="wrapped-layer" data-color="#6D00E1">
<span class="onoffswitch"><span></span></span>
<span class="layer-title">Global Biodiversity<a href='#' data-source='biodiversity_intactness' class='source source-shape-info'><svg><use xlink:href="#shape-info"></use></svg></a></span>
Expand All @@ -230,7 +229,6 @@
</label>
</span>
</li>
{{/if}}
<li class="layer" data-layer="biodiversity_hotspots">
<span class="onoffswitch"><span></span></span>
<span class="layer-title">Biodiversity hotspots<a href='#' data-source='biodiversity_hotspots' class='source source-shape-info'><svg><use xlink:href="#shape-info"></use></svg></a></span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ define(
options: {
dataMaxZoom: 12,
urlTemplate:
'https://storage.googleapis.com/wri-public/biodiversity/significance/all/remaining/v1{/z}{/x}{/y}.png'
'https://api.resourcewatch.org/v1/layer/43a205fe-aad3-4db1-8807-c399a3264349/tile/gee/{z}/{x}/{y}'
},

init: function(layer, options, map) {
Expand All @@ -42,32 +42,6 @@ define(
.exponent(exp)
.domain([0, 256])
.range([0, 256]);
var scale = chroma
.scale([
'#F8EBFF',
'#ECCAFC',
'#DFA4FF',
'#C26DFE',
'#9D36F7',
'#6D00E1',
'#3C00AB'
])
.domain([0, 40, 84, 119, 140, 175, 255]);

for (var i = 0; i < w; ++i) {
for (var j = 0; j < h; ++j) {
//maps over square
var pixelPos = (j * w + i) * components;
var intensity = imgdata[pixelPos + 1];

var tmp_rgb = scale(intensity).rgb();
imgdata[pixelPos] = tmp_rgb[0];
imgdata[pixelPos + 1] = tmp_rgb[1];
imgdata[pixelPos + 2] = tmp_rgb[2];

imgdata[pixelPos + 3] = myscale(intensity) * 256;
}
}
},

_getUrl: function(x, y, z) {
Expand Down

0 comments on commit 04f06c1

Please sign in to comment.