block by mpmckenna8 7faae8a06dd746c7ca5d

Reproject d3-carto-map three modes including gnomonic

Full Screen

Trying to make a little page to reproject data using d3.carto jam and it kind of works.

This defaults to a gnomonic projection w/ map.mode(‘globe’) which makes for some rotating cool rotation effects when panning the map rather than just transitioning every path like in projection mode.

Then there’s the boring old transform mode which I think is just mercator.

Please see d3-cart-map readme.md for a little explanation of the map modes (from which ‘globe’ is missing). And show me how to use them correctly.

https://github.com/emeeks/d3-carto-map

Things which could make this a little nicer:

-Adding some graticules maybe not to the feature group.

-Adding different kinds of layers.

-Figure out what the errors are about the paths which get multiplied when panning in globe mode.

For some much cleaner better javascript examples of how to do similar things w/ d3 please see Jason Davies stuff like http://www.jasondavies.com/maps/transition/ and Mike Bostocks stuff like http://bl.ocks.org/mbostock/3711652.

Really I’m just trying to figure out how to kind of do some things they did w/ d3-carto-map.

As always let me know if there is anything silly in my code or how I could make it better.

index.html

projmode.js