Forked from https://gist.github.com/mbostock/4408297
xxxxxxxxxx
<meta charset="utf-8">
<style>
path {
stroke-linejoin: round;
}
.land {
fill: #ddd;
}
.states {
fill: none;
stroke: #fff;
}
</style>
<body>
<script src="//d3js.org/d3.v3.min.js"></script>
<script src="//d3js.org/queue.v1.min.js"></script>
<script src="//d3js.org/topojson.v1.min.js"></script>
<script>
var width = 960,
height = 500;
var projection = d3.geo.mercator()
.scale(75000)
.rotate([74.0712581087617,-4.61742011111319])
.translate([width / 2, height / 2]);
var path = d3.geo.path()
.projection(projection)
.pointRadius(1.5);
var svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height);
queue()
.defer(d3.json, "bogota_d.topo.json")
.defer(d3.json, "colegios.topo.json")
.await(ready);
var g = svg.append("g");
function ready(error, us, airports) {
if (error) throw error;
/*svg.append("path")
.datum(topojson.feature(us, us.objects.land))
.attr("class", "land")
.attr("d", path);*/
/*svg.append("path")
.datum(topojson.mesh(us, us.objects.states, function(a, b) { return a !== b; }))
.attr("class", "states")
.attr("d", path);*/
g.selectAll("path")
.data(topojson.feature(us, us.objects.states).features)
.enter().append("path")
.attr("d", path)
.attr("class", "land")
;
g.append("path")
.datum(topojson.mesh(us, us.objects.states, function(a, b) { return a !== b; }))
.attr("class", "states")
.attr("d", path);
g.append("path")
.datum(topojson.feature(airports, airports.objects.colegios))
.attr("class", "points")
.attr("d", path);
}
</script>
https://d3js.org/d3.v3.min.js
https://d3js.org/queue.v1.min.js
https://d3js.org/topojson.v1.min.js