I have a JSON file that d3 map is not rendering an Australia TopoJSON file I have created.
The same code renders an American map just fine. There are no errors in the browser inspector and both maps render fine on online visualisation sites like geojson.io.
I have provided links to the JSON's.
- Australian TopoJSON Does not work with my code (but does work on geojson.io/#map=4/-27.97/125.22 )
- American TopoJSON Does work with my code
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<style>
path {
fill: #ccc;
}
</style>
</head>
<body>
<h1>topojson simplified Australia</h1>
<script>
var width = window.innerWidth,
height = window.innerHeight;
var path = d3.geo.path();
var svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height);
d3.json("topo-australia-simplified.json", function(error, topology) {
if (error) throw error;
svg.selectAll("path")
.data(topojson.feature(topology, topology.objects.australia).features)
.enter().append("path")
.attr("d", path);
});
</script>
</body>
</html>