Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8944398

Browse files
Rename shadowed variable
1 parent 765b549 commit 8944398

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎topojson/bin/process_geodata.mjs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,22 +106,22 @@ function pruneProperties(topojson) {
106106
function getCentroid(feature) {
107107
const { type } = feature.geometry;
108108
const projection = geoIdentity();
109-
const path = geoPath(projection);
109+
const geoPathGenerator = geoPath(projection);
110110

111111
if (type === 'MultiPolygon') {
112112
let maxArea = -Infinity;
113113

114114
for (const coordinates of feature.geometry.coordinates) {
115115
const polygon = { type: 'Polygon', coordinates };
116-
const area = path.area(polygon);
116+
const area = geoPathGenerator.area(polygon);
117117
if (area > maxArea) {
118118
maxArea = area;
119119
feature = polygon;
120120
}
121121
}
122122
}
123123

124-
return path.centroid(feature).map((coord) => +coord.toFixed(2));
124+
return geoPathGenerator.centroid(feature).map((coord) => +coord.toFixed(2));
125125
}
126126

127127
async function createCountriesLayer({ bounds, filter, name, resolution, source }) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /