├── .github ├── pull_request_template.md └── workflows │ ├── format-lint.yml │ └── npm-publish.yml ├── .gitignore ├── .husky └── pre-commit ├── .npmignore ├── CHANGELOG.md ├── LICENSE.md ├── README.md ├── biome.json ├── demos ├── basic.html ├── basic2.html ├── choropleth.html ├── custom_marker.html ├── events.html ├── geolocate.html ├── helpers.html ├── index.html ├── language.html ├── leaf_marker.png ├── leaf_shadow.png ├── overlay.html └── us-states.js ├── images ├── header.png ├── leaflet-maptilersdk.jpg └── sdk_helpers.jpg ├── package-lock.json ├── package.json ├── src └── leaflet-maptilersdk.ts ├── tsconfig.json ├── vite.config-dev.ts ├── vite.config-es.ts └── vite.config-umd.ts /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## Objective 2 | What is the goal? 3 | 4 | ## Description 5 | What changed, how and why? 6 | 7 | ## Acceptance 8 | How were changes tested? 9 | 10 | ## Checklist 11 | - [ ] I have added relevant info to the CHANGELOG.md -------------------------------------------------------------------------------- /.github/workflows/format-lint.yml: -------------------------------------------------------------------------------- 1 | name: Format and Lint 2 | 3 | on: [pull_request] 4 | 5 | jobs: 6 | format-and-lint: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: Check out Git repository 10 | uses: actions/checkout@v4 11 | 12 | - name: Set up Node.js 13 | uses: actions/setup-node@v4 14 | with: 15 | node-version: 20 16 | 17 | - name: Install Node.js dependencies 18 | run: npm ci 19 | 20 | - name: Formatting and linting with Biome 21 | run: npm run biome -------------------------------------------------------------------------------- /.github/workflows/npm-publish.yml: -------------------------------------------------------------------------------- 1 | # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created 2 | # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages 3 | 4 | name: Node.js Package 5 | 6 | on: 7 | release: 8 | types: [created] 9 | 10 | jobs: 11 | build-and-publish: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout repo 15 | uses: actions/checkout@v4 16 | with: 17 | ref: ${{ github.event.release.target_commitish }} 18 | 19 | - uses: actions/setup-node@v4 20 | with: 21 | node-version: 20 22 | registry-url: https://registry.npmjs.org/ 23 | - run: npm ci 24 | - run: npm run make 25 | 26 | - name: Publish NPM package (regular) 27 | if: "!github.event.release.prerelease" 28 | run: | 29 | npm publish 30 | env: 31 | NODE_AUTH_TOKEN: ${{secrets.npm_token}} 32 | 33 | - name: Publish NPM package (pre-release) 34 | if: "github.event.release.prerelease" 35 | run: | 36 | npm publish --tag next 37 | env: 38 | NODE_AUTH_TOKEN: ${{secrets.npm_token}} 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | 45 | # TypeScript v1 declaration files 46 | typings/ 47 | 48 | # TypeScript cache 49 | *.tsbuildinfo 50 | 51 | # Optional npm cache directory 52 | .npm 53 | 54 | # Optional eslint cache 55 | .eslintcache 56 | 57 | # Microbundle cache 58 | .rpt2_cache/ 59 | .rts2_cache_cjs/ 60 | .rts2_cache_es/ 61 | .rts2_cache_umd/ 62 | 63 | # Optional REPL history 64 | .node_repl_history 65 | 66 | # Output of 'npm pack' 67 | *.tgz 68 | 69 | # Yarn Integrity file 70 | .yarn-integrity 71 | 72 | # dotenv environment variables file 73 | .env 74 | .env.test 75 | 76 | # parcel-bundler cache (https://parceljs.org/) 77 | .cache 78 | 79 | # Next.js build output 80 | .next 81 | 82 | # Nuxt.js build / generate output 83 | .nuxt 84 | 85 | 86 | # Gatsby files 87 | .cache/ 88 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 89 | # https://nextjs.org/blog/next-9-1#public-directory-support 90 | # public 91 | 92 | # vuepress build output 93 | .vuepress/dist 94 | 95 | # Serverless directories 96 | .serverless/ 97 | 98 | # FuseBox cache 99 | .fusebox/ 100 | 101 | # DynamoDB Local files 102 | .dynamodb/ 103 | 104 | # TernJS port file 105 | .tern-port 106 | .DS_Store 107 | 108 | tmp.txt 109 | 110 | tests/ 111 | build/ 112 | dist/ 113 | docs/ 114 | 115 | tmp_* -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | npx lint-staged 2 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | src/ 2 | docs 3 | images 4 | tests 5 | vite* 6 | .github 7 | .eslintrc.json 8 | demos 9 | build -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # MapTiler Client Changelog 2 | 3 | ## 4.1.0 4 | - Update @maptiler/sdk to the latest version 5 | 6 | ## 4.0.3 7 | - Move @leaflet/types to dependencies to ensure they're included when project is installed. 8 | 9 | ## 4.0.2 10 | - Fix ES release to use correct declarations 11 | 12 | 13 | ## 4.0.1 14 | - Fix ES release to include correct declarations files 15 | 16 | 17 | ## 4.0.0 18 | ### Other 19 | - Updated with SDK v3 (rc) that in theory supports globe, though this is not enabled in the Leaflet plugin due to inherent limitations of Leaflet 20 | 21 | 22 | ### 3.0.0 23 | ### Others 24 | - Update MapTiler SDK to v2 25 | 26 | 27 | ## 2.0.0 28 | ### New Features 29 | - Major rework of the library to nmake it fully compatible with ES module installable from NPM, yet designed to be fully backward compatible and still usable from CDN/UMD 30 | - The custom layer exposes the MapTiler SDK layer helpers to make it easy to add polyline/point/polygon/heatmap layers 31 | - The custom layer now has a "ready" event that happens when the internal MapTiler SDK Map instance is fully loaded 32 | 33 | 34 | ## 1.0.0 35 | ### New Features 36 | - First release. This was essentially a fork of the [MapLibre version](https://github.com/maplibre/maplibre-gl-leaflet) adapted to MapTiler SDK. 37 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MapTiler SDK Leaflet Module 2 | 3 | Copyright © 2024 MapTiler AG. All rights reserved. 4 | 5 | The software and files (collectively “Software”) in this repository are licensed for use only with MapTiler service(s). 6 | 7 | For the license terms, please reference [MapTiler JavaScript Module Terms and Conditions](https://www.maptiler.com/terms/jsmodule/). 8 | 9 | This license allows users with an active MapTiler account to modify and integrate authorized portions of the Software for use with the relevant MapTiler service(s) in accordance with the MapTiler Terms. This license terminates automatically if a user no longer maintains a MapTiler account or their usage breaches MapTiler Terms. 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | Vector Tiles in Leaflet JS tutorial →
3 |
4 |