{"id":28576929,"url":"https://github.com/maptiler/maptiler-sdk-swift","last_synced_at":"2026-03-04T08:32:20.192Z","repository":{"id":292165252,"uuid":"921239963","full_name":"maptiler/maptiler-sdk-swift","owner":"maptiler","description":"Complete mobile mapping experience with Swift","archived":false,"fork":false,"pushed_at":"2026-02-25T17:31:58.000Z","size":5450,"stargazers_count":7,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-02-25T18:15:56.616Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.maptiler.com","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maptiler.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-23T15:47:39.000Z","updated_at":"2026-02-25T14:40:43.000Z","dependencies_parsed_at":"2026-01-26T13:04:25.077Z","dependency_job_id":null,"html_url":"https://github.com/maptiler/maptiler-sdk-swift","commit_stats":null,"previous_names":["maptiler/maptiler-sdk-swift"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/maptiler/maptiler-sdk-swift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptiler%2Fmaptiler-sdk-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptiler%2Fmaptiler-sdk-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptiler%2Fmaptiler-sdk-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptiler%2Fmaptiler-sdk-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maptiler","download_url":"https://codeload.github.com/maptiler/maptiler-sdk-swift/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptiler%2Fmaptiler-sdk-swift/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30076876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T08:01:56.766Z","status":"ssl_error","status_checked_at":"2026-03-04T08:00:42.919Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2025-06-11T00:08:15.974Z","updated_at":"2026-03-04T08:32:20.128Z","avatar_url":"https://github.com/maptiler.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# MapTiler SDK Swift\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"Examples/maptiler-logo.png\" alt=\"MapTiler\" title=\"MapTiler\"/\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fmaptiler%2Fmaptiler-sdk-swift%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/maptiler/maptiler-sdk-swift)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fmaptiler%2Fmaptiler-sdk-swift%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/maptiler/maptiler-sdk-swift)\n\n\u003c/div\u003e\n\n\nThe MapTiler SDK Swift is a native SDK written in Swift, designed to work with the well-established MapTiler Cloud service, which provides all the data required to fuel a complete mobile mapping experience: vector tiles, geojson, map interaction, custom styles, data visualization and more.\n\n## Features\n- [x] Map interaction\n- [x] Pre-made map styles\n- [x] VectorTile and GeoJSON sources\n- [x] Fill, Line and Symbol layers\n- [x] Custom Annotation Views\n- [x] Location tracking\n- [x] Globe and 3D Terrain\n- [x] UIKit and SwiftUI support\n\n## Basic Usage\n\nMake sure to set your MapTiler Cloud API key first. (i.e. in AppDelegate):\n\n```swift\nTask {\n    await MTConfig.shared.setAPIKey(\"YOUR_API_KEY\")\n}\n```\n\n### UIKit\n\n```swift\nimport MapTilerSDK\n\nlet coordinates = CLLocationCoordinate2D(latitude: 47.137765, longitude: 8.581651)\nlet options = MTMapOptions(center: coordinates, zoom: 2.0, bearing: 1.0, pitch: 20.0)\nvar mapView = MTMapView(frame: view.frame, options: options, referenceStyle: .streets)\nmapView.delegate = self\n\nview.addSubview(mapView)\n```\n\nIf you are using auto layout, you can call the helper function for anchors pinning. This ensures correct orientation updates.\n\n```swift\nmapView.pinToSuperviewEdges()\n```\n\n### SwiftUI\n\n```swift\nimport MapTilerSDK\n\n@State private var mapView = MTMapView(options: MTMapOptions(zoom: 2.0))\n\nvar body: some View {\n    MTMapViewContainer(map: mapView) {}\n        .referenceStyle(.streets)\n}\n```\n\nFor detailed functionality overview refer to the API Reference documentation or build local docs in Xcode: Product -\u003e Build Documentation.\n\n## Sources and Layers\n\nSources and layers can be added to the map view style object as soon as map is initialized. Setting the style after adding layers resets them to default, so make sure style is finished loading first.\n\n### UIKit\n\n```swift\nguard let style = mapView.style else {\n    return\n}\n\nif let contoursTilesURL = URL(string: \"https://api.maptiler.com/tiles/contours-v2/tiles.json?key=YOUR_API_KEY\") {\n    let contoursDataSource = MTVectorTileSource(identifier: \"contoursSource\", url: contoursTilesURL)\n    style.addSource(contoursDataSource)\n\n    let contoursLayer = MTLineLayer(identifier: \"contoursLayer\", sourceIdentifier: contoursDataSource.identifier, sourceLayer: \"contour_ft\")\n    contoursLayer.color = .brown\n    contoursLayer.width = 2.0\n\n    style.addLayer(contoursLayer)\n}\n```\n\n### SwiftUI\n\n```swift\n@State private var mapView = MTMapView(options: MTMapOptions(zoom: 2.0))\n\nvar body: some View {\n    MTMapViewContainer(map: mapView) {\n        MTVectorTileSource(identifier: \"countoursSource\", url: URL(string: \"https://api.maptiler.com/tiles/contours-v2/tiles.json?key=YOUR_API_KEY\"))\n\n        MTLineLayer(identifier: \"contoursLayer\", sourceIdentifier: \"countoursSource\", sourceLayer: \"contour_ft\")\n            .color(.brown)\n            .width(2.0)\n\n    }\n}\n```\n\n## Markers and Popups\n\nMarkers and popups (Text, Custom Annotation) can be used for highlighting points of interest on the map.\n\n### UIKit\n```swift\nlet coordinates = CLLocationCoordinate2D(latitude: 47.137765, longitude: 8.581651)\n\nlet popup = MTTextPopup(coordinates: coordinates, text: \"MapTiler\", offset: 20.0)\nlet marker = MTMarker(coordinates: coordinates, popup: popup)\nmarker.draggable = true\n\nmapView.addMarker(marker)\n```\n\n### SwiftUI\n```swift\n@State private var mapView = MTMapView(options: MTMapOptions(zoom: 2.0))\n\nlet coordinates = CLLocationCoordinate2D(latitude: 47.137765, longitude: 8.581651)\n\nvar body: some View {\n    MTMapViewContainer(map: mapView) {\n        let popup = MTTextPopup(coordinates: coordinates, text: \"MapTiler\", offset: 20.0)\n\n        MTMarker(coordinates: coordinates, draggable: true, popup: popup)\n    }\n}\n```\n\nAlternatively add content on custom actions:\n\n```swift\n@State private var mapView = MTMapView(options: MTMapOptions(zoom: 2.0))\n\nlet coordinates = CLLocationCoordinate2D(latitude: 47.137765, longitude: 8.581651)\n\nvar body: some View {\n    MTMapViewContainer(map: mapView) {\n    }\n        .didInitialize {\n            let marker = MTMarker(coordinates: coordinates)\n\n            Task {\n                await mapView.addMarker(marker)\n            }\n        }\n\n    Button(\"Add Popup\") {\n        Task {\n            let popup = MTTextPopup(coordinates: coordinates, text: \"MapTiler\", offset: 20.0)\n\n            await mapView.addTextPopup(popup)\n        }\n    }\n}\n```\n\nFor additional examples refer to the Examples directory.\n\n## Custom Annotations\nIn addition to `MTMarker` and `MTTextPopup`, you can use `MTCustomAnnotationView` class to make your own annotations and add them to the map. You can subclass to create custom UI it or use it as is for simple designs.\n\n```swift\nlet customSize = CGSize(width: 200.0, height: 80.0)\nlet coordinates = CLLocationCoordinate2D(latitude: 47.137765, longitude: 8.581651)\nlet offset = MTPoint(x: 0, y: -80)\n\nlet myCustomView = MTCustomAnnotationView(size: customSize, coordinates: coordinates, offset: offset)\nmyCustomView.backgroundColor = .blue\n\nmyCustomView.addTo(mapView)\n```\n\n\n# Installation\nMapTiler Swift SDK is a Swift Package and can be added as dependency through **Swift Package Manager**.\n\n- File -\u003e Add Package Dependencies\n- Add https://github.com/maptiler/maptiler-sdk-swift.git\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"Examples/streets.png\" alt=\"MapTiler\" title=\"MapTiler\"/\u003e\n\u003cimg src=\"Examples/satellite.png\" alt=\"MapTiler\" title=\"MapTiler\"/\u003e\n\u003c/p\u003e\n\n# License\nMapTiler SDK Swift is released under the BSD 3-Clause license. See LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaptiler%2Fmaptiler-sdk-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaptiler%2Fmaptiler-sdk-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaptiler%2Fmaptiler-sdk-swift/lists"}