Difference between revisions of "Orangutan layers"
Jump to navigation
Jump to search
(Created page with " <html> <head> <link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.3/dist/leaflet.css" /> <script src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js"></scri...") |
|||
Line 24: | Line 24: | ||
var gibbon1 = 'files/Hoolock_hoolock.geojson'; | var gibbon1 = 'files/Hoolock_hoolock.geojson'; | ||
var orangutan1 = 'files/orangutans/OU_density_prediction_12.11.2014.geojson'; | var orangutan1 = 'files/orangutans/OU_density_prediction_12.11.2014.geojson'; | ||
+ | var orangutan2 = 'files/orangutans/PHVA_SOA_metapop.geojson'; | ||
var map = L.map('map').setView([-0, 6], 4); | var map = L.map('map').setView([-0, 6], 4); | ||
Line 75: | Line 76: | ||
}; | }; | ||
} | } | ||
+ | |||
+ | function styleorangutan2(feature) { | ||
+ | return { | ||
+ | fillColor: 'red', | ||
+ | fillOpacity: 0.7, | ||
+ | weight: 2, | ||
+ | opacity: 0.7, | ||
+ | color: 'red', | ||
+ | dashArray: '3' | ||
+ | }; | ||
+ | } | ||
+ | |||
+ | |||
// Null variable that will hold layer | // Null variable that will hold layer | ||
var stateLayer = L.geoJson(null, {style: style}); | var stateLayer = L.geoJson(null, {style: style}); | ||
Line 80: | Line 94: | ||
var gibbonLayer = L.geoJson(null, {style: stylegibbon}); | var gibbonLayer = L.geoJson(null, {style: stylegibbon}); | ||
var orangutan1Layer = L.geoJson(null, {style: styleorangutan1}); | var orangutan1Layer = L.geoJson(null, {style: styleorangutan1}); | ||
+ | var orangutan2Layer = L.geoJson(null, {style: styleorangutan2}); | ||
$.getJSON(url, function(data) { stateLayer.addData(data);}); | $.getJSON(url, function(data) { stateLayer.addData(data);}); | ||
Line 92: | Line 107: | ||
$.getJSON(orangutan1, function(data) { orangutan1Layer.addData(data);}); | $.getJSON(orangutan1, function(data) { orangutan1Layer.addData(data);}); | ||
orangutan1Layer.addTo(map); | orangutan1Layer.addTo(map); | ||
+ | |||
+ | $.getJSON(orangutan2, function(data) { orangutan1Layer.addData(data);}); | ||
+ | orangutan1Layer.addTo(map); | ||
+ | |||
// for Layer Control | // for Layer Control | ||
Line 104: | Line 123: | ||
"Gibbon range": gibbonLayer, | "Gibbon range": gibbonLayer, | ||
"Orangutan density" : orangutan1Layer, | "Orangutan density" : orangutan1Layer, | ||
+ | "Bornean orangutan 2019" : orangutan2Layer | ||
}; | }; | ||
Revision as of 03:15, 7 March 2022