us map in d3.js

us map in d3.js





// Create the map
var map = new L.Map('map');

// Set the view to center on the US
map.setView([39.833333, -98.583333], 4);

// Set up the OSM layer
L.tileLayer(
  'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
    attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
  }).addTo(map);

// Add a GeoJSON layer
L.geoJson(statesData).addTo(map);


Subscribe to The Poor Coder | Algorithm Solutions

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
[email protected]
Subscribe