A modified conic conformal projection that shows the Canary Islands next to the Iberian Peninsula so working with data in Spain becomes easier.
forked from rveciana's block: conicConformalSpain
xxxxxxxxxx
<meta charset="utf-8">
<style>
.land {
fill: #222;
}
.county-boundary {
fill: none;
stroke: #fff;
stroke-width: .5px;
}
.state-boundary {
fill: none;
stroke: #fff;
}
.border {
stroke: #000;
fill: none;
}
</style>
<body>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://d3js.org/d3-geo.v1.min.js"></script>
<script src="https://d3js.org/topojson.v1.min.js"></script>
<script src="./d3-composite-projections.js"></script>
<script>
var width = 900,
height = 500;
var projection = d3.geoConicConformalSpain();
var path = d3.geoPath()
.projection(projection);
var svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height);
d3.json("https://cdn.rawgit.com/rveciana/5919944/raw//provincias.json", function(error, provincias) {
var land = topojson.feature(provincias, provincias.objects.provincias);
svg.selectAll("path")
.data(land.features)
.enter()
.append("path")
.attr("d", path);
svg.append("path")
.attr("class","border")
.attr("d", projection.getCompositionBorders());
});
d3.select(self.frameElement).style("height", height + "px");
</script>
Modified http://d3js.org/d3.v4.min.js to a secure url
Modified http://d3js.org/topojson.v1.min.js to a secure url
https://d3js.org/d3.v4.min.js
https://d3js.org/d3-geo.v1.min.js
https://d3js.org/topojson.v1.min.js