{"id":48226755,"url":"https://github.com/am2222/mapbox-pmtiles","last_synced_at":"2026-04-04T19:24:03.604Z","repository":{"id":225448763,"uuid":"760908379","full_name":"am2222/mapbox-pmtiles","owner":"am2222","description":"A custom source to add PmTiles support to mapbox gl js. Supports both raster and vector pmtiles","archived":false,"fork":false,"pushed_at":"2026-02-04T14:40:42.000Z","size":2145,"stargazers_count":21,"open_issues_count":8,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-05T01:34:36.155Z","etag":null,"topics":["geospatial","gis","mapbox-gl-js","pmtiles"],"latest_commit_sha":null,"homepage":"https://am2222.github.io/mapbox-pmtiles/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/am2222.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-02-20T22:03:59.000Z","updated_at":"2026-02-04T22:16:15.000Z","dependencies_parsed_at":"2024-07-16T19:17:46.121Z","dependency_job_id":"4f910ad0-88d7-421c-a64b-c2babbccf345","html_url":"https://github.com/am2222/mapbox-pmtiles","commit_stats":null,"previous_names":["am2222/mapbox-pmtiles"],"tags_count":55,"template":false,"template_full_name":null,"purl":"pkg:github/am2222/mapbox-pmtiles","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/am2222%2Fmapbox-pmtiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/am2222%2Fmapbox-pmtiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/am2222%2Fmapbox-pmtiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/am2222%2Fmapbox-pmtiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/am2222","download_url":"https://codeload.github.com/am2222/mapbox-pmtiles/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/am2222%2Fmapbox-pmtiles/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31410384,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: 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":["geospatial","gis","mapbox-gl-js","pmtiles"],"created_at":"2026-04-04T19:24:03.445Z","updated_at":"2026-04-04T19:24:03.583Z","avatar_url":"https://github.com/am2222.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n\u003cdiv align=\"center\"\u003e\n\n[![NPM Version](https://img.shields.io/npm/v/mapbox-pmtiles?style=flat-square)](https://www.npmjs.com/package/mapbox-pmtiles) [![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/am2222/mapbox-pmtiles/build.yml?style=flat-square\u0026label=Tests)](https://github.com/am2222/mapbox-pmtiles/actions/workflows/node.js.yml) [![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/am2222/mapbox-pmtiles/pages%2Fpages-build-deployment?style=flat-square\u0026label=documentations%20build)](https://github.com/am2222/mapbox-pmtiles/actions/workflows/pages/pages-build-deployment) [![](https://data.jsdelivr.com/v1/package/npm/mapbox-pmtiles/badge)](https://www.jsdelivr.com/package/npm/mapbox-pmtiles)\n\n\u003c/div\u003e\n\n## Mapbox-PMTiles\nAdd [PMTiles](https://docs.protomaps.com/pmtiles/) support to Mapbox.\n\nThis library requires Mapbox GL JS v3 to work.\n\n## Usage\n\n## ESM Module\n\n```js\nimport mapboxgl from \"mapbox-gl\";\n\nimport { PmTilesSource } from \"mapbox-pmtiles\";\n//Define custom source\nmapboxgl.Style.setSourceType(PmTilesSource.SOURCE_TYPE, PmTilesSource);\n\nmap.on(\"load\", () =\u003e {\n\n    const PMTILES_URL =\n    \"https://r2-public.protomaps.com/protomaps-sample-datasets/protomaps-basemap-opensource-20230408.pmtiles\";\n\n    const header = await mapboxPmTiles.PmTilesSource.getHeader(PMTILES_URL);\n    const bounds = [\n          header.minLon,\n          header.minLat,\n          header.maxLon,\n          header.maxLat,\n        ];\n\n    map.addSource('pmTileSourceName', {\n          type: mapboxPmTiles.PmTilesSource.SOURCE_TYPE,\n          url: PMTILES_URL,\n          minzoom: header.minZoom,\n          maxzoom: header.maxZoom,\n          bounds: bounds,\n        });\n\n    map.current.showTileBoundaries = true;\n    map.current.addLayer({\n        id: \"places\",\n        source: \"pmTileSourceName\",\n        \"source-layer\": \"places\",\n        type: \"circle\",\n        paint: {\n            \"circle-color\": \"steelblue\",\n        },\n        maxzoom: 14,\n    });\n});\n\n```\n\n## JSDeliver\n\nHere you can use it in the webpages\n\n```html\n\n\u003cscript type=\"text/javascript\"  src=\"https://cdn.jsdelivr.net/npm/mapbox-pmtiles@1/dist/mapbox-pmtiles.umd.min.js\"\u003e\u003c/script\u003e\n\n\u003cscript\u003e\n    const map = new mapboxgl.Map({\n        container: 'map', // container ID\n        center: [-74.5, 40], // starting position [lng, lat]\n        zoom: 9 ,// starting zoom,\n    });\n    mapboxgl.Style.setSourceType(mapboxPmTiles.SOURCE_TYPE, mapboxPmTiles.PmTilesSource);\n\n    map.on(\"load\", () =\u003e {\n\n        const PMTILES_URL =\n        \"https://r2-public.protomaps.com/protomaps-sample-datasets/protomaps-basemap-opensource-20230408.pmtiles\";\n\n        const header = await mapboxPmTiles.PmTilesSource.getHeader(PMTILES_URL);\n        const bounds = [\n              header.minLon,\n              header.minLat,\n              header.maxLon,\n              header.maxLat,\n            ];\n    \n        map.addSource('pmTileSourceName', {\n              type: mapboxPmTiles.PmTilesSource.SOURCE_TYPE,\n              url: PMTILES_URL,\n              minzoom: header.minZoom,\n              maxzoom: header.maxZoom,\n              bounds: bounds,\n            });\n\n        map.showTileBoundaries = true;\n        map.addLayer({\n            id: \"places\",\n            source: \"pmTileSourceName\",\n            \"source-layer\": \"places\",\n            type: \"circle\",\n            paint: {\n                \"circle-color\": \"steelblue\",\n            },\n            maxzoom: 14,\n        });\n    });\n\u003c/script\u003e\n\n```\n\nOr you can use the following\n\n\n```html\n\n\u003cscript type=\"module\"\u003e\nimport mapboxPmtiles from 'https://cdn.jsdelivr.net/npm/mapbox-pmtiles@1.0.29/+esm'\n\u003c/script\u003e\n\n```\n\n### Supports both Vector and Raster TileSets\n\nJust pass your `pmtile` url and this plugin will detect tileset's type and format from header automatically. ;) \n\n\n## What is PMTiles\nSee the [PMTiles](https://docs.protomaps.com/pmtiles/) repository for more information \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fam2222%2Fmapbox-pmtiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fam2222%2Fmapbox-pmtiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fam2222%2Fmapbox-pmtiles/lists"}