Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing method? #64

Closed
ChrisBAshton opened this issue Oct 25, 2016 · 1 comment
Closed

Missing method? #64

ChrisBAshton opened this issue Oct 25, 2016 · 1 comment

Comments

@ChrisBAshton
Copy link

Apologies in advance if I've misunderstood something or logged this issue in the wrong place!

I've built numerous pan-and-zoom maps before, all of which used either the mercator or albers projections (I should also point out at this point that I'm using v3, not v4, of d3): https://github.com/d3/d3-3.x-api-reference/blob/master/Geo-Projections.md

I'm now trying to build a US map, and switched to the albersUsa projection. All of a sudden, my map code is giving me lots of errors, and it suggests that there is a missing method in the albersUsa projection?

this.projection = d3.geo.albers() // `albers` is ok, `albersUsa` is not!
            .scale(this.mapModel.get('mapScale'))
            .translate(this.mapModel.get('translate'));

// ...a while later:

let bounds = [0,0]; // just for this example
const coords = this.projection(bounds);

In the albers projection, coords comes out as [2065.4195284613525, 73.63503703113963]. But if I switch to albersUsa, coords comes out as null.

Any advice would be much appreciated! Thanks

@mbostock
Copy link
Member

As a fixed composite projection, d3.geoAlbersUsa does not support the following projection methods: projection.center, projection.rotate, projection.clipAngle, projection.clipExtent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants