Skip to content

Commit

Permalink
Test new municipalities projected and fix small error with the height…
Browse files Browse the repository at this point in the history
… calc
  • Loading branch information
Lukas Appelhans committed Jan 31, 2017
1 parent ae7cb25 commit 48b0daf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion spam.js
Expand Up @@ -251,8 +251,10 @@
settings.height = settings.height || Math.ceil(dy * settings.width / dx)
settings.projection.scale(0.9 * (settings.width / dx))
.translate([settings.width / 2, settings.height / 2])
} else if (!settings.projected) {
settings.height = Math.ceil(b[1][1] * settings.projectedScale)
} else if (!settings.height) {
settings.height = Math.ceil(dy / 0.9) * settings.projectedScale
settings.height = Math.ceil(dy / 0.9)
}
d3.select(settings.parameters).attr("height", settings.height)

Expand Down
4 changes: 2 additions & 2 deletions test/index.html
Expand Up @@ -31,7 +31,7 @@
}
*/
// TODO queue.js
d3.json("bcn.json", function(error, d) {
d3.json("municipalities.json", function(error, d) {
d3.json("roads.json", function(error, roads) {
topojson.presimplify(d)
topojson.presimplify(roads)
Expand All @@ -43,7 +43,7 @@
element: ".js-map",
projection: null, // TODO how to automagically detect this?
data: [{
features: topojson.feature(d, d.objects["seccio-censal"]),
features: topojson.feature(d, d.objects["municipalities"]),
static: {
prepaint: function(parameters) {
console.log("PRE")
Expand Down
1 change: 1 addition & 0 deletions test/municipalities.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/provinces.json

Large diffs are not rendered by default.

0 comments on commit 48b0daf

Please sign in to comment.