Reference · Markers on the globe
readHereCityfunction
Read the here-city attribute. Absent, off, or anything that is not a positive number of kilometres: off (false).
Present with no value, or on: HERE_CITY_KM. A positive number: that many kilometres, at most HERE_CITY_MAX_KM.
Import it
import { readHereCity } from "@johnmorrisdotca/chikyu-earth/markers";
Definition
function readHereCity(value: string | null | undefined): false | number
Parameters
| Name | Type | Description |
|---|---|---|
value | string | null | undefined | The attribute's text, or null when it is not set. |
Returns
number | false
false when the marker keeps the page's label, or the kilometre limit.
Examples
import { HERE_CITY_KM, readHereCity } from "@johnmorrisdotca/chikyu-earth/markers";
console.log(readHereCity(null), readHereCity(""), readHereCity("40"), readHereCity("off"), HERE_CITY_KM);false 100 40 false 100What it prints (run when this page was built)