| 134069 | return projection; |
| 134070 | } |
| 134071 | function fitExtent(projection, extent, object) { |
| 134072 | return fit(projection, function(b) { |
| 134073 | var w = extent[1][0] - extent[0][0], h = extent[1][1] - extent[0][1], k = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1])), x = +extent[0][0] + (w - k * (b[1][0] + b[0][0])) / 2, y = +extent[0][1] + (h - k * (b[1][1] + b[0][1])) / 2; |
| 134074 | projection.scale(150 * k).translate([ |
| 134075 | x, |
| 134076 | y |
| 134077 | ]); |
| 134078 | }, object); |
| 134079 | } |
| 134080 | function fitSize(projection, size, object) { |
| 134081 | return fitExtent(projection, [ |
| 134082 | [ |