Difference between revisions of "Range test"

From A.P.E.S. wiki
Jump to navigation Jump to search
Line 18: Line 18:
  
 
     <script>
 
     <script>
    // create map  
+
      // GEOJSON FILES
 +
      var hoolockhoolock = 'files/gibbon/Hoolock_hoolock.geojson';
 +
      var hoolockleuconedys = 'files/gibbon/Hoolock_leuconedys.geojson';
 +
      var Nomascus_hainanus = 'files/gibbon/Nomascus_hainanus.geojson';
 +
     
 +
      // create map  
 
       var map = L.map('map').setView([10, 110], 4);  
 
       var map = L.map('map').setView([10, 110], 4);  
  
Line 25: Line 30:
 
       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);
 
       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);
  
      // GEOJSON FILES
 
      var hoolockhoolock = 'files/gibbon/Hoolock_hoolock.geojson';
 
      var hoolockleuconedys = 'files/gibbon/Hoolock_leuconedys.geojson';
 
     
 
 
       // Popup  
 
       // Popup  
 
       function forEachFeature(feature, layer) { var popupContent = "<p><b>Species: </b>"+ feature.properties.BINOMIAL +'</p>'; layer.bindPopup(popupContent); }
 
       function forEachFeature(feature, layer) { var popupContent = "<p><b>Species: </b>"+ feature.properties.BINOMIAL +'</p>'; layer.bindPopup(popupContent); }
Line 35: Line 36:
 
       function stylehoolockleuconedys(feature) {return { fillColor: 'purple',fillOpacity: 0.7,weight: 2,opacity: 0.7,color: 'red',dashArray: '3', }; }
 
       function stylehoolockleuconedys(feature) {return { fillColor: 'purple',fillOpacity: 0.7,weight: 2,opacity: 0.7,color: 'red',dashArray: '3', }; }
 
       function stylehoolockleuconedys(feature) {return { fillColor: 'red',fillOpacity: 0.7,weight: 2,opacity: 0.7,color: 'red',dashArray: '3', }; }
 
       function stylehoolockleuconedys(feature) {return { fillColor: 'red',fillOpacity: 0.7,weight: 2,opacity: 0.7,color: 'red',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
 
       // Null variable that will hold layer
 
       var hoolockhoolockLayer = L.geoJson(null, {onEachFeature: forEachFeature, style: stylehoolockhoolock});
 
       var hoolockhoolockLayer = L.geoJson(null, {onEachFeature: forEachFeature, style: stylehoolockhoolock});
 
       var hoolockleuconedysLayer = L.geoJson(null, {onEachFeature: forEachFeature, style: stylehoolockleuconedys});
 
       var hoolockleuconedysLayer = L.geoJson(null, {onEachFeature: forEachFeature, style: stylehoolockleuconedys});
 +
      var Nomascus_hainanusLayer = L.geoJson(null, {onEachFeature: forEachFeature, style: styleNomascus_hainanus});
  
 
       $.getJSON(hoolockhoolock, function(data) { hoolockhoolockLayer.addData(data);}); hoolockhoolockLayer.addTo(map);
 
       $.getJSON(hoolockhoolock, function(data) { hoolockhoolockLayer.addData(data);}); hoolockhoolockLayer.addTo(map);
 
       $.getJSON(hoolockleuconedys, function(data) { hoolockleuconedysLayer.addData(data);});  hoolockleuconedysLayer.addTo(map);
 
       $.getJSON(hoolockleuconedys, function(data) { hoolockleuconedysLayer.addData(data);});  hoolockleuconedysLayer.addTo(map);
 +
      $.getJSON(Nomascus_hainanus, function(data) { Nomascus_hainanusLayer.addData(data);});  Nomascus_hainanusLayer.addTo(map);
  
 
       // for Layer Control
 
       // for Layer Control
Line 52: Line 56:
 
       "Hoolock hoolock range": hoolockhoolockLayer,
 
       "Hoolock hoolock range": hoolockhoolockLayer,
 
       "Hoolock leuconedys range": hoolockleuconedysLayer,
 
       "Hoolock leuconedys range": hoolockleuconedysLayer,
 +
      "Nomascus hainanus range": Nomascus_hainanusLayer,
 
       };                    
 
       };                    
  

Revision as of 08:54, 7 March 2022


Download available layers
Species Shapefile GeoJSON Source
Hoolock hoolock Hoolock hoolock shapefile (ZIP; 110 kB)]