{"id":18739704,"url":"https://github.com/roblabs/openmaptiles-ios-demo","last_synced_at":"2025-04-12T20:04:02.574Z","repository":{"id":136165350,"uuid":"54419502","full_name":"roblabs/openmaptiles-ios-demo","owner":"roblabs","description":"iOS demo app for showing offline maps for mobile.","archived":false,"fork":false,"pushed_at":"2024-02-07T19:27:10.000Z","size":72002,"stargazers_count":33,"open_issues_count":2,"forks_count":13,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-12T20:03:05.209Z","etag":null,"topics":["mapbox","maplibre","offline-maps"],"latest_commit_sha":null,"homepage":"https://RobLabs.com/openmaptiles-ios-demo","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/roblabs.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"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}},"created_at":"2016-03-21T20:14:12.000Z","updated_at":"2025-04-08T20:07:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"504f75ae-f453-4443-bbd0-d2bf9e4fe7f6","html_url":"https://github.com/roblabs/openmaptiles-ios-demo","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roblabs%2Fopenmaptiles-ios-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roblabs%2Fopenmaptiles-ios-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roblabs%2Fopenmaptiles-ios-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roblabs%2Fopenmaptiles-ios-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roblabs","download_url":"https://codeload.github.com/roblabs/openmaptiles-ios-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625493,"owners_count":21135513,"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":["mapbox","maplibre","offline-maps"],"created_at":"2024-11-07T15:37:05.896Z","updated_at":"2025-04-12T20:03:59.160Z","avatar_url":"https://github.com/roblabs.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Offline Map for Mobile\n\nThis repo describes how to build an Offline Map for mobile on iOS.  Local assets such as vector data, styles, glyphs and sprites are built into a sample iOS app.\n\n## Features\n\n* 100% local data (notice in the animation that WiFi is turned off at the beginning of the demo)\n* Vector data built using https://openmaptiles.org\n* Styling of the countries is from https://github.com/klokantech/mapbox-gl-js-offline-example\n* Built upon https://github.com/klokantech/osm2vectortiles-ios, now an iOS app\ncan be built to have local vector data, styles, glyphs and sprites.\n\n## Build\n\nThe [MapLibre Mobile SDK](https://github.com/maplibre/maplibre-gl-native-distribution) is installed via the [Swift Package Manager](https://developer.apple.com/documentation/swift_packages).\n\n### GitHub Actions\n\n* https://docs.github.com/actions/quickstart\n* [![CI](https://github.com/roblabs/openmaptiles-ios-demo/workflows/CI/badge.svg)](https://github.com/roblabs/openmaptiles-ios-demo/actions?query=workflow%3ACI)\n\n---\n\n### Command Line Building\n\n~~~\n# Build\nxcodebuild -scheme GeographyClass build\n\n# Test\nxcodebuild -scheme GeographyClass test \\\n  -destination 'platform=iOS Simulator,name=iPhone 8'\n\n# Test without building\nxcodebuild -scheme GeographyClass test-without-building   \\\n  -destination 'platform=iOS Simulator,name=iPhone 11 Pro' \\\n  -destination 'platform=iOS,name=iPhone 8' \\\n~~~\n\n#### Mapbox token\n\n* Since the Map vector data is local, its technically not needed to have an access token\n  * But to be safe, here are notes on how to\n* Following notes from https://docs.mapbox.com/help/troubleshooting/private-access-token-android-and-ios/\n\u003e Create a new plain text file containing your access token, named either .mapbox or mapbox. To avoid accidentally committing this file to an open-source project, either you can save it to a location outside your project's version-controlled directory, or you can add this file to your project’s .gitignore file.\n\n* Then open the Project file\n\n~~~\nopen openmaptiles-ios-demo.xcodeproj\n~~~\n\n## Architecture\n\n* All assets are local and are accessed by Mapbox GL by the `asset://` URI.\n\n```\n\"sources\": {\n    \"countries\": {\n        \"type\": \"vector\",\n        \"tiles\": [\n            \"asset://geography-class.osm2vectortiles/{z}/{x}/{y}.pbf\"\n        ]\n    }\n},\n\"sprite\": \"asset://sprites/bright-v8\",\n\"glyphs\": \"asset://glyphs/{fontstack}/{range}.pbf\",\n```\n\n---\n\n### Soft Proofing Tiles\n\nYou can Soft Proof your tiles before they are installed into mobile by using [Tileserver GL](https://github.com/maptiler/tileserver-gl#readme).\n\n* Discussion on whether `.pbf` can be compressed when using `tippecanoe`:  [mapbox / tippecanoe #582](https://github.com/mapbox/tippecanoe/issues/582)\n  * `tippecanoe -pC --maximum-zoom=7 -o poly.pC.mbtiles poly.geojson`\n\n### Sample Tile JSON \u0026 Styles\n\n[Tile JSON][tileJSON] with GitHub served `.pbf`.  Choose either the Tile JSON or Mapbox Style\n\n* [tileJSON/geography-class.GitHub.json][tileJSON/geography-class.GitHub.json]\n* [styles/geography-class.GitHub.json][styles/geography-class.GitHub.json]\n\n\nLocally served `.pbf`\n\n* See the sample Tile JSON [tileJSON/geography-class.localhost.json][tileJSON/geography-class.localhost.json]\n  * useful for use with [Maputnik][Maputnik] or [Fresco][Fresco]\n  * also an example to test your web server is serving up proper uncompressed `.pbf`\n    * `wget --spider http://localhost:5000/geography-class.osm2vectortiles/0/0/0.pbf`\n\n[tileJSON]: https://github.com/mapbox/tilejson-spec/tree/master/2.2.0#2-file-format\n[tileJSON/geography-class.localhost.json]: https://raw.githubusercontent.com/roblabs/openmaptiles-ios-demo/master/OSM2VectorTiles/tileJSON/geography-class.localhost.json\n[tileJSON/geography-class.GitHub.json]: https://raw.githubusercontent.com/roblabs/openmaptiles-ios-demo/master/OSM2VectorTiles/tileJSON/geography-class.GitHub.json\n[styles/geography-class.GitHub.json]: https://raw.githubusercontent.com/roblabs/openmaptiles-ios-demo/master/OSM2VectorTiles/styles/geography-class.GitHub.json\n[Maputnik]: https://maputnik.github.io/editor/\n[Fresco]: https://fresco.gospatial.org\n\n```\n# Install `serve` from https://www.npmjs.com/package/serve\n#  yarn global add serve   # do this once\n\ncd OSM2VectorTiles\n\n# Serve raw `.pbf` files using [serve](https://www.npmjs.com/package/serve)\n# serve -v # version\n\n# Be sure to open `http://localhost:5000` to confirm what is being served\nserve --cors --listen 5000 # serve current directory; CORS; listen on port 5000\n\n# Using a different server to hook into those raw tiles\nalias tsgl='docker run --rm -it -v \"$(pwd)\":/data -p 8081:80 maptiler/tileserver-gl --verbose'\n\ntsgl  # starts Tileserver GL using the file config.json\n```\n\n#### Zurich Sample\n\nUsing the Zurich Sample from Maptiler.  \n\nSee the [`metadata`](OSM2VectorTiles/tileserver-gl/config.zurich.json) for details on\n* how to run Tileserver-GL using `docker` or `npm`.\n* How to fetch the Zurich MBTiles\n\n##### Available Endpoints\n\n* Useful for inspecting OpenMapTiles schema `v3` with a Basic style\n  * Health — [http://localhost:8081/health](http://localhost:8081/health)\n  * TileJSON — [http://localhost:8081/index.json](http://localhost:8081/index.json)\n  * Styles — [http://localhost:8081/styles.json](http://localhost:8081/styles.json)\n  * Fonts or Glyphs used in the style (not the fonts used by Mapbox) — [http://localhost:8081/fonts.json](http://localhost:8081/fonts.json)\n\n```\ntsgl --config OSM2VectorTiles/tileserver-gl/config.zurich.json\n```\n\n#### Geography Class\n\nGeography Class does not conform the OpenMapTiles schema `v3`.  You can inspect\n\n##### Available Endpoints\n\n* Health — [http://localhost:8081/health](http://localhost:8081/health)\n* TileJSON — [http://localhost:8081/index.json](http://localhost:8081/index.json)\n* Styles — [http://localhost:8081/styles.json](http://localhost:8081/styles.json)\n* Fonts or Glyphs used in the style (not the fonts used by Mapbox) — [http://localhost:8081/fonts.json](http://localhost:8081/fonts.json)\n* Sprites  for this particular style — [http://localhost:5000/sprites/bright-v8@2x.png](http://localhost:5000/sprites/bright-v8@2x.png)\n\n```\ntsgl --config tileserver-gl/config.geography-class.json\n```\n\n---\n\n![geography-class](geography-class.gif)\n\n* (QuickTime has a bug when screen recording; as it still shows WiFi service is on, when it indeed is off)\n\n---\n\n## Building\n\nYou can build the Mapbox Maps `v10` version by checking out the tag `v10-geography-class`\n\n```bash\nexport REPO=roblabs/openmaptiles-ios-demo\n\ngit clone --recursive \\\n  https://github.com/$REPO.git \\\n  tmp/$REPO\n\ncd tmp/$REPO\n\nTAG=v10-geography-class\ngit checkout tags/$TAG -b $TAG\n```\n\n```\nxed .\n```\n\n### Change Log\n\n* Jun 17, 2021\n  * Add MapView OSLog Extensions from https://github.com/roblabs/mapview-log-extensions\n* May 06, 2021\n  * Upgrade MapLibre for iOS to `5.12.0-pre.1`.  MetalANGLE build.\n* Mar 12, 2021\n  * Upgrade MapLibre for iOS from `5.10.0` to `5.11.0`\n* Jan 30, 2021\n  * Convert to Offline Maps with SwiftUI.  Local style with local tiles using the protocol `asset://`\n  * branch: `mapbox-maps-ios-v10` updated with MapboxMaps Library from https://github.com/mapbox/mapbox-maps-ios\n  * Rename project to Geography Class\n  * Minimum iOS is 13.0\n  * Tested with Xcode 12.4 \u0026 12.5\n* Jan 26, 2021\n  * Update to MapLibre.  https://github.com/maptiler/maplibre-gl-native-distribution/pull/2\n  * Remove references to Carthage.  See the branch `carthage`, if needed.\n* Jun 24, 2020\n  * Updated notes on how to use Tileserver GL\n* Jun 17, 2020\n  * Add `config.json` for use by [Tileserver GL](https://github.com/maptiler/tileserver-gl#readme)\n* Jun 2, 2020\n  * Update to use Carthage only; removed dependency on Cocoapods\n  * Upgrade to Xcode 11.5\n  * Upgrade to Mapbox 5.9 \u0026 mapbox-events-ios 0.10\n  * Add Xcode Bots \u0026 Continuous Integration scripts\n* Dec 13, 2019\n  * Move from Cocoapods to Carthage\n  * Upgrade to Xcode 11.3\n  * Uprade to Mapbox 5.5\n  * Add local, private Mapbox Token\n* Nov 19, 2019\n  * Upgrade to Xcode 10.1\n* Jan 30, 2017\n  * upgrade to Mapbox 3.4.1 \u0026 Podfile\n* 2016 — Initial Version\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froblabs%2Fopenmaptiles-ios-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froblabs%2Fopenmaptiles-ios-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froblabs%2Fopenmaptiles-ios-demo/lists"}