Difference between revisions of "Test"

From A.P.E.S. wiki
Jump to navigation Jump to search
Line 22: Line 22:
 
     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 map = L.map('map').setView([47.7541, -107.05078], 3);  
+
     var map = L.map('map').setView([10, 7], 5);  
  
     var topo=new L.tileLayer('http://{s}.tile.opentopomap.org/{z}/{x}/{y}.png',{  
+
     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);
    attribution: '&copy; <a href="http://osm.org/copyright">OpenTopoMap</a> contributors'}).addTo(map);
+
     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 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);
 
  
  
Line 50: Line 48:
 
         dashArray: '3'
 
         dashArray: '3'
 
       };
 
       };
    }
 
 
    function forEachFeature(feature, layer) {
 
      var popupContent = "<p><b>STATE: </b>"+ feature.properties.STATE_NAME +
 
                          "</br>REGION: "+ feature.properties.SUB_REGION +
 
                          "</br>STATE ABBR: "+ feature.properties.STATE_ABBR +
 
                          "</br>POP2010: "+ feature.properties.POP2010.toLocaleString() +
 
                          "</br>Pop 2010 per SQMI: "+ feature.properties.POP10_SQMI.toLocaleString() +
 
                          "</br>Males: "+ feature.properties.MALES.toLocaleString() +
 
                          "</br>Females: "+ feature.properties.FEMALES.toLocaleString() +
 
                          "</br>SQ Miles: "+ feature.properties.SQMI.toLocaleString() +'</p>';
 
 
      layer.bindPopup(popupContent);
 
 
     }
 
     }
  
Line 88: Line 73:
  
 
     var overlayMaps = {
 
     var overlayMaps = {
     "USA":stateLayer,
+
     "Refugia":stateLayer,
     "USAb":stateLayer2,
+
     "Ape range":stateLayer2,
 
     };
 
     };
  

Revision as of 11:12, 25 February 2022