From a1f0518d0cd123a791adde64f4f11bd8e44276c7 Mon Sep 17 00:00:00 2001 From: ivar Date: Mon, 20 Oct 2025 00:26:34 +0200 Subject: Initial commit --- "ios/H\303\246-appen/ClusterHit.swift" | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 "ios/H\303\246-appen/ClusterHit.swift" (limited to 'ios/Hæ-appen/ClusterHit.swift') diff --git "a/ios/H\303\246-appen/ClusterHit.swift" "b/ios/H\303\246-appen/ClusterHit.swift" new file mode 100644 index 0000000..ebab096 --- /dev/null +++ "b/ios/H\303\246-appen/ClusterHit.swift" @@ -0,0 +1,18 @@ +// +// ClusterHit.swift +// Hæ-appen +// +// Created by Ivar Løvlie on 16/09/2025. +// +import GISTools +import WebKit + +struct ClusterHit : Decodable { } + +final class ClusterProvider { + func load(west:Int, south: Int, north: Int, east: Int) async throws -> [ClusterHit] { + let url = URL(string: "http://http://localhost:5281/places?w=\(west)&e=\(east)&s=\(south)&n=\(north)")! + let (data, _) = try await URLSession.shared.data(from: url) + return try JSONDecoder().decode([ClusterHit].self, from: data) + } +} -- cgit v1.3