We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 765b549 commit 8944398Copy full SHA for 8944398
topojson/bin/process_geodata.mjs
@@ -106,22 +106,22 @@ function pruneProperties(topojson) {
106
function getCentroid(feature) {
107
const { type } = feature.geometry;
108
const projection = geoIdentity();
109
- const path = geoPath(projection);
+ const geoPathGenerator = geoPath(projection);
110
111
if (type === 'MultiPolygon') {
112
let maxArea = -Infinity;
113
114
for (const coordinates of feature.geometry.coordinates) {
115
const polygon = { type: 'Polygon', coordinates };
116
- const area = path.area(polygon);
+ const area = geoPathGenerator.area(polygon);
117
if (area > maxArea) {
118
maxArea = area;
119
feature = polygon;
120
}
121
122
123
124
- return path.centroid(feature).map((coord) => +coord.toFixed(2));
+ return geoPathGenerator.centroid(feature).map((coord) => +coord.toFixed(2));
125
126
127
async function createCountriesLayer({ bounds, filter, name, resolution, source }) {
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments