Difference between revisions of "Test"

From A.P.E.S. wiki
Jump to navigation Jump to search
Line 17: Line 17:
 
      
 
      
 
     <script>
 
     <script>
      var map = L.map('map').setView([10, 5], 5);
 
  
      // load a tile layer
+
  // initialize the map
      L.tileLayer('http://{s}.tile.opentopomap.org/{z}/{x}/{y}.png',{  
+
  var map = L.map('map').setView([42.35, -71.08], 13);
            attribution: '&copy; <a href="http://osm.org/copyright">OpenTopoMap</a> contributors'}).addTo(map);
+
 
      L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png',{
+
  // load a tile layer
            attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'}).addTo(map);
+
  L.tileLayer('http://tiles.mapc.org/basemap/{z}/{x}/{y}.png',
 +
    {
 +
      attribution: 'Tiles by <a href="http://mapc.org">MAPC</a>, Data by <a href="http://mass.gov/mgis">MassGIS</a>',
 +
      maxZoom: 17,
 +
      minZoom: 9
 +
    }).addTo(map);
  
 
   // load GeoJSON from an external file
 
   // load GeoJSON from an external file
   $.getJSON("usa.geojson",function(data){
+
   $.getJSON("rodents.geojson",function(data){
 
     // add GeoJSON layer to the map once the file is loaded
 
     // add GeoJSON layer to the map once the file is loaded
 
     L.geoJson(data).addTo(map);
 
     L.geoJson(data).addTo(map);

Revision as of 08:44, 25 February 2022