Skip to content

Commit c952e22

Browse files
committed
feat: flag off imagery on details view
1 parent a6a8e8c commit c952e22

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

client/renderMap.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ limitations under the License.
1818
// This function is used in the rendering templates.
1919

2020
/* exported showMap */
21-
function showMap(centerX, centerY, zoom, style, opt, source) {
21+
function showMap(centerX, centerY, zoom, style, opt, source, argv) {
2222
const opts = opt || {};
2323
const detail = style === 'perim';
2424
const cities = opts.cities || {closest: [], biggest: []};
@@ -774,7 +774,7 @@ function showMap(centerX, centerY, zoom, style, opt, source) {
774774
'UnincAreas',
775775
'CityAreas',
776776
zoom >= 10 ? Library.USGS.NatlMap.HydroNHD : Library.USGS.NatlMap.Hydro,
777-
Library.USGS.NatlMap.NAIPImagery,
777+
argv.showImageryOnDetails ? Library.USGS.NatlMap.NAIPImagery : null,
778778
// alphaLayer(Library.USGS.NatlMap.ContoursDetail, 0.05),
779779
// alphaLayer(Library.USGS.NatlMap.Contours, 0.3),
780780
// Library.USGS.NatlMap.Polygons,
@@ -818,7 +818,7 @@ function showMap(centerX, centerY, zoom, style, opt, source) {
818818

819819
let configs = detail ? perimLayers : overviewLayers;
820820

821-
configs = configs.filter((c) => !excluded.includes(c));
821+
configs = configs.filter((c) => c && !excluded.includes(c));
822822

823823
function configToLayer(config) {
824824
let source = null;

commands/run.js

+6
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,11 @@ exports.builder = {
271271
boolean: true,
272272
default: true,
273273
desc: 'Whether to parse CALFIRE details',
274+
},
275+
showImageryOnDetails: {
276+
boolean: true,
277+
default: false,
278+
desc: 'Whether to show satellte imagery on details map',
274279
}
275280
};
276281

@@ -291,6 +296,7 @@ exports.handler = (argv) => {
291296
disclaimerUrl: envconfig.ui.disclaimer_url,
292297
systemName: envconfig.ui.system_url,
293298
version: require('../package.json').version,
299+
argv: argv,
294300
};
295301

296302

templates/render-details.pug

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@ html.perim
7979
| #{st}
8080
canvas#qrcode
8181
script
82-
| showMap(#{data.lon}, #{data.lat}, #{data.zoom}, 'perim', !{JSON.stringify(mapData)}, '#{data.current.Source}');
82+
| showMap(#{data.lon}, #{data.lat}, #{data.zoom}, 'perim', !{JSON.stringify(mapData)}, '#{data.current.Source}', !{JSON.stringify(config.argv)});
8383

8484

templates/render-overview.pug

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,4 @@ html.update
171171

172172
canvas#qrcode
173173
script
174-
| showMap(#{data.lon}, #{data.lat}, #{data.zoom}, 'update', !{JSON.stringify(mapData)});
174+
| showMap(#{data.lon}, #{data.lat}, #{data.zoom}, 'update', !{JSON.stringify(mapData)}, undefined, !{JSON.stringify(config.argv)});

0 commit comments

Comments
 (0)