{"id":15527120,"url":"https://github.com/fivesheepco/mapitempicker","last_synced_at":"2025-12-11T22:52:34.013Z","repository":{"id":152489680,"uuid":"626049312","full_name":"FiveSheepCo/MapItemPicker","owner":"FiveSheepCo","description":"A simple, yet highly customizable and powerful location picker for SwiftUI.","archived":false,"fork":false,"pushed_at":"2025-01-04T15:30:49.000Z","size":137,"stargazers_count":31,"open_issues_count":2,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T22:42:26.383Z","etag":null,"topics":["ios","mapkit","spm","swift","swift-package-manager","swiftpackage","swiftpackagemanager","swiftui","swiftui-components"],"latest_commit_sha":null,"homepage":"","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/FiveSheepCo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"FiveSheepCo"}},"created_at":"2023-04-10T17:32:10.000Z","updated_at":"2025-03-18T19:54:06.000Z","dependencies_parsed_at":"2025-01-04T21:15:24.822Z","dependency_job_id":null,"html_url":"https://github.com/FiveSheepCo/MapItemPicker","commit_stats":{"total_commits":19,"total_committers":2,"mean_commits":9.5,"dds":"0.052631578947368474","last_synced_commit":"85bde6e0a0fc5f9d293da09da9220b0bf38c06f1"},"previous_names":["fivesheepco/mapitempicker","quintschaf/mapitempicker"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FiveSheepCo%2FMapItemPicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FiveSheepCo%2FMapItemPicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FiveSheepCo%2FMapItemPicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FiveSheepCo%2FMapItemPicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FiveSheepCo","download_url":"https://codeload.github.com/FiveSheepCo/MapItemPicker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249116232,"owners_count":21215142,"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":["ios","mapkit","spm","swift","swift-package-manager","swiftpackage","swiftpackagemanager","swiftui","swiftui-components"],"created_at":"2024-10-02T11:04:32.294Z","updated_at":"2025-12-11T22:52:33.971Z","avatar_url":"https://github.com/FiveSheepCo.png","language":"Swift","funding_links":["https://github.com/sponsors/FiveSheepCo"],"categories":[],"sub_categories":[],"readme":"# MapItemPicker 🗺️📍\n\n[![GithubCI_Status]][GithubCI_URL]\n[![FiveSheep_Badge]](https://fivesheep.co)\n[![LICENSE_BADGE]][LICENSE_URL]\n\nMapItemPicker is a simple, yet highly customizable and powerful location picker for SwiftUI.\n\n\u003cp float=\"left\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/31473326/230954413-98d3428c-69d2-4273-9d49-d0e032fb7173.png\" width=\"200\" alt=\"Sheet for New York City\" /\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/31473326/230954539-8d2efe0c-7762-4572-b805-24c383c57ab7.png\" width=\"200\" alt=\"Search for Airport in Germany\" /\u003e \n  \u003cimg src=\"https://user-images.githubusercontent.com/31473326/230954579-8c47e8ce-1d57-4623-a6de-c615a0dd5c82.png\" width=\"200\" alt=\"Sheet for Central Park\" /\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/31473326/233777851-dc26c6eb-41b4-404e-a9b0-2cf41b967f35.png\" width=\"200\" alt=\"Picker Inside a Full Screen Overlay\" /\u003e\n\u003c/p\u003e\n\n## Description\n\nA lot of apps need some kind of view to find and select locations. Sadly, Apple doesn't offer a view for this in their frameworks and a lot of the information displayed in the Maps app that makes it easy to search for and discover map items is not exposed on `MKMapItem`. MapItemPicker uses data from MapKit, OpenStreetMaps and Wikidata to deliver a simple yet beautiful and comprehensive map item picker.\n\n## Example Code\n\n### Simple Picker\n\n#### Convenience Method\n```Swift\n.mapItemPickerSheet(isPresented: $showsSheet) { mapItem in\n    print(\"Map Item:\", mapItem)\n}\n```\n\n#### Customizable View\n```Swift\n.fullScreenCover(isPresented: $showsSheet) {\n    NavigationView {\n        MapItemPicker(\n            primaryMapItemAction: .init(\n                title: \"select\",\n                imageName: \"checkmark.circle.fill\",\n                handler: { mapItem in\n                    print(\"Map Item:\", mapItem)\n                    return true\n                }\n            )\n        )\n        .toolbar {\n            ToolbarItem(placement: .navigationBarLeading) {\n                Button(\"cancel\") {\n                    showsSheet = false\n                }\n            }\n        }\n        .navigationTitle(Text(\"select\"))\n        .navigationBarTitleDisplayMode(.inline)\n        .toolbarBackground(.visible, for: .navigationBar)\n    }\n}\n```\n\n### Advanced Map View with Configured Standard View\n\n```Swift\nMapItemPicker(\n    annotations: [MKPointAnnotation.chicago],\n    annotationView: { annotation in\n        MKMarkerAnnotationView(annotation: annotation, reuseIdentifier: nil)\n    },\n    annotationSelectionHandler: { annotation in\n        print(\"selected:\", annotation)\n    },\n    overlays: [MKPolyline.newYorkToLosAngeles],\n    overlayRenderer: { overlay in\n        MKPolylineRenderer(polyline: overlay as! MKPolyline, color: .red)\n    },\n    primaryMapItemAction: .init(title: \"select\", imageName: \"checkmark.circle.fill\", handler: { mapItem in\n        print(\"Map Item:\", mapItem)\n        return true\n    }),\n    additionalMapItemActions: [\n        .init(\n            title: \"addTo\",\n            imageName: \"plus.square\",\n            subActions: [\n                .init(title: \"Collection A\", imageName: \"square.on.square\", handler: { mapItem in return false }),\n                .init(title: \"Collection B\", imageName: \"square.on.square\", handler: { mapItem in return false })\n            ]\n        )\n    ],\n    showsLocationButton: false,\n    additionalTopRightButtons: [\n        .init(\n            imageName: \"magnifyingglass\",\n            handler: { searchControllerShown = true }\n        )\n    ],\n    initialRegion: MKCoordinateRegion.unitedStates,\n    standardView: { Text(\"Standard View\") },\n    searchControllerShown: $searchControllerShown,\n    standardSearchView: { Text(\"Search View\") }\n)\n```\n\n## Localization\n\nMapItemPicker contains localizations for categories, titles of sections in the views and other strings. Currently, only English and German are supported. If you can provide localization for any other language, please submit a PR. You can copy the strings from the English `Localizable.strings` file at `Sources/MapItemPicker/Resources/en.lproj`. It's not a lot of localization keys, you will propably be done in 5 minutes.\n\n## TODO\n\n- [ ] A lot of MapItems currently have a type of simply 'Location' (Localization Key 'mapItem.type.item') before loading Wikidata and/or OpenStreetMaps data. This includes cities, mountains and other items for which Apple doesn't provide a `MKPointOfInterestCategory` and should be resolved.\n- [ ] Add more datasources. This can be free ones like Wikidata and OpenStreetMaps, as well as paid ones for which each application can provide their own API key.\n- [ ] Add the ability to edit opening hours etc. and report back to OpenStreetMaps\n- [ ] Add more filters like \"Is Open\" in Search\n- [ ] Add Unit Tests\n- [ ] Add example App with UI Tests\n- [ ] Compile Documentation\n\n\u003c!-- References --\u003e\n\n[GithubCI_Status]: https://github.com/FiveSheepCo/MapItemPicker/actions/workflows/ci.yml/badge.svg?branch=main\n[GithubCI_URL]: https://github.com/FiveSheepCo/MapItemPicker/actions/workflows/ci.yml\n[FiveSheep_Badge]: https://badgen.net/badge/Built%20and%20maintained%20by/FiveSheep/cyan\n[LICENSE_BADGE]: https://badgen.net/github/license/FiveSheepCo/MapItemPicker\n[LICENSE_URL]: https://github.com/FiveSheepCo/MapItemPicker/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffivesheepco%2Fmapitempicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffivesheepco%2Fmapitempicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffivesheepco%2Fmapitempicker/lists"}