{"_id":"pmtiles-protocol","_rev":"9-0b812773be9ce51ab81d0ffcac5ba259","name":"pmtiles-protocol","dist-tags":{"latest":"1.1.2"},"versions":{"1.0.0":{"name":"pmtiles-protocol","version":"1.0.0","keywords":["pmtiles","mvt","tiles","protomaps","mapbox","openlayers","ol-mapbox-style","mapblibre"],"author":{"name":"Andreas Hocevar","email":"andreas.hocevar@gmail.com"},"license":"BSD-2-Clause","_id":"pmtiles-protocol@1.0.0","maintainers":[{"name":"ahocevar","email":"andreas.hocevar@gmail.com"}],"homepage":"https://github.com/ahocevar/pmtiles-protocol#readme","bugs":{"url":"https://github.com/ahocevar/pmtiles-protocol/issues"},"dist":{"shasum":"09b38534919d7acbed5c234c71f371b281cde1ae","tarball":"https://registry.npmjs.org/pmtiles-protocol/-/pmtiles-protocol-1.0.0.tgz","fileCount":9,"integrity":"sha512-A/AT7gNI9tbROKIj9EiqF88FYEzDPi/NQMg6teGcrjFD0c0/Tg0fNKOR/3KWBrQDgACcKf3zGixq6V7tbRvu0A==","signatures":[{"sig":"MEQCIESZnBenseDkoeglrfM5iE/+84jhY1D4ECZJJh6i8tqBAiBUoCASO+kn7lZh1p8ZjLl9+pNAFzDdx+cKk77cLpDWtg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12063},"main":"index.js","type":"module","types":"./index.d.ts","gitHead":"ce093d80ad91912fcb6366b24981633c1c55d534","scripts":{"test":"eslint **/*.js && prettier **/*.js --check && tsc --noEmit","prepublishOnly":"tsc"},"_npmUser":{"name":"ahocevar","email":"andreas.hocevar@gmail.com"},"repository":{"url":"git+ssh://git@github.com/ahocevar/pmtiles-protocol.git","type":"git"},"_npmVersion":"10.8.2","description":"pmtiles:// urls for fetch() and XMLHttpRequest","directories":{},"_nodeVersion":"20.17.0","dependencies":{"pmtiles":"^3.2.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.13.0","globals":"^15.11.0","prettier":"^3.3.3","@eslint/js":"^9.13.0","typescript":"^5.6.3","@types/eslint__js":"^8.42.3"},"_npmOperationalInternal":{"tmp":"tmp/pmtiles-protocol_1.0.0_1729530366756_0.5893120649379984","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"pmtiles-protocol","version":"1.0.1","keywords":["pmtiles","mvt","tiles","protomaps","mapbox","openlayers","ol-mapbox-style","mapblibre"],"author":{"name":"Andreas Hocevar","email":"andreas.hocevar@gmail.com"},"license":"BSD-2-Clause","_id":"pmtiles-protocol@1.0.1","maintainers":[{"name":"ahocevar","email":"andreas.hocevar@gmail.com"}],"homepage":"https://github.com/ahocevar/pmtiles-protocol#readme","bugs":{"url":"https://github.com/ahocevar/pmtiles-protocol/issues"},"dist":{"shasum":"1e6f861a0a4788327ada336b6d44d32a6707ccb5","tarball":"https://registry.npmjs.org/pmtiles-protocol/-/pmtiles-protocol-1.0.1.tgz","fileCount":10,"integrity":"sha512-/YDSgflm111IDO6l3ZelSjVeEwnkX0vz2a3g3POdWmHxZmIayTAXNyusN9YbvtzgdTN0r5M1m7oYhjGyaPCNkw==","signatures":[{"sig":"MEUCIDwfwWnZOQiMoaOtZDa17CSwhOvyD2i6FfgWXUIy4e4zAiEA9++lJVbCrMuVWkLfOCPBGKOSf4wWyIb1vGh9AYkYx5w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12869},"main":"index.js","type":"module","types":"./index.d.ts","gitHead":"64f97f738ea67bb7c207dbddfd09f52448c9cf16","scripts":{"test":"eslint **/*.js && prettier **/*.js --check && tsc --noEmit","prepublishOnly":"tsc"},"_npmUser":{"name":"ahocevar","email":"andreas.hocevar@gmail.com"},"repository":{"url":"git+ssh://git@github.com/ahocevar/pmtiles-protocol.git","type":"git"},"_npmVersion":"10.8.2","description":"pmtiles:// urls for fetch() and XMLHttpRequest","directories":{},"_nodeVersion":"20.17.0","dependencies":{"pmtiles":"^3.2.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.13.0","globals":"^15.11.0","prettier":"^3.3.3","@eslint/js":"^9.13.0","typescript":"^5.6.3","@types/eslint__js":"^8.42.3"},"_npmOperationalInternal":{"tmp":"tmp/pmtiles-protocol_1.0.1_1729530757935_0.16006857005090858","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"pmtiles-protocol","version":"1.0.2","keywords":["pmtiles","mvt","tiles","protomaps","mapbox","openlayers","ol-mapbox-style","mapblibre"],"author":{"name":"Andreas Hocevar","email":"andreas.hocevar@gmail.com"},"license":"BSD-2-Clause","_id":"pmtiles-protocol@1.0.2","maintainers":[{"name":"ahocevar","email":"andreas.hocevar@gmail.com"}],"homepage":"https://github.com/ahocevar/pmtiles-protocol#readme","bugs":{"url":"https://github.com/ahocevar/pmtiles-protocol/issues"},"dist":{"shasum":"7eef4cfcaf7cc77baf1b1c682e5da7c9278db158","tarball":"https://registry.npmjs.org/pmtiles-protocol/-/pmtiles-protocol-1.0.2.tgz","fileCount":10,"integrity":"sha512-PVZthKlbHKok+j4nzQzQY+H0yeZF6INDKkTFJ5NWUn9wGmAi5I92cuKoaYDR8OWSqGgk3jB/jA/0Ycy90vRbHg==","signatures":[{"sig":"MEYCIQCHpKgMJ9/bMJhCkUIyieWk+1No+hHxOf8rhT7e5A7pfgIhAKu7ayO66lO8jFiyN4ZZ1eVOs8hKz6OWKAJD3dOgzFQa","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13024},"main":"index.js","type":"module","types":"./index.d.ts","gitHead":"b800e65c37de19460c8b6a21a7aff85806758bea","scripts":{"test":"eslint **/*.js && prettier **/*.js --check && tsc --noEmit","prepublishOnly":"tsc"},"_npmUser":{"name":"ahocevar","email":"andreas.hocevar@gmail.com"},"repository":{"url":"git+ssh://git@github.com/ahocevar/pmtiles-protocol.git","type":"git"},"_npmVersion":"10.8.2","description":"pmtiles:// urls for fetch() and XMLHttpRequest","directories":{},"_nodeVersion":"20.17.0","dependencies":{"pmtiles":"^3.2.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.13.0","globals":"^15.11.0","prettier":"^3.3.3","@eslint/js":"^9.13.0","typescript":"^5.6.3","@types/eslint__js":"^8.42.3"},"_npmOperationalInternal":{"tmp":"tmp/pmtiles-protocol_1.0.2_1729531833732_0.5512237360025254","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"pmtiles-protocol","version":"1.0.3","keywords":["pmtiles","mvt","tiles","protomaps","mapbox","openlayers","ol-mapbox-style","mapblibre"],"author":{"name":"Andreas Hocevar","email":"andreas.hocevar@gmail.com"},"license":"BSD-2-Clause","_id":"pmtiles-protocol@1.0.3","maintainers":[{"name":"ahocevar","email":"andreas.hocevar@gmail.com"}],"homepage":"https://github.com/ahocevar/pmtiles-protocol#readme","bugs":{"url":"https://github.com/ahocevar/pmtiles-protocol/issues"},"dist":{"shasum":"2cdd3814f5b2d079386eaf0ca42eccfcb611b873","tarball":"https://registry.npmjs.org/pmtiles-protocol/-/pmtiles-protocol-1.0.3.tgz","fileCount":12,"integrity":"sha512-C30iZhTWeYiuKUNxvxX68d6YdFwlKgku2+t2F+ZkqNujn1cnVnBFoNFU2Q3xxcyJIwmcR8ofw7xM3cRylMlPEA==","signatures":[{"sig":"MEUCIQD68LjXCn6OoPPc/p4O4SM9+afPVyYbCSg29T8+tigPxwIgbXeQqGzIkPXdXflvpyHEoepBr/57l6mPMzwr8GXPxLs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13429},"main":"index.js","type":"module","types":"./index.d.ts","gitHead":"face1aa6b46ebdf7483d1489e1de942898f26b56","scripts":{"test":"eslint **/*.js && prettier **/*.js --check && tsc --noEmit","prepublishOnly":"tsc"},"_npmUser":{"name":"ahocevar","email":"andreas.hocevar@gmail.com"},"repository":{"url":"git+ssh://git@github.com/ahocevar/pmtiles-protocol.git","type":"git"},"_npmVersion":"10.8.2","description":"pmtiles:// urls for fetch() and XMLHttpRequest","directories":{},"_nodeVersion":"20.17.0","dependencies":{"pmtiles":"^3.2.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.13.0","globals":"^15.11.0","prettier":"^3.3.3","@eslint/js":"^9.13.0","typescript":"^5.6.3","@types/eslint__js":"^8.42.3"},"_npmOperationalInternal":{"tmp":"tmp/pmtiles-protocol_1.0.3_1729533024012_0.8767505874178214","host":"s3://npm-registry-packages"}},"1.0.4":{"name":"pmtiles-protocol","version":"1.0.4","keywords":["pmtiles","mvt","tiles","protomaps","mapbox","openlayers","ol-mapbox-style","mapblibre"],"author":{"name":"Andreas Hocevar","email":"andreas.hocevar@gmail.com"},"license":"BSD-2-Clause","_id":"pmtiles-protocol@1.0.4","maintainers":[{"name":"ahocevar","email":"andreas.hocevar@gmail.com"}],"homepage":"https://github.com/ahocevar/pmtiles-protocol#readme","bugs":{"url":"https://github.com/ahocevar/pmtiles-protocol/issues"},"dist":{"shasum":"125a652bde88187edbe6c4bf740075e89f232491","tarball":"https://registry.npmjs.org/pmtiles-protocol/-/pmtiles-protocol-1.0.4.tgz","fileCount":12,"integrity":"sha512-V+cs31pZ/ziZP9n2PHAZmnyfRK5VQOSBJgOuutQ11rnTpaEfIeDP56qFTe0MPb0RzpwZhZHYs6Kn8fk9Q5Mp3Q==","signatures":[{"sig":"MEQCIHxX14iHx2/V8F8Z3FjgV/NCX0wPnRlUJLJKu3GLPtqmAiAY3k4cC//2sMBKAW2fcAzsb1DGW1hcJEtYaBFWeDTJpg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13436},"main":"index.js","type":"module","types":"./index.d.ts","gitHead":"ac04834aff93a6c5e5641c9165c78b158e5888c8","scripts":{"test":"eslint **/*.js && prettier **/*.js --check && tsc --noEmit","prepublishOnly":"tsc"},"_npmUser":{"name":"ahocevar","email":"andreas.hocevar@gmail.com"},"repository":{"url":"git+ssh://git@github.com/ahocevar/pmtiles-protocol.git","type":"git"},"_npmVersion":"10.8.2","description":"pmtiles:// urls for fetch() and XMLHttpRequest","directories":{},"_nodeVersion":"20.17.0","dependencies":{"pmtiles":"^3.2.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.13.0","globals":"^15.11.0","prettier":"^3.3.3","@eslint/js":"^9.13.0","typescript":"^5.6.3","@types/eslint__js":"^8.42.3"},"_npmOperationalInternal":{"tmp":"tmp/pmtiles-protocol_1.0.4_1729628612234_0.8114552744378662","host":"s3://npm-registry-packages"}},"1.0.5":{"name":"pmtiles-protocol","version":"1.0.5","keywords":["pmtiles","mvt","tiles","protomaps","mapbox","openlayers","ol-mapbox-style","mapblibre"],"author":{"name":"Andreas Hocevar","email":"andreas.hocevar@gmail.com"},"license":"BSD-2-Clause","_id":"pmtiles-protocol@1.0.5","maintainers":[{"name":"ahocevar","email":"andreas.hocevar@gmail.com"}],"homepage":"https://github.com/ahocevar/pmtiles-protocol#readme","bugs":{"url":"https://github.com/ahocevar/pmtiles-protocol/issues"},"dist":{"shasum":"cd83bc48358e88d115b3ac41c215c1613e8e4fe9","tarball":"https://registry.npmjs.org/pmtiles-protocol/-/pmtiles-protocol-1.0.5.tgz","fileCount":12,"integrity":"sha512-4S1oqZTES/Emvw7HFfB/uRUOflf7wQ3Qb8vqiYjQn1vOIS26HV/cCfd9iU6Srod9XGAtSGV7j4qw+My8IxUGFw==","signatures":[{"sig":"MEUCIAPy/Jc3AO/XoHeewp87TOvQU5+/HIhDuXF1E4Ey9aNdAiEAukjOlXjW2ie9rueRcXKP5zJhgVeSz1uuIaqx5L+IU3A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16707},"main":"index.js","type":"module","types":"./index.d.ts","gitHead":"ac3a6c4a684067b3d1fdfac38ab089b9c0aeb52d","scripts":{"test":"eslint **/*.js && prettier **/*.js --check && tsc --noEmit","prepublishOnly":"tsc"},"_npmUser":{"name":"ahocevar","email":"andreas.hocevar@gmail.com"},"repository":{"url":"git+ssh://git@github.com/ahocevar/pmtiles-protocol.git","type":"git"},"_npmVersion":"10.9.2","description":"pmtiles:// urls for fetch() and XMLHttpRequest","directories":{},"_nodeVersion":"22.13.0","dependencies":{"pmtiles":"^3.2.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.13.0","globals":"^15.11.0","prettier":"^3.3.3","@eslint/js":"^9.13.0","typescript":"^5.6.3","@types/eslint__js":"^8.42.3"},"_npmOperationalInternal":{"tmp":"tmp/pmtiles-protocol_1.0.5_1739224788510_0.547354742446253","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"pmtiles-protocol","version":"1.1.0","keywords":["pmtiles","mvt","tiles","protomaps","mapbox","openlayers","ol-mapbox-style","mapblibre"],"author":{"name":"Andreas Hocevar","email":"andreas.hocevar@gmail.com"},"license":"BSD-2-Clause","_id":"pmtiles-protocol@1.1.0","maintainers":[{"name":"ahocevar","email":"andreas.hocevar@gmail.com"}],"homepage":"https://github.com/ahocevar/pmtiles-protocol#readme","bugs":{"url":"https://github.com/ahocevar/pmtiles-protocol/issues"},"dist":{"shasum":"465fe02ac8de359a20906fcfacaaacd82acc6562","tarball":"https://registry.npmjs.org/pmtiles-protocol/-/pmtiles-protocol-1.1.0.tgz","fileCount":13,"integrity":"sha512-5Uyp6asd0nQHCz+XggeLxRG0kNSvqcaeyayV9i/AQXE59vt7hGOeBrf08WteeY9PgY1eOCkQ3gt4RNMpt3YWHg==","signatures":[{"sig":"MEQCIFYU73EgjVJ/o9vGAhJkFucOB3mMpOjKV9izsOAADerAAiADcluuZNEZyobSeQELCDD22xLX4UigaqPdrJTgkYn7IA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":46107},"main":"index.js","type":"module","types":"./index.d.ts","gitHead":"ad84d6778759493304d21898a662dcb6472cbf4a","scripts":{"test":"eslint **/*.js && prettier **/*.js --check && tsc --noEmit","prepublishOnly":"tsc"},"_npmUser":{"name":"ahocevar","email":"andreas.hocevar@gmail.com"},"repository":{"url":"git+ssh://git@github.com/ahocevar/pmtiles-protocol.git","type":"git"},"_npmVersion":"11.6.1","description":"pmtiles:// urls for fetch() and XMLHttpRequest","directories":{},"_nodeVersion":"24.10.0","dependencies":{"pmtiles":"^3.2.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.13.0","globals":"^15.11.0","prettier":"^3.3.3","@eslint/js":"^9.13.0","typescript":"^5.6.3","@types/eslint__js":"^8.42.3"},"_npmOperationalInternal":{"tmp":"tmp/pmtiles-protocol_1.1.0_1768779566750_0.11712904309649907","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"pmtiles-protocol","version":"1.1.1","keywords":["pmtiles","mvt","tiles","protomaps","mapbox","openlayers","ol-mapbox-style","mapblibre"],"author":{"name":"Andreas Hocevar","email":"andreas.hocevar@gmail.com"},"license":"BSD-2-Clause","_id":"pmtiles-protocol@1.1.1","maintainers":[{"name":"ahocevar","email":"andreas.hocevar@gmail.com"}],"homepage":"https://github.com/ahocevar/pmtiles-protocol#readme","bugs":{"url":"https://github.com/ahocevar/pmtiles-protocol/issues"},"dist":{"shasum":"ff94007b205bc45cc626127ab672fd34c4349412","tarball":"https://registry.npmjs.org/pmtiles-protocol/-/pmtiles-protocol-1.1.1.tgz","fileCount":6,"integrity":"sha512-jswRcWu98zamsFdGyUTMVO/VZw4cKqZC4eeZIyRJt41YaA+zpgAWvzxj5oPX6GqzbHvLWCHnWo9Zm37sDeldyQ==","signatures":[{"sig":"MEYCIQC6eMCc/d0UA+BBi8fGX2LGpe2PuBBUMD2NX8g7sFS8XQIhAJ/pkELHEQ8Hev6Qzhvr+1w+JSe4daykQcyk2autXFey","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":42518},"main":"index.js","type":"module","types":"./index.d.ts","gitHead":"5a4e6cf866fe57702b9906bb5cacae0b704ccf11","scripts":{"lint":"eslint **/*.js && prettier **/*.js --check && tsc --noEmit","test":"vitest run","pretest":"npm run generate-fixtures && npm run lint","prepublishOnly":"tsc","generate-fixtures":"node scripts/generate-fixtures.js"},"_npmUser":{"name":"ahocevar","email":"andreas.hocevar@gmail.com"},"repository":{"url":"git+ssh://git@github.com/ahocevar/pmtiles-protocol.git","type":"git"},"_npmVersion":"11.6.1","description":"pmtiles:// urls for fetch() and XMLHttpRequest","directories":{},"_nodeVersion":"24.10.0","dependencies":{"pmtiles":"^3.2.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.13.0","vitest":"^4.0.17","globals":"^15.11.0","prettier":"^3.3.3","happy-dom":"^20.3.3","@eslint/js":"^9.13.0","typescript":"^5.6.3","@types/eslint__js":"^8.42.3"},"_npmOperationalInternal":{"tmp":"tmp/pmtiles-protocol_1.1.1_1768816484935_0.2162750587885014","host":"s3://npm-registry-packages-npm-production"}},"1.1.2":{"name":"pmtiles-protocol","version":"1.1.2","description":"PMTiles protocol (pmtiles://) for fetch, XMLHttpRequest and Image","type":"module","main":"index.js","repository":{"type":"git","url":"git+ssh://git@github.com/ahocevar/pmtiles-protocol.git"},"keywords":["pmtiles","mvt","tiles","protomaps","mapbox","openlayers","ol-mapbox-style","mapblibre"],"author":{"name":"Andreas Hocevar","email":"andreas.hocevar@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/ahocevar/pmtiles-protocol/issues"},"homepage":"https://github.com/ahocevar/pmtiles-protocol#readme","scripts":{"lint":"eslint **/*.js && prettier **/*.js --check && tsc --noEmit","generate-fixtures":"node scripts/generate-fixtures.js","test":"vitest run","pretest":"npm run generate-fixtures && npm run lint","prepublishOnly":"tsc"},"dependencies":{"pmtiles":"^3.2.0"},"devDependencies":{"@eslint/js":"^9.13.0","@types/eslint__js":"^8.42.3","eslint":"^9.13.0","globals":"^15.11.0","happy-dom":"^20.3.3","prettier":"^3.3.3","typescript":"^5.6.3","vitest":"^4.0.17"},"gitHead":"6e63a0927286232b8a6785dfa72be2b2a67f9d6a","types":"./index.d.ts","_id":"pmtiles-protocol@1.1.2","_nodeVersion":"24.10.0","_npmVersion":"11.6.1","dist":{"integrity":"sha512-lrAX4usCKrdrCFd9GHH5XRlL8/bmL6rNBKS0V0Yd7t6AKB7GwKzEu16HQIPSuHAT9z+L5Dc2Xy2A9sshzK06xQ==","shasum":"f31e2d56b7569a2e09f364815c560ebf49a5765d","tarball":"https://registry.npmjs.org/pmtiles-protocol/-/pmtiles-protocol-1.1.2.tgz","fileCount":6,"unpackedSize":42537,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC85N0yHWFMzExu6tGuW+OXV7jcnovC+bG7ugX8MXcLvgIhAO/byhtMsIT4A6nUOHp8fg3h/fZXCyo7+kMRK9L8ryz/"}]},"_npmUser":{"name":"ahocevar","email":"andreas.hocevar@gmail.com"},"directories":{},"maintainers":[{"name":"ahocevar","email":"andreas.hocevar@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pmtiles-protocol_1.1.2_1768816871507_0.8612702871542453"},"_hasShrinkwrap":false}},"time":{"created":"2024-10-21T17:06:06.755Z","modified":"2026-01-19T10:01:11.778Z","1.0.0":"2024-10-21T17:06:06.920Z","1.0.1":"2024-10-21T17:12:38.119Z","1.0.2":"2024-10-21T17:30:33.949Z","1.0.3":"2024-10-21T17:50:24.244Z","1.0.4":"2024-10-22T20:23:32.449Z","1.0.5":"2025-02-10T21:59:48.679Z","1.1.0":"2026-01-18T23:39:26.902Z","1.1.1":"2026-01-19T09:54:45.084Z","1.1.2":"2026-01-19T10:01:11.646Z"},"bugs":{"url":"https://github.com/ahocevar/pmtiles-protocol/issues"},"author":{"name":"Andreas Hocevar","email":"andreas.hocevar@gmail.com"},"license":"BSD-2-Clause","homepage":"https://github.com/ahocevar/pmtiles-protocol#readme","keywords":["pmtiles","mvt","tiles","protomaps","mapbox","openlayers","ol-mapbox-style","mapblibre"],"repository":{"type":"git","url":"git+ssh://git@github.com/ahocevar/pmtiles-protocol.git"},"description":"PMTiles protocol (pmtiles://) for fetch, XMLHttpRequest and Image","maintainers":[{"name":"ahocevar","email":"andreas.hocevar@gmail.com"}],"readme":"# pmtiles-protocol\n\nThis package makes it easy to work with [Protomaps](https://protomaps.com) [PMTiles](https://docs.protomaps.com/pmtiles/) directly in the browser. It provides `fetch` and `XMLHttpRequest` versions as well as an `Image` or `HTMLImageElement` setter for `src` that support urls starting with `pmtiles://`, returning the respective TileJSON or tiles. It is meant to be used in browser applications.\n\n## Supported URLs\n\n### TileJSON\n\n- `pmtiles://https://example.com/path/to/mytiles.pmtiles` (absolute)\n- `pmtiles://path/to/mytiles.pmtiles` (relative to `window.location.href`)\n\n### Tiles\n\n- `pmtiles://https://example.com/path/to/mytiles.pmtiles/{z}/{x}/{y}.mvt` (absolute)\n- `pmtiles://path/to/mytiles.pmtiles/{z}/{x}/{y}.png` (relative to `window.location.href`)\n\n## How to use\n\nThe global overrides for `fetch()`, `XMLHttpRequest` and `Image` or `HTMLImageElment`'s `src` setter are the easiest way to use `pmtiles-protocol`:\n\n```js\nimport { register } from 'pmtiles-protocol';\n\nconst unregister = register();\n```\n\nNow every request url that starts with `pmtiles://` for anything in your web application that uses `fetch()` or `XMLHttpRequest` will go through [pmtiles](https://npmjs.com/package/pmtiles). Also, setting the `src` attribute of an `Image` or `HTMLImageElement` to a `pmtiles://` url will load the image from the PMTiles archive.\n\nTo restore the original global `fetch()` and `XMLHttpRequest` versions, and the original `src` setter on `Image` and `HTMLImageElement`, call\n\n```js\nunregister();\n```\n\nIf global overrides are not desired, `pmtiles-protocol` also provides a dedicated `fetch()` function, a dedicated `XMLHttpRequest` replacement, and a dedicated `Image` constructor:\n\n```js\nimport { fetch, XMLHttpRequest, Image } from 'pmtiles-protocol';\n```\n\n## Examples\n\n### fetch\n\n```js\nfetch('pmtiles://https://example.com/mytiles.pmtiles/0/0/0.mvt');\n```\n\nfetches the 0/0/0 tile from the PMTiles file at `https://example.com/mytiles.pmtiles`.\n\n### XMLHttpRequest\n\n```js\nconst xhr = new XMLHttpRequest();\nxhr.open('GET', 'pmtiles://path/to/mytiles.pmtiles');\nxhr.onload = () => {\n  console.log('TileJSON', xhr.responseText);\n};\n```\n\nlogs the TileJSON from the PMTiles file at `path/to/mytiles.pmtiles` (relative to `window.location.href`) to the console.\n\n### Image\n\n```js\nconst img = new Image();\nimg.src = 'pmtiles://https://example.com/mytiles.pmtiles/0/0/0.png';\ndocument.body.appendChild(img);\n```\n\n### In a Mapbox Style document\n\nThe `pmtiles` source below will use the TileJSON and tiles from `https://example.com/mytiles.pmtiles`:\n\n```json\n{\n  \"sources\": {\n    \"pmtiles\": {\n      \"type\": \"vector\",\n      \"url\": \"pmtiles://https://example.com/mytiles.pmtiles\"\n    }\n  }\n}\n```\n\n## Limitations\n\n### fetch()\n\nNo known limitations.\n\n### XMLHttpRequest\n\nThe limitations below only apply when `XMLHttpRequest` is used with a `pmtiles://` url.\n\n- Only the `load` and `error` events are fired.\n- The only methods that act on the PMTiles file are `open()` and `send()`.\n- Only the `response` and `responseText` properties are supported.\n- Only the `200` and `404` status codes are used.\n\n### Image\n\nThe limitations below only apply when `Image` or `HTMLImageElement` is used with a `pmtiles://` url.\n\n- **HTML Attributes**: Setting the `src` attribute via HTML markup (e.g., `<img src=\"pmtiles://...\">`) or `setAttribute` (e.g. `img.setAttribute('src', ...)`) is not supported, because the browser's native network loader handles these before the library's JavaScript interception can run. You must assign to the `src` property (e.g. `img.src = ...`) for it to work.\n- **CSS**: `pmtiles://` URLs are not supported in CSS `background-image` or other CSS properties.\n- **Property Read-back**: When assigning a `pmtiles://` URL to `img.src`, reading `img.src` immediately after will not return the `pmtiles://` URL. Instead, it will return the previous value or the `blob:` URL once the image has loaded. This also applies when inspecting `img.src` inside an `onload` or `onerror` handler.\n- **srcset**: The `srcset` attribute is not supported.\n- **Error Handling**: If loading fails, an `error` event is dispatched on the image element. Note that the error is also logged to `console.error`.\n","readmeFilename":"README.md"}