{"id":19688565,"url":"https://github.com/maxvol/geojsonmap","last_synced_at":"2025-04-29T08:34:46.129Z","repository":{"id":41519388,"uuid":"157596579","full_name":"maxvol/GeoJSONMap","owner":"maxvol","description":"Build maps from GeoJSON with MapKit or SpriteKit","archived":false,"fork":false,"pushed_at":"2022-07-03T12:50:41.000Z","size":376,"stargazers_count":14,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-02-27T22:05:37.165Z","etag":null,"topics":["geojson","mapkit","spritekit"],"latest_commit_sha":null,"homepage":"https://medium.com/@maxim.volgin/offline-maps-with-geojsonmap-and-spritekitdsl-608d14db2cf3","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxvol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-14T19:00:29.000Z","updated_at":"2022-10-02T18:12:28.000Z","dependencies_parsed_at":"2022-09-21T11:52:36.625Z","dependency_job_id":null,"html_url":"https://github.com/maxvol/GeoJSONMap","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxvol%2FGeoJSONMap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxvol%2FGeoJSONMap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxvol%2FGeoJSONMap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxvol%2FGeoJSONMap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxvol","download_url":"https://codeload.github.com/maxvol/GeoJSONMap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224158065,"owners_count":17265754,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geojson","mapkit","spritekit"],"created_at":"2024-11-11T18:38:21.404Z","updated_at":"2024-11-11T18:38:22.077Z","avatar_url":"https://github.com/maxvol.png","language":"Swift","readme":"# GeoJSONMap\nBuild maps from GeoJSON with MapKit or SpriteKit.\n\nSpriteKit maps can be displayed offline and/or as planes in ARKit.\n\n![alt Amstertram](https://github.com/maxvol/GeoJSONMap/blob/master/amstertram.jpeg?raw=true)\n\nBasic usage:\n\n```swift\nimport GeoJSONMap\n\nfinal class ViewController: UIViewController {\n    let map = GJMap\u003cViewController\u003e()\n    \n    override func viewDidLoad() {\n        super.viewDidLoad()\n    \n        self.map.delegate = self\n        self.map.add(featureCollection: /* ... */)\n        \n        let mapRect = self.map.boundingMapRect\n        let cgSize = mapRect.size.cgSize\n        let scene = SKScene(size: cgSize)\n        for node in self.map.nodes {\n            scene.addChild(node)\n        }\n        \n        /* use `scene` */\n    }\n}\n\npublic struct Properties: Codable {\n    let prop0: String\n    let prop1: Int?\n}\n\nextension ViewController: GJMapDelegate {\n    typealias P = Properties\n\n    func map(_ map: GJMap\u003cViewController\u003e, nodeFor feature: GJFeature\u003cProperties\u003e) -\u003e SKNode? {\n        let mapRect = self.map.boundingMapRect\n        let cgSize = mapRect.size.cgSize\n        switch feature.geometry {\n        case .point(let coordinate):\n            let point = MKMapPoint(coordinate)\n            guard let cgPoint = try? point.cgPoint(from: mapRect, to: cgSize) else { return nil }\n            let node = SKShapeNode(circleOfRadius: /* ... */)\n            node.position = cgPoint\n            /* ... */\n            return node\n        case .lineString(let coordinates):\n            do {\n                var points = try coordinates.map { try MKMapPoint($0).cgPoint(from: mapRect, to: cgSize) }\n                let node = SKShapeNode(splinePoints: \u0026points, count: points.count)\n                /* ... */\n                return node\n            } catch {\n                print(error)\n                return nil\n            }\n        }\n    }\n}\n```\nCarthage setup.\n\n```\ngithub \"maxvol/GeoJSONMap\" ~\u003e 0.1.2\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxvol%2Fgeojsonmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxvol%2Fgeojsonmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxvol%2Fgeojsonmap/lists"}