Difference between revisions of "Range Layers"
Jump to navigation
Jump to search
Line 30: | Line 30: | ||
var url = 'files/REFUGIA_MALEY96.json'; // my GeoJSON data source, in same folder as my html page. | var url = 'files/REFUGIA_MALEY96.json'; // my GeoJSON data source, in same folder as my html page. | ||
var url2 = 'files/species_15933.geojson'; // my GeoJSON data source, in same folder as my html page. | var url2 = 'files/species_15933.geojson'; // my GeoJSON data source, in same folder as my html page. | ||
− | + | var gibbon1 = 'files/hoolock_hoolock.geojson'; | |
− | var map = L.map('map').setView([-0, 6], 4); | + | |
+ | var map = L.map('map').setView([-0, 6], 4); | ||
var topo=new L.tileLayer('http://{s}.tile.opentopomap.org/{z}/{x}/{y}.png',{attribution: '© <a href="http://osm.org/copyright">OpenTopoMap</a> contributors'}).addTo(map); | var topo=new L.tileLayer('http://{s}.tile.opentopomap.org/{z}/{x}/{y}.png',{attribution: '© <a href="http://osm.org/copyright">OpenTopoMap</a> contributors'}).addTo(map); | ||
Line 61: | Line 62: | ||
} | } | ||
} | } | ||
− | + | function stylegibbon(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}); | ||
var stateLayer2 = L.geoJson(null, {onEachFeature: forEachFeature, style: style2}); | var stateLayer2 = L.geoJson(null, {onEachFeature: forEachFeature, style: style2}); | ||
+ | var gibbonLayer = L.geoJson(null, {style: stylegibbon}); | ||
$.getJSON(url, function(data) { stateLayer.addData(data);}); | $.getJSON(url, function(data) { stateLayer.addData(data);}); | ||
Line 71: | Line 82: | ||
$.getJSON(url2, function(data) { stateLayer2.addData(data); }); | $.getJSON(url2, function(data) { stateLayer2.addData(data); }); | ||
stateLayer2.addTo(map); | stateLayer2.addTo(map); | ||
+ | |||
+ | $.getJSON(gibbon1, function(data) { gibbonLayer.addData(data);}); | ||
+ | gibbonLayer.addTo(map); | ||
// for Layer Control | // for Layer Control | ||
Line 81: | Line 95: | ||
"Refugia":stateLayer, | "Refugia":stateLayer, | ||
"Ape range":stateLayer2, | "Ape range":stateLayer2, | ||
+ | "Gibbon range": gibbonLayer, | ||
}; | }; | ||
Revision as of 07:47, 1 March 2022
Avaiable Layers:
Ape range Download: Geographic shapefile (ZIP; 171 kB)]
Refugia after Maley 1996 Download: Geographic shapefile (ZIP; 85 kB)]