Reference · Framing, geometry and quiz tools
ChizuProjectiontype
How a map's canvas was made from the earth, enough to put a longitude and latitude on it (projectPoint):
Miller's cylindrical projection round a centre longitude (the world), a Lambert azimuthal equal-area
projection round a centre (one country on its own), or, for a city or a single venue (localMap), a transverse
Mercator on the WGS 84 ellipsoid round a centre (radius is its rectifying radius, in metres), a unit of the canvas being
metresPerUnit metres.
Import it
import type { ChizuProjection } from "@johnmorrisdotca/chizu";
Definition
type ChizuProjection = {
kind: "miller";
centre: number;
scale: number;
translate: [
number,
number
];
} | {
kind: "azimuthal-equal-area";
centre: [
number,
number
];
scale: number;
translate: [
number,
number
];
} | {
kind: "local";
centre: [
number,
number
];
radius: number;
metresPerUnit: number;
translate: [
number,
number
];
} | {
kind: "other";
description: string;
};
Examples
import WORLD from "@johnmorrisdotca/chizu/world";
import type { ChizuProjection } from "@johnmorrisdotca/chizu";
const projection: ChizuProjection = WORLD.projection;
console.log(projection.kind, projection.kind === "miller" ? projection.centre : "");
// miller 155miller 155What it prints (run when this page was built)