{"id":15055339,"url":"https://github.com/lukepistrol/lpmapview","last_synced_at":"2025-09-05T16:12:14.428Z","repository":{"id":65149513,"uuid":"583172649","full_name":"lukepistrol/LPMapView","owner":"lukepistrol","description":"A SwiftUI wrapper for a MKMapView","archived":false,"fork":false,"pushed_at":"2023-09-16T18:44:40.000Z","size":4951,"stargazers_count":19,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T04:51:36.733Z","etag":null,"topics":["mapkit","maps","spm","swift","swift-package","swift-package-manager","swiftui"],"latest_commit_sha":null,"homepage":"https://lukepistrol.github.io/LPMapView/documentation/lpmapview","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/lukepistrol.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},"funding":{"github":"lukepistrol","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["buymeacoffee.com/lukeeep"]}},"created_at":"2022-12-29T01:32:18.000Z","updated_at":"2025-02-16T08:33:24.000Z","dependencies_parsed_at":"2025-02-16T11:32:33.134Z","dependency_job_id":"fbf66043-3aed-4333-b640-3418274f8378","html_url":"https://github.com/lukepistrol/LPMapView","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukepistrol%2FLPMapView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukepistrol%2FLPMapView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukepistrol%2FLPMapView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukepistrol%2FLPMapView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukepistrol","download_url":"https://codeload.github.com/lukepistrol/LPMapView/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248153613,"owners_count":21056468,"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":["mapkit","maps","spm","swift","swift-package","swift-package-manager","swiftui"],"created_at":"2024-09-24T21:41:00.859Z","updated_at":"2025-04-10T03:36:48.302Z","avatar_url":"https://github.com/lukepistrol.png","language":"Swift","funding_links":["https://github.com/sponsors/lukepistrol","buymeacoffee.com/lukeeep","https://www.buymeacoffee.com/lukeeep"],"categories":[],"sub_categories":[],"readme":"\u003cp\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Swift-5.7-f05318.svg\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/iOS-\u003e= 14.0-blue.svg\" /\u003e\n  \u003cimg alt=\"GitHub\" src=\"https://img.shields.io/github/license/lukepistrol/lpmapview\"\u003e\n  \u003ca href=\"https://twitter.com/lukeeep_\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Twitter-@lukeeep_-1e9bf0.svg?style=flat\" alt=\"Twitter: @lukeeep_\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n# LPMapView\n\n\u003e 📖 See the full documentation [here](https://lukepistrol.github.io/LPMapView/documentation/lpmapview).\n\nA **SwiftUI** wrapper for `MKMapView`.\n\n## Overview\n\nThis offers a couple more features compared to `SwiftUI.Map`.\n\n## Usage (iOS 16)\n\n```swift\n@State private var coordinateRegion: MKCoordinateRegion = ...\n@State private var items: [MapViewAnnotation] = ...\n\nMapView(\n  region: $coordinateRegion, \n  showsUserLocation: false,\n  userTrackingMode: .none,\n  annotations: $items\n)\n.mapDisplayRoute() // connect annotations with lines\n.mapRouteStyle(.dashed(5, tint: .red) // Use a dashed line\n.mapAnnotations(.visible, tint: .mint) // show annotations with custom tint\n.mapConfiguration(.hybrid) // use the hybrid map style\n```\n\nThe above example usage would deliver a map view similar to this one:\n\n![map-preview](./Sources/LPMapView/Documentation.docc/Resources/map-preview.png)\n\n## Usage (iOS 14 \u0026 15)\n\n```swift\n@State private var coordinateRegion: MKCoordinateRegion = ...\n@State private var items: [MapViewAnnotation] = ...\n\nLMapView(\n  region: $coordinateRegion, \n  showsUserLocation: false,\n  userTrackingMode: .none,\n  annotations: $items\n)\n.mapDisplayRoute() // connect annotations with lines\n.mapRouteStyle(.dashed(5, tint: .red) // Use a dashed line\n.mapAnnotations(.visible, tint: .mint) // show annotations with custom tint\n.mapConfiguration(.hybrid) // use the hybrid map style\n```\n\n## Modifiers\n\nThere are a couple of modifiers available for configuring additional\noptions for the map view.\n\n### mapDisplayRoute\n\n#### Declaration\n\n```swift\nfunc mapDisplayRoute(\n  _ visibility: MapViewVisibility = .visible\n) -\u003e some View\n```\n\n#### Parameters\n\n- `visibility`: Whether or not the route will be visible.\n\n---\n\n### mapRouteStyle\n\n#### Declaration\n\n```swift\nfunc mapRouteStyle(_ style: MapRouteStyle) -\u003e some View\n```\n\n#### Parameters\n\n- `style`: The route line style to use.\n\n---\n\n### mapAnnotations\n\n#### Declaration\n\n```swift\nfunc mapAnnotations(\n  _ visibility: MapViewVisibility = .visible, \n  tint: Color = .red, \n  calloutEnabled: Bool = false, \n  fitInVisibleRect: Bool = false,\n  animated: Bool = true\n) -\u003e some View\n```\n\n#### Parameters\n\n- `visibility`: Whether or not annotations will be visible.\n- `tint`: The default tint color of the annotation. This can\nbe overridden by setting ``MapViewAnnotation/tint`` on\n``MapViewAnnotation``.\n- `calloutEnabled`: Whether or not to show a detail callout\nwhen an annotation is selected. Note that this will only\nwork if the annotation has a title.\n- `fitInVisibleRect`: Whether or not to automatically adjust\nmap zoom to fit all annotations.\n- `animated`: Whether or not to animate changes.\n\n---\n\n### mapConfiguration\n\n#### Declaration\n\n```swift\nfunc mapConfiguration(\n  _ configuration: MapViewConfiguration, \n  elevationStyle: MKMapConfiguration.ElevationStyle = .flat, // iOS 16 only\n  poiFilter: MKPointOfInterestFilter = .includingAll,\n  selectableFeatures: MKMapFeatureOptions = [] // iOS 16 only\n) -\u003e some View\n```\n\n#### Parameters\n\n- `configuration`: A configuration option defining the map\nstyle.\n- `elevationStyle`: Defines how elevation data is handled\nwhen rendering the map view.\n- `poiFilter`: A filter that includes or excludes point of\ninterest categories from a map view, local search, or local\nsearch completer.\n- `selectableFeatures`: Describes which selectable features\nthe map responds to.\n\n---\n\n### mapUserInteraction\n\n#### Declaration\n\n```swift\nfunc mapUserInteraction(\n  zoom: Bool = true, \n  scroll: Bool = true, \n  pitch: Bool = true, \n  rotate: Bool = true\n) -\u003e some View\n```\n\n#### Parameters\n\n- `zoom`: A Boolean value that determines whether the user may\nuse pinch gestures to zoom in and out of the map.\n- `scroll`: A Boolean value that determines whether the user\nmay scroll around the map.\n- `pitch`: A Boolean value that indicates whether the map uses\nthe camera’s pitch information.\n- `rotate`: A Boolean value that indicates whether the map uses\nthe camera’s heading information.\n\n---\n\n\u003ca href=\"https://www.buymeacoffee.com/lukeeep\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" alt=\"Buy Me A Coffee\" style=\"height: 60px !important;width: 217px !important;\" \u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukepistrol%2Flpmapview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukepistrol%2Flpmapview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukepistrol%2Flpmapview/lists"}