Reference · Markers on the globe
nearbyfunction
A place made less exact: put on a grid about km kilometres across, so a reader's own place can be drawn without saying their street. Use it on what the browser's location gives before
it is drawn or kept.
Import it
import { nearby } from "@johnmorrisdotca/chikyu-earth/markers";
Definition
function nearby(point: GeoPoint, km?: number): GeoPoint
Parameters
| Name | Type | Description |
|---|---|---|
point | GeoPoint | Longitude and latitude in degrees. |
km (optional) | number | The grid's size in kilometres (10). |
Returns
GeoPoint
The point on the grid, to four decimals.
Examples
import { nearby } from "@johnmorrisdotca/chikyu-earth/markers";
console.log(nearby({ lon: -79.38321, lat: 43.65348 }));{ lon: -79.3423, lat: 43.6579 }What it prints (run when this page was built)