ImmersiveMap
ImmersiveMap is a pure Swift + Metal map rendering engine for SwiftUI apps on Apple platforms.
Features
Built-in Protomaps vector tiles, native iOS (UIKit host), native macOS, SwiftUI integration, map styling and colors, SwiftUI markers, avatars, 3D scene models, landmark models that replace the map's buildings, tour video export.
Map Data
The map draws the Protomaps basemap, an OpenStreetMap planet in a single PMTiles archive that the engine reads with HTTP range requests, with no tile server in between. The archive hosted for this project is the default, and .tileArchive(_:headers:) points the map at any Protomaps planet build or a region cut from one.
The 3D building models are a second PMTiles archive of the same kind, built for this project and hosted on Cloudflare's S3-compatible storage.
The globe's overview (the biomes, the lakes and the road network of the low zooms) is baked from RESOLVE and Natural Earth data into the package resources, in this repository, so it ships with the engine and loads from no server.
Quick Start
import SwiftUI
import ImmersiveMap
struct ContentView: View {
var body: some View {
ImmersiveMapView()
.ignoresSafeArea()
}
}
Installation
Add ImmersiveMap as a Swift Package dependency:
https://github.com/artembobkin/ImmersiveMap.git
Requirements
- Swift 6.0+
- Xcode 16+
- iOS 18+
- macOS 15+
- Metal-capable device or simulator
Attribution
The default map is built from open data, and three of its sources ask to be credited:
- OpenStreetMap: the built-in vector tiles are OpenStreetMap data under ODbL, so "© OpenStreetMap" is required.
- RESOLVE Ecoregions 2017: the biomes the engine paints under the land of the globe are under CC BY 4.0, so "Biomes © RESOLVE" is required while they are on screen.
- Mapterhorn: the terrain the ground relief rises by is Mapterhorn's open elevation data, so "© Mapterhorn" is required while the relief is on screen.
Otherwise the license is MIT and nothing here changes that. The badge opens with "Powered by ImmersiveMap" by default, a courtesy the license does not ask for, and it can be switched off. It would just be cool if you mention ImmersiveMap somewhere:
Maps powered by ImmersiveMap (immersivemap.dev)
Contributing
ImmersiveMap is currently maintained as a single-maintainer project. Issues and feedback are welcome. Pull requests are accepted. For bug reports, feature requests, questions and ideas, open an issue.
License
ImmersiveMap is available under the MIT license. See LICENSE. The internal earcut triangulator is a port of ISC-licensed Mapbox code, and its notice heads EarcutCore.swift.
Commercial Support
I am available for consulting and custom ImmersiveMap integrations. To get in touch, open an issue.