summaryrefslogtreecommitdiffstats
path: root/ios/Hæ-appen/ClusterHit.swift
blob: ebab096c99859e694770988aa1ee5e137a83edd4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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)
    }
}