Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Landsat 2017 to the basemaps #3469

Merged
merged 3 commits into from
Jun 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/assets/javascripts/map/templates/maptype.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<li class="maptype landsat" data-maptype="landsat2014"><i></i>Landsat 2014</li>
<li class="maptype landsat" data-maptype="landsat2015"><i></i>Landsat 2015</li>
<li class="maptype landsat" data-maptype="landsat2016"><i></i>Landsat 2016</li>
<li class="maptype landsat" data-maptype="landsat2017"><i></i>Landsat 2017</li>
</ul>
</ul>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
<li class="maptype landsat2005" data-maptype="landsat2005">Landsat 2005</li>
<li class="maptype landsat2006" data-maptype="landsat2006">Landsat 2006</li>
<li class="maptype landsat2007" data-maptype="landsat2007">Landsat 2007</li>
<li class="maptype landsat2008" data-maptype="landsat2008">Landsat 2008</li>
</div>
<div>
<li class="maptype landsat2008" data-maptype="landsat2008">Landsat 2008</li>
<li class="maptype landsat2009" data-maptype="landsat2009">Landsat 2009</li>
<li class="maptype landsat2010" data-maptype="landsat2010">Landsat 2010</li>
<li class="maptype landsat2011" data-maptype="landsat2011">Landsat 2011</li>
Expand All @@ -34,6 +34,7 @@
<li class="maptype landsat2014" data-maptype="landsat2014">Landsat 2014</li>
<li class="maptype landsat2015" data-maptype="landsat2015">Landsat 2015</li>
<li class="maptype landsat2016" data-maptype="landsat2016">Landsat 2016</li>
<li class="maptype landsat2017" data-maptype="landsat2017">Landsat 2017</li>
</div>
</ul>

Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/map/views/MapView.js
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ define(
},

_setLandsatTiles: function() {
for (var i = 1999; i <= 2016; i++) {
for (var i = 1999; i <= 2017; i++) {
if (i >= 2013) {
landsatService.getTiles(i).then(
function (year, results) {
Expand Down
5 changes: 3 additions & 2 deletions app/assets/javascripts/map/views/maptypes/landsatMaptype.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* Landsat Maptype.
*/
/* eslint-disable*/
define([], function () {

'use strict';
Expand All @@ -9,7 +10,7 @@ define([], function () {
// We want to set the url differently depending on the z level and year of
// landsat data. For years before 2013 data is all pre-processed by google.
// from 2013 onwards, we have pre-processed the z-levels between 0 and 11
// in GCS. For higher z-levels the tiles come from a live EE-based service.
// in GCS. For higher z-levels the tiles come from a live EE-based service.

var config = {
name: 'Landsat ' + year,
Expand All @@ -19,12 +20,12 @@ define([], function () {
tileSize: new google.maps.Size(256, 256),
getTileUrl: function(ll, z) {
var x = Math.abs(ll.x % (1 << z)); // jshint ignore:line

switch (year) {
case 2013:
case 2014:
case 2015:
case 2016:
case 2017:
return z > 11
? tileUrl.replace('{z}/{x}/{y}', z + '/' + x + '/' +ll.y)
: 'https://storage.googleapis.com/landsat-cache/{0}/{1}/{2}/{3}.png'.format(year, z, x, ll.y);
Expand Down