Reference · Markers on the globe
readPlacesfunction
Read the places attribute: a JSON array of places (see cleanPlaces). Anything that is not JSON is no places.
Import it
import { readPlaces } from "@johnmorrisdotca/chikyu-earth/markers";
Definition
function readPlaces(value: string | null | undefined): Place[]
Parameters
| Name | Type | Description |
|---|---|---|
value | string | null | undefined | The attribute's text, or null. |
Returns
Place[]
The places to draw.
Examples
import { readPlaces } from "@johnmorrisdotca/chikyu-earth/markers";
console.log(readPlaces('[{"id":"me","lon":-79.4,"lat":43.7,"kind":"here"}]'));[ { id: 'me', lon: -79.4, lat: 43.7, kind: 'here' } ]What it prints (run when this page was built)