Commit aa4510b
committed
Fix geo projections losing their D3 default rotation
Geo.updateProjection unconditionally called
projection.rotate([-rotation.lon, -rotation.lat, rotation.roll]), so the
default projection.rotation attributes ([0, 0, 0]) discarded the rotation
the d3 projection factory ships with. Six projections are affected
(albers, bertin1953, gringorten and peirce quincuncial, sinu mollweide,
wiechel).
Capture the factory rotation when the projection wrapper is created and
compose the user rotation on top of it. Projections whose d3 default is
the identity are bit-for-bit unchanged; an explicit rotation now rotates
relative to the projection's canonical orientation instead of replacing
it.
Fixes #79491 parent 95bfea1 commit aa4510b
2 files changed
Lines changed: 47 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
308 | 312 | | |
309 | 313 | | |
310 | 314 | | |
| |||
716 | 720 | | |
717 | 721 | | |
718 | 722 | | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
719 | 729 | | |
720 | 730 | | |
721 | 731 | | |
| |||
754 | 764 | | |
755 | 765 | | |
756 | 766 | | |
| 767 | + | |
| 768 | + | |
757 | 769 | | |
758 | 770 | | |
759 | 771 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2876 | 2876 | | |
2877 | 2877 | | |
2878 | 2878 | | |
| 2879 | + | |
| 2880 | + | |
| 2881 | + | |
| 2882 | + | |
| 2883 | + | |
| 2884 | + | |
| 2885 | + | |
| 2886 | + | |
| 2887 | + | |
| 2888 | + | |
| 2889 | + | |
| 2890 | + | |
| 2891 | + | |
| 2892 | + | |
| 2893 | + | |
| 2894 | + | |
| 2895 | + | |
| 2896 | + | |
| 2897 | + | |
| 2898 | + | |
| 2899 | + | |
| 2900 | + | |
| 2901 | + | |
| 2902 | + | |
| 2903 | + | |
| 2904 | + | |
| 2905 | + | |
| 2906 | + | |
| 2907 | + | |
| 2908 | + | |
| 2909 | + | |
| 2910 | + | |
| 2911 | + | |
| 2912 | + | |
0 commit comments