A simple map example created with d3.carto.map that loads a single geoJSON layer.
forked from emeeks's block: Simple Map - d3.carto
xxxxxxxxxx
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<title>d3.carto - Basic d3.carto Map</title>
<meta charset="utf-8" />
<link type="text/css" rel="stylesheet" href="d3map.css" />
</head>
<style>
html,body {
height: 100%;
width: 100%;
margin: 0;
}
#map {
height: 100%;
width: 100%;
position: absolute;
}
.country {
fill-opacity: 1;
fill: #4682B4;
stroke-opacity: 1;
stroke: black;
stroke-width: 2px;
}
</style>
<script>
function makeSomeMaps() {
map = d3.carto.map();
d3.select("#map").call(map);
countryLayer = d3.carto.layer.geojson();
countryLayer.path("world.geojson")
.label("Countries")
.renderMode("svg")
.cssClass("country")
.clickableFeatures(true);
map.addCartoLayer(countryLayer);
map.setScale(2);
}
</script>
<body onload="makeSomeMaps()">
<div id="map"></div>
<footer>
<script src="https://d3js.org/d3.v3.min.js" charset="utf-8" type="text/javascript"></script>
<script src="https://cdn.jsdelivr.net/gh/emeeks/d3-carto-map/d3.carto.map.js" type="text/javascript">
</script>
</footer>
</body>
</html>
Modified http://d3js.org/d3.v3.min.js to a secure url
Updated missing url https://rawgit.com/emeeks/d3-carto-map/master/d3.carto.map.js to https://cdn.jsdelivr.net/gh/emeeks/d3-carto-map/d3.carto.map.js
https://d3js.org/d3.v3.min.js
https://rawgit.com/emeeks/d3-carto-map/master/d3.carto.map.js