{"_id":"@alcalin/leaflet-tilelayer-wmts","_rev":"3-f5e1cdea4b9da8cc713819c3424b7abf","name":"@alcalin/leaflet-tilelayer-wmts","dist-tags":{"latest":"2.0.2"},"versions":{"2.0.0":{"name":"@alcalin/leaflet-tilelayer-wmts","version":"2.0.0","keywords":["leaflet","wmts","tilelayer","gis","maps"],"author":{"name":"Alexandru Calin"},"license":"Beerware","_id":"@alcalin/leaflet-tilelayer-wmts@2.0.0","maintainers":[{"name":"alcalin","email":"alexcalin02@gmail.com"}],"homepage":"https://github.com/alcalin/L.TileLayer.WMTS#readme","bugs":{"url":"https://github.com/alcalin/L.TileLayer.WMTS/issues"},"dist":{"shasum":"87b20d81c97cb8df6ffe0a7f7edf019cd302c739","tarball":"https://registry.npmjs.org/@alcalin/leaflet-tilelayer-wmts/-/leaflet-tilelayer-wmts-2.0.0.tgz","fileCount":8,"integrity":"sha512-2DriQlILo31T3z/ynldejomjM0/zjuTNkkaYsjRHjywmVBnNkUBfJ9d7S5x//wghu6c6nnJwf4e2znuiwy8RKA==","signatures":[{"sig":"MEYCIQD9v1iBP7B4I/4PaxvTDYSPVfmIYWeulztyemBihnM7wAIhAPL3995rcDnf2BIpUr24tuSHOmy34oGTgJ/ZnIxV9ijr","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32004},"main":"./src/leaflet.tilelayer.wmts.js","type":"module","types":"./src/leaflet.tilelayer.wmts.d.ts","module":"./src/leaflet.tilelayer.wmts.js","exports":{".":{"types":"./src/leaflet.tilelayer.wmts.d.ts","import":"./src/leaflet.tilelayer.wmts.js","require":"./src/leaflet.tilelayer.wmts.js"}},"gitHead":"9d4936ccf666b9d0d057c0f57f4238d3b423d48f","scripts":{"test":"echo \"No tests yet\" && exit 0","build":"rollup -c && terser dist/leaflet.tilelayer.wmts.umd.js -o dist/leaflet.tilelayer.wmts.min.js --compress --mangle","prepublishOnly":"npm run build"},"_npmUser":{"name":"alcalin","email":"alexcalin02@gmail.com"},"repository":{"url":"git+https://github.com/alcalin/L.TileLayer.WMTS.git","type":"git"},"_npmVersion":"11.6.0","description":"A modern, lightweight Leaflet plugin for displaying WMTS tile layers.","directories":{},"_nodeVersion":"22.19.0","_hasShrinkwrap":false,"devDependencies":{"rollup":"^4.21.0","terser":"^5.44.0","leaflet":"^1.9.4","@rollup/plugin-node-resolve":"^15.2.3"},"peerDependencies":{"leaflet":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/leaflet-tilelayer-wmts_2.0.0_1758569312254_0.07810602403354361","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@alcalin/leaflet-tilelayer-wmts","version":"2.0.1","keywords":["leaflet","wmts","tilelayer","gis","maps"],"author":{"name":"Alexandru Calin"},"license":"Beerware","_id":"@alcalin/leaflet-tilelayer-wmts@2.0.1","maintainers":[{"name":"alcalin","email":"alexcalin02@gmail.com"}],"homepage":"https://github.com/alcalin/L.TileLayer.WMTS#readme","bugs":{"url":"https://github.com/alcalin/L.TileLayer.WMTS/issues"},"dist":{"shasum":"9a55f64aef5ba79957c0932ddb950becf924b634","tarball":"https://registry.npmjs.org/@alcalin/leaflet-tilelayer-wmts/-/leaflet-tilelayer-wmts-2.0.1.tgz","fileCount":8,"integrity":"sha512-cW05YdmBXjXC97iZ7Ce9Hy/kDv9IZgoHZQ0V4rGNXHPMCtF8QkIIE65/q0ulnPvM0XeHyteVWr8GmdWwTP++uQ==","signatures":[{"sig":"MEYCIQCq6/72hJbfO7BBBdYfNK3I0IPsMHLAD5KzE6nXX9moTAIhALHKjYvIZPLtfN8TvwrLEcwWe+OaW9zok7UR/ENWSGTu","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32112},"main":"./src/leaflet.tilelayer.wmts.js","type":"module","types":"./src/leaflet.tilelayer.wmts.d.ts","module":"./src/leaflet.tilelayer.wmts.js","exports":{".":{"types":"./src/leaflet.tilelayer.wmts.d.ts","import":"./src/leaflet.tilelayer.wmts.js","require":"./src/leaflet.tilelayer.wmts.js"}},"gitHead":"edaf95cc73a9d8c59d7c0fd107bc770a5ded6ff3","scripts":{"test":"echo \"No tests yet\" && exit 0","build":"rollup -c && terser dist/leaflet.tilelayer.wmts.umd.js -o dist/leaflet.tilelayer.wmts.min.js --compress --mangle","prepublishOnly":"npm run build"},"_npmUser":{"name":"alcalin","email":"alexcalin02@gmail.com"},"repository":{"url":"git+https://github.com/alcalin/L.TileLayer.WMTS.git","type":"git"},"_npmVersion":"11.6.0","description":"A modern, lightweight Leaflet plugin for displaying WMTS tile layers.","directories":{},"_nodeVersion":"22.19.0","_hasShrinkwrap":false,"devDependencies":{"rollup":"^4.21.0","terser":"^5.44.0","leaflet":"^1.9.4","@rollup/plugin-node-resolve":"^15.2.3"},"peerDependencies":{"leaflet":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/leaflet-tilelayer-wmts_2.0.1_1758741335344_0.7898390717801607","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"@alcalin/leaflet-tilelayer-wmts","version":"2.0.2","description":"A modern, lightweight Leaflet plugin for displaying WMTS tile layers.","type":"module","main":"./src/leaflet.tilelayer.wmts.js","module":"./src/leaflet.tilelayer.wmts.js","types":"./src/leaflet.tilelayer.wmts.d.ts","exports":{".":{"import":"./src/leaflet.tilelayer.wmts.js","require":"./src/leaflet.tilelayer.wmts.js","types":"./src/leaflet.tilelayer.wmts.d.ts"}},"scripts":{"build":"rollup -c && terser dist/leaflet.tilelayer.wmts.umd.js -o dist/leaflet.tilelayer.wmts.min.js --compress --mangle","prepublishOnly":"npm run build","test":"echo \"No tests yet\" && exit 0"},"repository":{"type":"git","url":"git+https://github.com/alcalin/L.TileLayer.WMTS.git"},"keywords":["leaflet","wmts","tilelayer","gis","maps"],"author":{"name":"Alexandru Calin"},"license":"Beerware","bugs":{"url":"https://github.com/alcalin/L.TileLayer.WMTS/issues"},"homepage":"https://github.com/alcalin/L.TileLayer.WMTS#readme","peerDependencies":{"leaflet":"^1.0.0"},"devDependencies":{"leaflet":"^1.9.4","rollup":"^4.21.0","@rollup/plugin-node-resolve":"^15.2.3","terser":"^5.44.0"},"_id":"@alcalin/leaflet-tilelayer-wmts@2.0.2","gitHead":"06ede12483e37f36a512da41f689edbfcfe0fc3f","_nodeVersion":"22.19.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-fLiC/XbNBP44WIK/+V323cyDg0AV5akQ3unBrgurKaWJvEQqaMWeZlrFknqr+Poj6QavQ34h41r5kx6lioYcdw==","shasum":"6a2133700991efd2ae4bd2685b6183507ef409e9","tarball":"https://registry.npmjs.org/@alcalin/leaflet-tilelayer-wmts/-/leaflet-tilelayer-wmts-2.0.2.tgz","fileCount":8,"unpackedSize":33682,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDySjLy8o5mK+kyPgVh3TmDPrYSQrHfTRs1TUa+26BUZAiEA5s+wCfczVDjcz6vuKZtnl5D71zG2ohIXLI1dLBu1DdU="}]},"_npmUser":{"name":"alcalin","email":"alexcalin02@gmail.com"},"directories":{},"maintainers":[{"name":"alcalin","email":"alexcalin02@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/leaflet-tilelayer-wmts_2.0.2_1758807804015_0.958350796596396"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-22T19:28:32.141Z","modified":"2025-09-25T13:43:24.431Z","2.0.0":"2025-09-22T19:28:32.441Z","2.0.1":"2025-09-24T19:15:35.523Z","2.0.2":"2025-09-25T13:43:24.196Z"},"bugs":{"url":"https://github.com/alcalin/L.TileLayer.WMTS/issues"},"author":{"name":"Alexandru Calin"},"license":"Beerware","homepage":"https://github.com/alcalin/L.TileLayer.WMTS#readme","keywords":["leaflet","wmts","tilelayer","gis","maps"],"repository":{"type":"git","url":"git+https://github.com/alcalin/L.TileLayer.WMTS.git"},"description":"A modern, lightweight Leaflet plugin for displaying WMTS tile layers.","maintainers":[{"name":"alcalin","email":"alexcalin02@gmail.com"}],"readme":"# L.TileLayer.WMTS\r\n\r\n[![npm version](https://img.shields.io/npm/v/@alcalin/leaflet-tilelayer-wmts.svg?style=flat-square)](https://www.npmjs.com/package/@alcalin/leaflet-tilelayer-wmts)\r\n[![npm downloads](https://img.shields.io/npm/dm/@alcalin/leaflet-tilelayer-wmts.svg?style=flat-square)](https://www.npmjs.com/package/@alcalin/leaflet-tilelayer-wmts)\r\n[![bundle size](https://img.shields.io/bundlephobia/min/@alcalin/leaflet-tilelayer-wmts?style=flat-square)](https://bundlephobia.com/result?p=@alcalin/leaflet-tilelayer-wmts)\r\n[![License](https://img.shields.io/badge/license-Beerware-blue.svg?style=flat-square)](LICENSE)\r\n[![Demo](https://img.shields.io/badge/demo-GitHub%20Pages-brightgreen?style=flat-square)](https://alcalin.github.io/L.TileLayer.WMTS/example.html)\r\n\r\nA modern, lightweight **Leaflet WMTS TileLayer** plugin.\r\n\r\n- ✅ Spec-compliant WMTS KVP (`SERVICE`, `REQUEST`, `VERSION`, …)\r\n- ✅ Works out-of-the-box with **GoogleMapsCompatible/WebMercator**\r\n- ✅ Supports **custom TILEMATRIX labels** for non-GMC grids\r\n- ✅ `extraParams`, `baseQuery`, `crossOrigin`, error hooks\r\n- 🧩 Ships **both ESM (for npm/bundlers)** and **UMD (for browsers/demos)** builds\r\n\r\n---\r\n\r\n## Install (npm)\r\n\r\n```bash\r\nnpm i @alcalin/leaflet-tilelayer-wmts leaflet\r\n```\r\n\r\n> Peer dep: you must also install `leaflet` in your app.\r\n\r\n### Usage (bundlers, ESM)\r\n\r\n```js\r\nimport * as L from \"leaflet\";\r\nimport { wmts } from \"@alcalin/leaflet-tilelayer-wmts\";\r\n\r\nconst map = L.map(\"map\").setView([40.7128, -74.0060], 5);\r\n\r\nL.tileLayer(\"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\", {\r\n  maxZoom: 19\r\n}).addTo(map);\r\n\r\n// GoogleMapsCompatible (WebMercator) example\r\nconst layer = wmts(\"https://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer/WMTS/tile/1.0.0/\", {\r\n  layer: \"USGSTopo\",\r\n  style: \"default\",\r\n  tileMatrixSet: \"default028mm\",\r\n  format: \"image/png\",\r\n  googleMapsCompatible: true,\r\n  crossOrigin: true\r\n});\r\n\r\nlayer.addTo(map);\r\n```\r\n\r\n---\r\n\r\n## Browser Demo (UMD build)\r\n\r\nA prebuilt UMD bundle is available under `dist/`.\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n<head>\r\n  <meta charset=\"utf-8\" />\r\n  <title>WMTS Plugin Demo</title>\r\n  <link rel=\"stylesheet\" href=\"https://unpkg.com/leaflet@1.9.4/dist/leaflet.css\" />\r\n</head>\r\n<body>\r\n  <div id=\"map\" style=\"height:100vh\"></div>\r\n\r\n  <script src=\"https://unpkg.com/leaflet@1.9.4/dist/leaflet.js\"></script>\r\n  <script src=\"./dist/leaflet.tilelayer.wmts.min.js\"></script>\r\n  <script>\r\n    const map = L.map(\"map\").setView([40.7, -74], 5);\r\n    L.tileLayer(\"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\", {\r\n      maxZoom: 19\r\n    }).addTo(map);\r\n\r\n    const layer = LTileLayerWMTS.wmts(\r\n      \"https://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer/WMTS/tile/1.0.0/\",\r\n      {\r\n        layer: \"USGSTopo\",\r\n        style: \"default\",\r\n        tileMatrixSet: \"default028mm\",\r\n        format: \"image/png\",\r\n        googleMapsCompatible: true\r\n      }\r\n    );\r\n    layer.addTo(map);\r\n  </script>\r\n</body>\r\n</html>\r\n```\r\n\r\n---\r\n\r\n## Options\r\n\r\n**`WMTSOptions`** (in addition to `L.TileLayerOptions`):\r\n\r\n| Option | Type | Default | Description |\r\n|---|---|---|---|\r\n| `layer` | `string` | — | WMTS layer name |\r\n| `tileMatrixSet` | `string` | — | WMTS matrix set |\r\n| `style` | `string` | `\"default\"` | WMTS style |\r\n| `format` | `string` | `\"image/png\"` | Tile MIME type |\r\n| `tileMatrixLabels` | `(string\\|number)[]` | `undefined` | Map Leaflet zoom → `TILEMATRIX` |\r\n| `googleMapsCompatible` | `boolean` | `true` | Use XYZ mapping directly |\r\n| `extraParams` | `Record<string, any>` | `{}` | Extra query params (e.g., token) |\r\n| `crossOrigin` | `string\\|true` | `undefined` | Sets `crossorigin` on tile images |\r\n| `baseQuery` | `string` | `undefined` | Appended before WMTS KVPs |\r\n\r\n---\r\n\r\n## Project Structure\r\n\r\n```\r\n/src\r\n  leaflet.tilelayer.wmts.js      # ESM source\r\n  leaflet.tilelayer.wmts.d.ts    # TypeScript typings\r\n/dist\r\n  leaflet.tilelayer.wmts.umd.js  # UMD build (Rollup output)\r\n  leaflet.tilelayer.wmts.min.js  # Minified UMD build (for browser/demo)\r\nexample.html                     # GitHub Pages demo (loads dist build)\r\n```\r\n\r\n---\r\n\r\n## Troubleshooting\r\n\r\n- **`Failed to resolve module specifier \"leaflet\"`**  \r\n  Use this package in a bundler-based app (npm install). For browser demos, include the UMD build under `dist/`.\r\n\r\n---\r\n\r\n## License\r\n\r\nBeerware\r\n","readmeFilename":"README.md"}