Skip to content

Commit

Permalink
Modified the map so the airport/layer data is selected via a url para…
Browse files Browse the repository at this point in the history
…meter and not by a button
  • Loading branch information
jbowerjr committed Sep 4, 2024
1 parent 110bc9a commit 7bceaa0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 25 deletions.
24 changes: 4 additions & 20 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,13 @@
state: {},
airport: {}
};
const showAirport = window.location.search.toLowerCase().split('&').indexOf('layer=airport') > -1;
</script>
<!-- <script src="data/states/num_apd_he.js" ></script>-->
<!-- <script src="data/states/num_apd_le.js" ></script>-->
<script src="data/states/mb_all_he.js" ></script>
<script src="data/states/mb_all_le.js" ></script>
<script src="data/states/mb_deaths_he.js" ></script>
<script src="data/states/mb_deaths_le.js" ></script>
<script src="data/states/mb_illness.js" ></script>
<!-- <script src="data/airports/num_apd_he.js" ></script>-->
<!-- <script src="data/airports/num_apd_le.js" ></script>-->
<script src="data/airports/mb_all_he.js" ></script>
<script src="data/airports/mb_all_le.js" ></script>
<script src="data/airports/mb_deaths_he.js" ></script>
Expand All @@ -51,9 +48,9 @@
<div id="map-typeahead">
<input class="typeahead" type="search">
</div>
<button id="layer-switch" class="airport" title="Switch between State/Airport data">
<span></span>
</button>
<!-- <button id="layer-switch" class="airport" title="Switch between State/Airport data">-->
<!-- <span></span>-->
<!-- </button>-->
</div>

<div class="app-body">
Expand All @@ -79,19 +76,6 @@
</DIV>
</div>
</div>
<!-- <div class="t-row">-->
<!-- <div class="t-cell t-label data-label">Number of avoided premature deaths</div>-->
<!-- <div class="t-cell">-->
<!-- <DIV class="table sub">-->
<!-- <DIV class="t-row">-->
<!-- <DIV class="t-cell t-label">Low</DIV><DIV class="t-cell data-num_apd_le"></DIV>-->
<!-- </DIV>-->
<!-- <DIV class="t-row">-->
<!-- <DIV class="t-cell t-label">High</DIV><DIV class="t-cell data-num_apd_he"></DIV>-->
<!-- </DIV>-->
<!-- </DIV>-->
<!-- </div>-->
<!-- </div>-->
<div class="t-row">
<div class="t-cell t-label data-label">Total monetized benefits</div>
<div class="t-cell">
Expand Down
10 changes: 5 additions & 5 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
let layerSel, selectedFtr, colorFn, $select, timeoutId;
// let dataId = 'num_apd_he';
let dataId = 'mb_all_le';
let dataCat = 'state';
let dataCat = !!showAirport ? 'airport' : 'state';
let ftrLayers = {'state': null, 'airport': null};
let ftrGeo = {'state': null, 'airport': null};
let panelOpen = false;
Expand Down Expand Up @@ -129,10 +129,10 @@
});

$('#info-panel .close-button').on('click', function(){$('#info-panel').slideReveal('hide');})
$('#layer-switch').on('click', (e) => {
_activateLayer(true);
$(e.currentTarget).toggleClass('airport', dataCat !== 'airport');
});
// $('#layer-switch').on('click', (e) => {
// _activateLayer(true);
// $(e.currentTarget).toggleClass('airport', dataCat !== 'airport');
// });
$('#tt-clear').on('click', _clearTypeahead);

// Set resize event for window
Expand Down

0 comments on commit 7bceaa0

Please sign in to comment.