feat: use runes
This commit is contained in:
parent
e92291eb2e
commit
6b385de4c5
1 changed files with 9 additions and 5 deletions
|
@ -5,15 +5,19 @@
|
||||||
|
|
||||||
import "leaflet/dist/leaflet.css";
|
import "leaflet/dist/leaflet.css";
|
||||||
|
|
||||||
export let data: PageData;
|
interface Props {
|
||||||
|
data: PageData;
|
||||||
|
}
|
||||||
|
|
||||||
|
let { data }: Props = $props();
|
||||||
|
|
||||||
const lignes = data.lines;
|
const lignes = data.lines;
|
||||||
const params = $page.url.searchParams;
|
const params = $page.url.searchParams;
|
||||||
|
|
||||||
const center = L.latLng(45.75388713, 4.84715287);
|
const center = L.latLng(45.75388713, 4.84715287);
|
||||||
|
|
||||||
let latlng = L.latLng(0, 0);
|
let latlng = $state(L.latLng(0, 0));
|
||||||
$: distance = Math.max(0, latlng.distanceTo(center) - 20);
|
let distance = $derived(Math.max(0, latlng.distanceTo(center) - 20));
|
||||||
$: points = 5000 * Math.exp(-distance / 750);
|
let points = $derived(5000 * Math.exp(-distance / 750));
|
||||||
|
|
||||||
function createMap(node: HTMLElement) {
|
function createMap(node: HTMLElement) {
|
||||||
const bbox = lignes.bbox || [0, 0, 0, 0];
|
const bbox = lignes.bbox || [0, 0, 0, 0];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue