maplair
Version:
JavaScript library for mobile-friendly interactive maps
23 lines (22 loc) • 677 B
JavaScript
import { Transformation } from "../../geometry/Transformation.js";
import { CRS } from "./CRS.js";
import { LonLat } from "../projection/Projection.LonLat.js";
//#region src/geo/crs/SimpleCRS.js
var SimpleCRS = class extends CRS {
static projection = LonLat;
static transformation = new Transformation(1, 0, -1, 0);
static scale(zoom) {
return 2 ** zoom;
}
static zoom(scale) {
return Math.log(scale) / Math.LN2;
}
static distance(latlng1, latlng2) {
const dx = latlng2.lng - latlng1.lng, dy = latlng2.lat - latlng1.lat;
return Math.sqrt(dx * dx + dy * dy);
}
static infinite = true;
};
//#endregion
export { SimpleCRS };
//# sourceMappingURL=SimpleCRS.js.map