// @ts-ignore const html = require("yo-yo"); const mapboxgl = require("mapbox-gl"); const startMapService = require("./"); startMapService("./sw.js"); const root = html`
`; document.body.appendChild(root); const values = { accessToken: "pk.eyJ1IjoiZGlnaWRlbSIsImEiOiJuM3FabmNFIn0._gF6262MSzePWUChu4S9PA", longitude: 0, latitude: 0, zoom: 0, style: "mapbox://styles/mapbox/outdoors-v11", width: 300, height: 300, pixelRatio: window.devicePixelRatio, }; /** @param {{id: keyof typeof values, type?: string}} options */ const input = ({ id, type = "text" }) => { /** @param {{target: HTMLInputElement}} event */ function handleInput({ target }) { if (!target || target.value === "") return; // @ts-ignore values[id] = type === "number" ? target.valueAsNumber : target.value; updateMap(); } return html`