我正在尝试在 topojson 中实现我的第一个地图。
我将形状文件转换为 GeoJson,然后转换为 topojson。   
当我运行下面的代码时,我在文件中收到Uncaught TypeError: Cannot read property 'type' of null错误。D3.js
var width = 960,
      height = 1160;
  var svg = d3.select("#visualize").append("svg")
      .attr("width", width)
      .attr("height", height);
var color = d3.scale.linear()
    .domain([-20, 0, 20, 40])
    .range(["blue", "green", "yellow", "red"]);
  d3.json(base_url+"assets/m4k/party_perfomance/lok15_final.json", function(error, lok) {
        console.log(lok)
        var subunits = topojson.feature(lok, lok.objects.lok15);
        var projection = d3.geo.mercator()
                                    .scale(500)
                                    .translate([width / 2, height / 2]);
        var path = d3.geo.path().projection(projection);
        svg.append("path")
            .datum(subunits)
            .attr("d", path);
  });
您可以在此处查看代码和 topojson 文件