web_lib

Common web application libraries
git clone https://radroots.dev/git/web_lib.git
Log | Files | Refs | LICENSE

commit 3588f7ffc33acd17e39fc558ee80300279865fd6
parent 8ecfc2513e706b45442b35cb4fa92bb13421f57e
Author: triesap <triesap@radroots.dev>
Date:   Sun, 21 Dec 2025 04:19:00 +0000

apps-lib-pwa: set initial map zoom for farms preview card and center on the farm location

Diffstat:
Mapps-lib-pwa/src/lib/components/farm/farms-preview-card.svelte | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/apps-lib-pwa/src/lib/components/farm/farms-preview-card.svelte b/apps-lib-pwa/src/lib/components/farm/farms-preview-card.svelte @@ -28,9 +28,11 @@ let map_center: GeolocationPointTuple = $state([0, 0]); onMount(async () => { - if (basis.location?.point) + map?.setZoom(13); + if (basis.location?.point) { map_center = parse_geol_point_tup(basis.location.point); - if (map) map.setCenter(map_center); + if (map_center && map) map.setCenter(map_center); + } }); const map_geop = $derived(parse_tup_geop_point(map_center));