This is an attempt to get Leaflet working with D3’s Albers USA projection.
This first stab works deceptively well: the coordinates are at least self-consistent, so centering, panning and zooming work as expected. There are some problems, though:
d3.geo.albersUsa()
projection appears to return null
for coordinates that don’t fall within its parallels, which Leaflet doesn’t like.NaN
s and fails.scale(.25)
is a stab in the dark that makes the US approximately the right size at zoom 3, but is most certainly wrong.In general, it’s not clear whether we should be transforming D3’s projection (which, according to the docs, doesn’t support translation anyway) or Leaflet’s transformation (currently a noop).