From 49b72a3fe789da9a4aaff46a496d7adee9d58476 Mon Sep 17 00:00:00 2001 From: Owen Coutts Date: Wed, 26 Mar 2025 06:15:01 -0600 Subject: [PATCH 1/2] Introduce integration for mobile documentation --- .vitepress/config.mts | 28 ++++++++++++++++++----- package-lock.json | 2 +- pmtiles/maplibre-mobile.md | 46 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 6 deletions(-) create mode 100644 pmtiles/maplibre-mobile.md diff --git a/.vitepress/config.mts b/.vitepress/config.mts index d671640..83083f4 100644 --- a/.vitepress/config.mts +++ b/.vitepress/config.mts @@ -5,16 +5,29 @@ export default defineConfig({ title: "Protomaps Docs", head: [ ["link", { rel: "icon", type: "image/png", href: "/favicon.png" }], - ["link", { rel: "apple-touch-icon", type: "image/jpg", href:"https://protomaps.com//apple-touch-icon.jpg" }], - ["meta", { property: "og:image", content: "https://protomaps.com/docs_opengraph.jpg" }] + [ + "link", + { + rel: "apple-touch-icon", + type: "image/jpg", + href: "https://protomaps.com//apple-touch-icon.jpg", + }, + ], + [ + "meta", + { + property: "og:image", + content: "https://protomaps.com/docs_opengraph.jpg", + }, + ], ], description: "Technical Documentation for Protomaps", cleanUrls: true, markdown: { theme: { - light: 'github-light-high-contrast', - dark: 'github-dark-high-contrast' - } + light: "github-light-high-contrast", + dark: "github-dark-high-contrast", + }, }, themeConfig: { logo: "/logo.svg", @@ -56,6 +69,11 @@ export default defineConfig({ { text: "OpenLayers", link: "/pmtiles/openlayers" }, ], }, + { + text: "PMTiles on mobile", + collapsed: true, + items: [{ text: "MapLibre GL", link: "/pmtiles/maplibre-mobile" }], + }, { text: "Accelerating PMTiles", collapsed: true, diff --git a/package-lock.json b/package-lock.json index 5f81e33..238103a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "docs", + "name": "pm-docs", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/pmtiles/maplibre-mobile.md b/pmtiles/maplibre-mobile.md new file mode 100644 index 0000000..33a62a2 --- /dev/null +++ b/pmtiles/maplibre-mobile.md @@ -0,0 +1,46 @@ +--- +title: PMTiles for MapLibre GL on Mobile +outline: deep +--- + +# PMTiles for MapLibre GL + +Support for PMTiles has been build directly into recent versions of MapLibre GL. + +PMTiles is designed to be read directly in the browser by the MapLibre GL renderer, for either thematic overlay tilesets or basemap tilesets. + +PMTiles can be used directly in maplibre by installing a using a relatively new version of the library with support built in. + +- Android: [v11.8.0](https://github.com/maplibre/maplibre-native/releases/tag/android-v11.8.0) +- iOS: [v6.1.0.1](https://github.com/maplibre/maplibre-native/releases/tag/ios-v6.10.0) +- React Native: [v10.1.0](https://github.com/maplibre/maplibre-react-native/releases) + + +## React Native + +It's worth pointing out that React Native MapLibre is using the iOS/Android versions of MapLibre under the hood which has slightly different APIs than the javascript API on web. Simply use the `pmtiles://...` url directly in react native, there is no need for plugins: + +```js +import { + LineLayer, + MapView, + VectorSource, +} from "@maplibre/maplibre-react-native"; + +export function ExampleMap() { + return ( + + + + + + ); +} +``` From dd6fb50e66c3b35ed40f396cff38e4d293d0dc00 Mon Sep 17 00:00:00 2001 From: Owen Coutts Date: Wed, 26 Mar 2025 06:21:23 -0600 Subject: [PATCH 2/2] revert package lock changes --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 238103a..5f81e33 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "pm-docs", + "name": "docs", "lockfileVersion": 3, "requires": true, "packages": {