-
In TypeScript, with this: const sphere = { type: 'Sphere' }
const projection = projectionFunction().fitWidth(width, sphere)
const pathGenerator = geoPath(projection)
const bounds = pathGenerator.bounds(sphere) I get an error for the line const sphere: {
type: string;
}
Argument of type '{ type: string; }' is not assignable to parameter of type 'GeoPermissibleObjects'.
Property 'geometries' is missing in type '{ type: string; }' but required in type 'ExtendedGeometryCollection<GeoGeometryObjects>'.ts(2345)
index.d.ts(48, 5): 'geometries' is declared here. I can satisfy the type by doing: const sphere = { type: 'Sphere', geometries: {} as GeoGeometryObjects[] } But what is the proper way to create the Thanks. |
Beta Was this translation helpful? Give feedback.
Answered by
Fil
Jan 11, 2022
Replies: 1 comment 1 reply
-
The typings are wrong if they forget that specific case of {type: "Sphere"} which doesn't have a geometries prop. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
fnick851
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The typings are wrong if they forget that specific case of {type: "Sphere"} which doesn't have a geometries prop.