Difference between revisions of "African great ape layers"
Jump to navigation
Jump to search
Line 24: | Line 24: | ||
// var gadendist2021 = 'files/african_great_apes/great_ape_dendist_ION2021.geojson'; | // var gadendist2021 = 'files/african_great_apes/great_ape_dendist_ION2021.geojson'; | ||
var gaabundance = 'files/african_great_apes/afr_great_ape_ab.geojson'; | var gaabundance = 'files/african_great_apes/afr_great_ape_ab.geojson'; | ||
+ | var wchimp2019 = 'files/african_great_apes/Heinicke2019_westernchimp.geojson'; | ||
+ | var sec = 'files/african_great_apes/SEC_merged_Af_apes.geojson'; | ||
+ | var occugrauer = 'files/african_great_apes/gorilla_occupancy_plumptre.geojson'; | ||
+ | var occuechimp = 'files/african_great_apes/echimp_occupancy_plumptre.geojson'; | ||
+ | var liberiadens = 'files/african_great_apes/liberia_chimp_density.geojson'; | ||
// Create map | // Create map | ||
Line 36: | Line 41: | ||
// Set style function that sets fill color property | // Set style function that sets fill color property | ||
+ | function stylegadendist2021(feature) { return { fillColor: '#F31818', fillOpacity: 0.7, weight: 2, opacity: 0.7, color: '#F31818', dashArray: '3' }; } | ||
function stylegaabundance(feature) { return { fillColor: '#5F0CE4', fillOpacity: 0.7, weight: 2, opacity: 0.7, color: '#5F0CE4', dashArray: '3' }; } | function stylegaabundance(feature) { return { fillColor: '#5F0CE4', fillOpacity: 0.7, weight: 2, opacity: 0.7, color: '#5F0CE4', dashArray: '3' }; } | ||
+ | function stylewchimp2019(feature) { return { fillColor: '#E74F08', fillOpacity: 0.8, weight: 4, opacity: 0.8, color: '#E74F08', dashArray: '3' }; } | ||
+ | function stylesec(feature) { return { fillColor: '#DFE906', fillOpacity: 0.5, weight: 4, opacity: 0.4, color: '#DFE906', dashArray: '3' }; } | ||
+ | function styleoccugrauer(feature) { return { fillColor: '#076419', fillOpacity: 0.8, weight: 2, opacity: 0.8, color: '#076419', dashArray: '3' }; } | ||
+ | function styleoccuechimp(feature) { return { fillColor: '#752309', fillOpacity: 0.8, weight: 2, opacity: 0.8, color: '#752309', dashArray: '3' }; } | ||
+ | function styleliberiadens(feature) { return { fillColor: '#07ACAD', fillOpacity: 0.8, weight: 2, opacity: 0.8, color: '#07ACAD', dashArray: '3' }; } | ||
// Null variable that will hold layer // took out onEachFeature: forEachFeature, | // Null variable that will hold layer // took out onEachFeature: forEachFeature, | ||
var gaabundanceLayer = L.geoJson(null, {style: stylegaabundance}); | var gaabundanceLayer = L.geoJson(null, {style: stylegaabundance}); | ||
+ | var wchimp2019Layer = L.geoJson(null, {style: stylewchimp2019}); | ||
+ | var secLayer = L.geoJson(null, {style: stylesec}); | ||
+ | var occugrauerLayer = L.geoJson(null, {style: styleoccugrauer}); | ||
+ | var occuechimpLayer = L.geoJson(null, {style: styleoccuechimp}); | ||
+ | var liberiadensLayer = L.geoJson(null, {style: styleliberiadens}); | ||
− | $.getJSON(gaabundance); gaabundanceLayer.addTo(map); | + | $.getJSON(gaabundance, function(data) { gaabundanceLayer.addData(data);}); gaabundanceLayer.addTo(map); |
+ | $.getJSON(wchimp2019, function(data) { wchimp2019Layer.addData(data);}); wchimp2019Layer.addTo(map); | ||
+ | $.getJSON(sec, function(data) { secLayer.addData(data);}); secLayer.addTo(map); | ||
+ | $.getJSON(occugrauer, function(data) { occugrauerLayer.addData(data);}); occugrauerLayer.addTo(map); | ||
+ | $.getJSON(occuechimp, function(data) { occuechimpLayer.addData(data);}); occuechimpLayer.addTo(map); | ||
+ | $.getJSON(liberiadens, function(data) { liberiadensLayer.addData(data);}); liberiadensLayer.addTo(map); | ||
// for Layer Control | // for Layer Control | ||
Line 51: | Line 72: | ||
// not showing ga densdist 2021 here because it takes ages to load... | // not showing ga densdist 2021 here because it takes ages to load... | ||
var overlayMaps = { | var overlayMaps = { | ||
+ | "SEC": secLayer, | ||
"Great ape abundance per site": gaabundanceLayer, | "Great ape abundance per site": gaabundanceLayer, | ||
− | + | "Western chimpanzee density": wchimp2019Layer, | |
+ | "Liberia chimpanzee density": liberiadensLayer, | ||
+ | }; | ||