Fix: pass along initial coordinates with the location input, prevents flashing of the ocean; fix #1469

This commit is contained in:
Pieter Vander Vennet 2023-06-18 00:52:26 +02:00
parent 102892ec77
commit 790c2767e2
2 changed files with 4 additions and 3 deletions

View file

@ -83,7 +83,7 @@
<div class="min-h-32 relative h-full cursor-pointer overflow-hidden">
<div class="absolute top-0 left-0 h-full w-full cursor-pointer">
<MaplibreMap {map} />
<MaplibreMap center={({lng: initialCoordinate.lon, lat: initialCoordinate.lat})}} {map} />
</div>
<div

View file

@ -7,8 +7,9 @@
import { onMount } from "svelte"
import { Map } from "@onsvisual/svelte-maps"
import type { Map as MaplibreMap } from "maplibre-gl"
import type { Writable } from "svelte/store"
import type {Readable, Writable} from "svelte/store"
import { AvailableRasterLayers } from "../../Models/RasterLayers"
import {writable} from "svelte/store";
/**
* Beware: this map will _only_ be set by this component
@ -17,7 +18,7 @@
export let map: Writable<MaplibreMap>
export let attribution = false
let center = {}
export let center: Readable<{ lng: number ,lat : number }> = writable({lng: 0, lat: 0})
onMount(() => {
$map.on("load", function () {