MapItemPicker is a simple, yet highly customizable and powerful location picker for SwiftUI.
Description
A 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.
Example Code
Simple Picker
Convenience Method
.mapItemPickerSheet(isPresented: $showsSheet) { mapItem in
print("Map Item:", mapItem)
}
MapItemPicker 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.
TODO
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.
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.
Add the ability to edit opening hours etc. and report back to OpenStreetMaps
MapItemPicker 🗺️📍
MapItemPicker is a simple, yet highly customizable and powerful location picker for SwiftUI.
Description
A 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.Example Code
Simple Picker
Convenience Method
Customizable View
Advanced Map View with Configured Standard View
Localization
MapItemPicker 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 atSources/MapItemPicker/Resources/en.lproj
. It’s not a lot of localization keys, you will propably be done in 5 minutes.TODO
MKPointOfInterestCategory
and should be resolved.