Difference between revisions of "Range layers"

From A.P.E.S. wiki
Jump to navigation Jump to search
(Blanked the page)
Tag: Blanking
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<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"></script>
 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
 
  
    <style>
 
      #map {
 
      height: 500px;
 
      width: 100%;
 
      max-width: 100%;
 
      max-height: 100%;
 
      }
 
    </style>
 
  </head>
 
  <body>
 
    <div id="map" style="width: 100%; height: 500px;"></div>
 
 
    <script>
 
      // GEOJSON FILES
 
      var hoolockhoolock = 'files/gibbon/Hoolock_hoolock.geojson';
 
      var hoolockleuconedys = 'files/gibbon/Hoolock_leuconedys.geojson';
 
      var hoolocktianxing = 'files/gibbon/Hoolock_tianxing.geojson';
 
      var hyloabbotti = 'files/gibbon/Hylobates_abbotti.geojson';
 
    var hyloagilis = 'files/gibbon/Hylobates_agilis.geojson';
 
    var hyloalbibaris = 'files/gibbon/Hylobates_albibarbis.geojson';
 
    var hylofunereus = 'files/gibbon/Hylobates_funereus.geojson';
 
    var hylolar = 'files/gibbon/Hylobates_lar.geojson';
 
    var hylolarcarp = 'files/gibbon/Hylobates_lar_ssp_carpenteri.geojson';
 
    var hylolarvest = 'files/gibbon/Hylobates_lar_ssp_vestitus.geojson';
 
    var hylomoloch = 'files/gibbon/Hylobates_moloch.geojson';
 
    var hylomuell = 'files/gibbon/Hylobates_muelleri.geojson';
 
    var hylopileatus = 'files/gibbon/Hylobates_pileatus.geojson';
 
    var hyloklosii = 'files/gibbon/Hylobates_klossii.geojson';
 
      var Nomascus_hainanus = 'files/gibbon/Nomascus_hainanus.geojson';
 
 
      // Create map
 
      var map = L.map('map').setView([10, 110], 4);
 
 
      // Create open maps
 
      var osm=new L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png',{attribution: '&copy; <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: '&copy; <a href="http://osm.org/copyright">OpenTopoMap</a> contributors'}).addTo(map);
 
 
 
      // POPUP
 
      function forEachFeature(feature, layer) { var popupContent = "<p><b>Species: </b>"+ feature.properties.BINOMIAL +'</p>'; layer.bindPopup(popupContent);}
 
 
      // Set style function that sets fill color property
 
      function stylehoolockhoolock(feature) { return { fillColor: '#F31818', fillOpacity: 0.7,  weight: 2, opacity: 0.7, color: '#F31818', dashArray: '3' }; }
 
      function stylehoolockleuconedys(feature) { return { fillColor: '#AF1818', fillOpacity: 0.7,  weight: 2, opacity: 0.7, color: '#AF1818', dashArray: '3' };}
 
      function stylehoolocktianxing(feature) { return { fillColor: '#B65757', fillOpacity: 0.7,  weight: 2, opacity: 0.7, color: '#B65757', dashArray: '3' }; }
 
      function stylehyloabbotti(feature) { return { fillColor: '#F87446', fillOpacity: 0.7,  weight: 2, opacity: 0.7, color: '#F87446', dashArray: '3' }; }
 
    function stylehyloagilis(feature) { return { fillColor: '#CA833D', fillOpacity: 0.7,  weight: 2, opacity: 0.7, color: '#CA833D', dashArray: '3' }; }
 
    function stylehyloalbibaris(feature) { return { fillColor: '#CE6C0C', fillOpacity: 0.7,  weight: 2, opacity: 0.7, color: '#CE6C0C', dashArray: '3' }; }
 
    function stylehylofunereus(feature) { return { fillColor: '#EEA215', fillOpacity: 0.7,  weight: 2, opacity: 0.7, color: '#EEA215', dashArray: '3' }; }
 
    function stylehylolar(feature) { return { fillColor: '#EEC315', fillOpacity: 0.7,  weight: 2, opacity: 0.7, color: '#EEC315', dashArray: '3' }; }
 
    function stylehylolarcarp(feature) { return { fillColor: '#EBEE15', fillOpacity: 0.7,  weight: 2, opacity: 0.7, color: '#EBEE15', dashArray: '3' }; }
 
    function stylehylolarvest(feature) { return { fillColor: '#CCCE4A', fillOpacity: 0.7,  weight: 2, opacity: 0.7, color: '#CCCE4A', dashArray: '3' }; }
 
    function stylehylomoloch(feature) { return { fillColor: '#ADC60F', fillOpacity: 0.7,  weight: 2, opacity: 0.7, color: '#ADC60F', dashArray: '3' }; }
 
    function stylehylomuell(feature) { return { fillColor: '#92C60F', fillOpacity: 0.7,  weight: 2, opacity: 0.7, color: '#92C60F', dashArray: '3' }; }
 
    function stylehylopileatus(feature) { return { fillColor: '#7FDC14', fillOpacity: 0.7,  weight: 2, opacity: 0.7, color: '#7FDC14', dashArray: '3' }; }
 
    function styleshyloklosii(feature) { return { fillColor: '#EF1E6A', fillOpacity: 0.7,  weight: 2, opacity: 0.7, color: '#EF1E6A', dashArray: '3' }; }
 
      function styleNomascus_hainanus(feature) {return { fillColor: 'blue',fillOpacity: 0.7,weight: 2,opacity: 0.7,color: 'blue',dashArray: '3', }; }
 
 
      // Null variable that will hold layer
 
      var hoolockhoolockLayer = L.geoJson(null, {onEachFeature: forEachFeature, style: stylehoolockhoolock});
 
      var hoolockleuconedysLayer = L.geoJson(null, {onEachFeature: forEachFeature, style: stylehoolockleuconedys});
 
      var hoolocktianxingLayer = L.geoJson(null, {onEachFeature: forEachFeature,style: stylehoolocktianxing});  
 
      var hyloabbottiLayer = L.geoJson(null, {onEachFeature: forEachFeature,style: stylehyloabbotti});
 
    var hyloagilisLayer = L.geoJson(null, {onEachFeature: forEachFeature,style: stylehyloagilis});  
 
    var hyloalbibarisLayer = L.geoJson(null, {onEachFeature: forEachFeature,style: stylehyloalbibaris});  
 
    var hylofunereusLayer = L.geoJson(null, {onEachFeature: forEachFeature,style: stylehylofunereus});  
 
    var hylolarLayer = L.geoJson(null, {onEachFeature: forEachFeature,style: stylehylolar});  
 
    var hylolarcarpLayer = L.geoJson(null, {onEachFeature: forEachFeature,style: stylehylolarcarp});  
 
    var hylolarvestLayer = L.geoJson(null, {onEachFeature: forEachFeature,style: stylehylolarvest});
 
    var hylomolochLayer = L.geoJson(null, {onEachFeature: forEachFeature,style: stylehylomoloch});
 
    var hylomuellLayer = L.geoJson(null, {onEachFeature: forEachFeature,style: stylehylomuell});
 
    var hylopileatusLayer = L.geoJson(null, {onEachFeature: forEachFeature,style: stylehylopileatus});  
 
    var hyloklosiiLayer = L.geoJson(null, {onEachFeature: forEachFeature,style: stylehyloklosii});
 
      var Nomascus_hainanusLayer = L.geoJson(null, {onEachFeature: forEachFeature, style: styleNomascus_hainanus});
 
 
      $.getJSON(hoolockhoolock, function(data) { hoolockhoolockLayer.addData(data);}); hoolockhoolockLayer.addTo(map);
 
      $.getJSON(hoolockleuconedys, function(data) { hoolockleuconedysLayer.addData(data);}); hoolockleuconedysLayer.addTo(map);
 
      $.getJSON(hoolocktianxing, function(data) { hoolocktianxingLayer.addData(data);}); hoolocktianxingLayer.addTo(map);
 
      $.getJSON(hyloabbotti, function(data) { hyloabbottiLayer.addData(data);}); hyloabbottiLayer.addTo(map);
 
    $.getJSON(hyloagilis, function(data) { hyloagilisLayer.addData(data);}); hyloagilisLayer.addTo(map);
 
    $.getJSON(hyloalbibaris, function(data) { hyloalbibarisLayer.addData(data);}); hyloalbibarisLayer.addTo(map);
 
    $.getJSON(hylolarcarp, function(data) { hylolarcarpLayer.addData(data);}); hylolarcarpLayer.addTo(map);
 
    $.getJSON(hylolar, function(data) { hylolarLayer.addData(data);}); hylolarLayer.addTo(map);
 
    $.getJSON(hylofunereus, function(data) { hylofunereusLayer.addData(data);}); hylofunereusLayer.addTo(map);
 
    $.getJSON(hylopileatus, function(data) { hylopileatusLayer.addData(data);}); hylopileatusLayer.addTo(map);
 
    $.getJSON(hylomuell, function(data) { hylomuellLayer.addData(data);}); hylomuellLayer.addTo(map);  
 
    $.getJSON(hylomoloch, function(data) { hylomolochLayer.addData(data);}); hylomolochLayer.addTo(map);
 
    $.getJSON(hylolarvest, function(data) { hylolarvestLayer.addData(data);}); hylolarvestLayer.addTo(map);
 
    $.getJSON(hyloklosii, function(data) { hyloklosiiLayer.addData(data);}); hyloklosiiLayer.addTo(map);
 
      $.getJSON(Nomascus_hainanus, function(data) { Nomascus_hainanusLayer.addData(data);});  Nomascus_hainanusLayer.addTo(map);
 
 
      // for Layer Control
 
      var baseMaps = {
 
        "Open Street Map": osm, 
 
        "Open Topo Map": topo, 
 
      };
 
 
      var overlayMaps = {
 
        "Hoolock hoolock range": hoolockhoolockLayer,
 
        "Hoolock leuconedys range": hoolockleuconedysLayer,
 
        "Hoolock tianxing": hoolocktianxingLayer,
 
        "Hylobates abbotti": hyloabbottiLayer,
 
      "Hylobates agilis": hyloagilisLayer,
 
      "Hylobates albibarbis": hyloalbibarisLayer,
 
      "Hylobates funereus": hylofunereusLayer,
 
      "Hylobates lar": hylolarLayer,
 
      "Hylobates lar carpenteri": hylolarcarpLayer,
 
      "Hylobates lar vestitus": hylolarvestLayer,
 
      "Hylobates moloch": hylomolochLayer,
 
      "Hylobates muelleri": hylomuellLayer,
 
      "Hylobates pileatus": hylopileatusLayer,
 
      "Hylobates klosii": hyloklosiiLayer,
 
        "Nomascus hainanus range": Nomascus_hainanusLayer,
 
      };                  
 
 
      //Add layer control
 
      L.control.layers(baseMaps, overlayMaps).addTo(map);
 
 
    </script>
 
  </body>
 
</html>
 
 
 
{|border="1" cellpadding="5" cellspacing="0" <!-- align="right" --> class="gibbon_ranges" !style="background-color:#ccffcc;"
 
|+'''Download available layers'''
 
!Species
 
!Shapefile
 
!GeoJSON
 
!Source
 
|-
 
|Hoolock hoolock
 
|[https://iucnapesportal.org/wiki/files/Hoolock_hoolock.zip ''Hoolock hoolock shapefile''] (ZIP; 110&nbsp;kB)]
 
|
 
|
 
|}
 

Latest revision as of 06:17, 8 March 2022