Difference between revisions of "Test"

From A.P.E.S. wiki
Jump to navigation Jump to search
Line 20: Line 20:
  
 
       // load a tile layer
 
       // load a tile layer
       var topo=new L.tileLayer('http://{s}.tile.opentopomap.org/{z}/{x}/{y}.png',{  
+
       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',{  
+
       L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png',{  
 
             attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'}).addTo(map);
 
             attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'}).addTo(map);
  
 
   // load GeoJSON from an external file
 
   // load GeoJSON from an external file
   $.getJSON("REFUGIA_MALEY96.geojson",function(data){
+
   $.getJSON("usa.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);
Line 32: Line 32:
  
  
  // for Layer Control
+
      var baseMaps = {
 
        "Open Street Map": osm, 
 
        "Open Topo Map": topo, 
 
      };
 
 
 
 
 
      //Add layer control
 
      L.control.layers(baseMaps).addTo(map);
 
 
 
 
     </script>  
 
     </script>  
 
   </body>
 
   </body>
 
</html>
 
</html>

Revision as of 08:43, 25 February 2022