Skip to content

Commit

Permalink
Fixed some mapping issues and zoom control
Browse files Browse the repository at this point in the history
  • Loading branch information
3PIV committed Mar 4, 2021
1 parent 135bcaf commit ca1b8e4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion public/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@
],
"type": "continuous"
},
"con_avg_yearly_rainfall": {
"cat_avg_yearly_rainfall": {
"info": "The average amount of rain that falls in a year.",
"subcategories": [],
"name": "Avg Yearly Rainfall",
Expand Down
4 changes: 4 additions & 0 deletions public/js/colorLegend.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ function drawData() {
}
});
console.log(geoJSON);
if (!geoJSON) {
console.warn(`Tiles for ${specid}${color} are not available.`);
return;
}
control._selectedSpecies[idx].predicted = L.npmap.layer.mapbox({
name: control._selectedSpecies[idx]._latin,
opacity: blendingActive ? .5 : 1,
Expand Down
4 changes: 2 additions & 2 deletions public/js/mapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ var subNavZ, headerZ, divHeader, divSubNav,
}
}
}],
zoom: 10,
zoom: 11,
center: { lat: 35.6, lng: -83.52 },
minZoom: 10,
minZoom: 11,
maxZoom: 16,
maxBounds: [
{ lat: 35, lng: -84.5 },
Expand Down
5 changes: 3 additions & 2 deletions public/js/searchUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ function clearSearch() {
function selectInitialSpecies(li, remove) {

clearComparisons();

//document.getElementById('search-initial-dropdown').style.backgroundColor = 'rgb(202, 24, 146)';

// Populate Species Density box legend item
Expand All @@ -370,8 +369,9 @@ function selectInitialSpecies(li, remove) {
$('#legend-species-blue').addClass('populated');
}
if (control._selectedSpecies[0] !== undefined && control._selectedSpecies[0].visible) {
console.log('removed started');
recordAction('removed species', control._selectedSpecies[0]._latin.replace(/_/g, ' '));

console.log(control._selectedSpecies[0]);
if (showPredicted) {
NPMap.config.L.removeLayer(control._selectedSpecies[0].predicted);
}
Expand All @@ -380,6 +380,7 @@ function selectInitialSpecies(li, remove) {
NPMap.config.L.removeLayer(control._selectedSpecies[0].observed);
}
control._selectedSpecies[0].visible = false;
console.log('removed completed');
}
if (typeof remove !== 'undefined' && remove === true) return;

Expand Down
5 changes: 4 additions & 1 deletion src/components/SubcategoriesBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,10 @@ export default {
console.log(`Could not find tiles for ${environment}`);
}
});
if (!geoJSON) return;
if (!geoJSON) {
console.warn(`Could not find tiles for ${environment}`);
return;
}
let temp = L.npmap.layer.mapbox({
name: environment,
opacity: 0.5, //blendingActive ? .5 : 1,
Expand Down

0 comments on commit ca1b8e4

Please sign in to comment.