Difference between revisions of "Orangutan layers"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
− | |||
<html> | <html> | ||
<head> | <head> | ||
Line 20: | Line 19: | ||
<script> | <script> | ||
// GEOJSON FILES | // GEOJSON FILES | ||
− | var | + | var orangutan2 = 'files/orangutans/PHVA_SOA_metapop.geojson'; |
− | + | ||
− | + | // Create map | |
− | + | var map = L.map('map').setView([10, 110], 4); | |
− | |||
− | |||
− | var map = L.map('map').setView([ | ||
+ | // Create open maps | ||
+ | var osm=new L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png',{attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</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); | 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); | ||
− | + | ||
+ | // POPUP -> this "feature.properties.xxxx" needs to be matching the file please look it up in the file | ||
+ | function forEachFeature(feature, layer) { var popupContent = "<p><b>Species: </b>"+ feature.properties.Subspecies +'</p>'; layer.bindPopup(popupContent);} | ||
+ | // Set style function that sets fill color property | ||
+ | function styleorangutan2(feature) { return { fillColor: '#F31818', fillOpacity: 0.7, weight: 2, opacity: 0.7, color: '#F31818', dashArray: '3' }; } | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
// Null variable that will hold layer | // Null variable that will hold layer | ||
− | var | + | var orangutan2Layer = L.geoJson(null, {onEachFeature: forEachFeature, style: styleorangutan2}); |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | $.getJSON(orangutan2, function(data) { orangutan2Layer.addData(data);}); orangutan2Layer.addTo(map); | ||
// for Layer Control | // for Layer Control | ||
var baseMaps = { | var baseMaps = { | ||
− | + | "Open Street Map": osm, | |
− | + | "Open Topo Map": topo, | |
}; | }; | ||
var overlayMaps = { | var overlayMaps = { | ||
− | + | "Bornean orangutan 2019": orangutan2Layer, | |
− | + | }; | |
− | |||
− | |||
− | |||
− | }; | ||
//Add layer control | //Add layer control | ||
Line 132: | Line 54: | ||
</body> | </body> | ||
</html> | </html> | ||
+ | |||
+ | |||
+ | {|border="1" cellpadding="5" cellspacing="0" <!-- align="right" --> class="gibbon_ranges" !style="background-color:#ccffcc;" | ||
+ | |+'''Download available layers. Source: IUCN ''' | ||
+ | !Species | ||
+ | !Shapefile | ||
+ | !GeoJSON | ||
+ | |- |
Revision as of 10:07, 7 March 2022
Species | Shapefile | GeoJSON |
---|