Iam trying to create a map over my country but it is always zoomed out.
I have seen a lot of maps where they manage to zoom into country with projection, but where do they get the numbers for the projection? Im so confused..
examples: http://bl.ocks.org/mbostock/9265674 http://bl.ocks.org/mbostock/5413933
Current code:
var width = 960,
height = 500;
// 11°E 64.4°N - latitude and
var projection = d3.geo.mercator();
var path = d3.geo.path()
.projection(projection);
var svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height);
d3.json("topojson/fylker.json", function(error, norge) {
norge = norge;
for(var i = 0; i < norge.objects.fylker.geometries.length; i++) {
svg.append("path")
.datum(topojson.feature(norge, norge.objects.fylker.geometries[i]))
.attr("d", path)
.attr("class", function(d) { return "county-" + d.id; });
}
});