├── .editorconfig ├── .github ├── renovate.json └── workflows │ ├── deploy-docs.yml │ ├── release.yml │ └── run-tests.yml ├── .gitignore ├── .nuxtrc ├── .vscode └── settings.json ├── CHANGELOG.md ├── LICENSE ├── README.md ├── docs ├── .vitepress │ ├── config.ts │ └── theme │ │ ├── custom.css │ │ └── index.js ├── about │ └── q&a.md ├── components │ ├── introduction.md │ ├── l-circle-marker.md │ ├── l-circle.md │ ├── l-control-attribution.md │ ├── l-control-layers.md │ ├── l-control-scale.md │ ├── l-control-zoom.md │ ├── l-control.md │ ├── l-feature-group.md │ ├── l-geo-json.md │ ├── l-grid-layer.md │ ├── l-icon.md │ ├── l-image-overlay.md │ ├── l-layer-group.md │ ├── l-map.md │ ├── l-marker.md │ ├── l-polygon.md │ ├── l-polyline.md │ ├── l-popup.md │ ├── l-rectangle.md │ ├── l-tile-layer.md │ ├── l-tooltip.md │ ├── l-wms-tile-layer.md │ └── props │ │ ├── component-props.md │ │ ├── control-props.md │ │ ├── grid-layer-props.md │ │ ├── interactive-layer-props.md │ │ ├── layer-group-props.md │ │ ├── layer-props.md │ │ ├── path-props.md │ │ ├── polygon-props.md │ │ ├── polyline-props.md │ │ ├── popper-props.md │ │ └── tile-layer-props.md ├── getting-started │ ├── installation.md │ └── usage.md ├── guide │ ├── accessing-map-instance.md │ ├── heat.md │ ├── marker-cluster.md │ └── using-l.md ├── index.md └── public │ ├── cover.png │ ├── favicon.ico │ └── nuxt-leaflet-logo.png ├── package-lock.json ├── package.json ├── playground ├── app.vue ├── assets │ └── css │ │ └── main.css ├── components │ └── Navbar.vue ├── nuxt.config.ts ├── package.json ├── pages │ ├── index.vue │ └── map │ │ ├── contextmenu.client.vue │ │ ├── draw.vue │ │ ├── geojson.vue │ │ ├── heat.client.vue │ │ ├── map.vue │ │ └── markercluster.client.vue ├── public │ └── nuxt-leaflet-logo.png ├── server │ └── tsconfig.json └── tsconfig.json ├── src ├── module.ts ├── runtime │ └── composables │ │ ├── useLHeat.ts │ │ └── useLMarkerCluster.ts └── types │ └── dev-types.d.ts ├── test ├── basic.test.ts ├── fixtures │ ├── basic │ │ ├── app.vue │ │ ├── nuxt.config.ts │ │ └── package.json │ ├── heat │ │ ├── app.vue │ │ ├── nuxt.config.ts │ │ └── package.json │ └── markercluster │ │ ├── app.vue │ │ ├── nuxt.config.ts │ │ └── package.json ├── heat.test.ts └── markercluster.test.ts └── tsconfig.json /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_size = 2 5 | indent_style = space 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /.github/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": ["github>nuxt/renovate-config-nuxt"] 4 | } 5 | -------------------------------------------------------------------------------- /.github/workflows/deploy-docs.yml: -------------------------------------------------------------------------------- 1 | # Sample workflow for building and deploying a VitePress site to GitHub Pages 2 | # 3 | name: Deploy VitePress site to Pages 4 | 5 | on: 6 | push: 7 | branches: [main] 8 | paths: 9 | - 'package.json' 10 | - 'package-lock.json' 11 | - 'docs/**' 12 | 13 | # Allows to run this workflow manually from the Actions tab 14 | workflow_dispatch: 15 | 16 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages 17 | permissions: 18 | contents: read 19 | pages: write 20 | id-token: write 21 | 22 | # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. 23 | # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. 24 | concurrency: 25 | group: pages 26 | cancel-in-progress: false 27 | 28 | jobs: 29 | # Build job 30 | build: 31 | runs-on: ubuntu-latest 32 | steps: 33 | - name: Checkout 34 | uses: actions/checkout@v5 35 | with: 36 | fetch-depth: 0 # Not needed if lastUpdated is not enabled 37 | - name: Setup Node 38 | uses: actions/setup-node@v5 39 | with: 40 | node-version: 24 41 | cache: npm # or pnpm / yarn 42 | - name: Setup Pages 43 | uses: actions/configure-pages@v5 44 | - name: Install dependencies 45 | run: npm ci 46 | - name: Setup playground 47 | run: npm run dev:prepare 48 | - name: Build with VitePress 49 | run: VITE_BASE_URL=/leaflet/ npm run docs:build 50 | - name: Upload artifact 51 | uses: actions/upload-pages-artifact@v3 52 | with: 53 | path: docs/.vitepress/dist 54 | 55 | # Deployment job 56 | deploy: 57 | environment: 58 | name: github-pages 59 | url: ${{ steps.deployment.outputs.page_url }} 60 | needs: build 61 | runs-on: ubuntu-latest 62 | name: Deploy 63 | steps: 64 | - name: Deploy to GitHub Pages 65 | id: deployment 66 | uses: actions/deploy-pages@v4 67 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Publish to NPM 2 | 3 | on: 4 | release: 5 | types: [published] 6 | 7 | jobs: 8 | publish: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v5 12 | - uses: actions/setup-node@v5 13 | with: 14 | node-version: 24 15 | registry-url: https://registry.npmjs.org/ 16 | - run: npm ci 17 | - name: Prepare testing with the playground 18 | run: npm run dev:prepare 19 | - name: Test package 20 | run: npm run test 21 | - name: Prepack 22 | run: npm run prepack 23 | # Configure Git for automated commits 24 | - name: Configuring Git 25 | run: git config --global user.name "GitHub CD bot" && git config --global user.email "github-cd-bot@users.noreply.github.com" 26 | # Bump package version 27 | - name: Update package version 28 | run: npm --no-git-tag-version version ${{ github.event.release.tag_name }} 29 | # Publish package to NPM 30 | - name: Publish package to NPM 31 | run: npm publish 32 | env: 33 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 34 | # Push changes to GitHub (package.json and package-lock.json) 35 | - name: Push changes to GitHub 36 | run: git commit -am "Release ${{ github.event.release.tag_name }}" && git push origin HEAD:main 37 | -------------------------------------------------------------------------------- /.github/workflows/run-tests.yml: -------------------------------------------------------------------------------- 1 | name: Run Tests 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | paths: 8 | - 'package.json' 9 | - 'package-lock.json' 10 | - 'src/**' 11 | - 'test/**' 12 | - 'playground/**' 13 | pull_request: 14 | branches: 15 | - main 16 | paths: 17 | - 'package.json' 18 | - 'package-lock.json' 19 | - 'src/**' 20 | - 'test/**' 21 | - 'playground/**' 22 | 23 | jobs: 24 | publish: 25 | runs-on: ubuntu-latest 26 | steps: 27 | - uses: actions/checkout@v5 28 | - uses: actions/setup-node@v5 29 | with: 30 | node-version: 24 31 | registry-url: https://registry.npmjs.org/ 32 | - run: npm ci 33 | - name: Prepare testing with the playground 34 | run: npm run dev:prepare 35 | - name: Test package 36 | run: npm run test 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | node_modules 3 | 4 | # Logs 5 | *.log* 6 | 7 | # Temp directories 8 | .temp 9 | .tmp 10 | .cache 11 | 12 | # Yarn 13 | **/.yarn/cache 14 | **/.yarn/*state* 15 | 16 | # Generated dirs 17 | dist 18 | 19 | # Nuxt 20 | .nuxt 21 | .output 22 | .vercel_build_output 23 | .build-* 24 | .env 25 | .netlify 26 | 27 | # Env 28 | .env 29 | 30 | # Testing 31 | reports 32 | coverage 33 | *.lcov 34 | .nyc_output 35 | 36 | # VSCode 37 | .vscode/* 38 | !.vscode/settings.json 39 | !.vscode/tasks.json 40 | !.vscode/launch.json 41 | !.vscode/extensions.json 42 | !.vscode/*.code-snippets 43 | 44 | # Intellij idea 45 | *.iml 46 | .idea 47 | 48 | # OSX 49 | .DS_Store 50 | .AppleDouble 51 | .LSOverride 52 | .AppleDB 53 | .AppleDesktop 54 | Network Trash Folder 55 | Temporary Items 56 | .apdisk 57 | 58 | # Vitepress Docs 59 | docs/.vitepress/dist 60 | docs/.vitepress/cache -------------------------------------------------------------------------------- /.nuxtrc: -------------------------------------------------------------------------------- 1 | imports.autoImport=true 2 | typescript.includeWorkspace=true 3 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.tabSize": 2, 3 | } 4 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## v1.2.2 4 | 5 | This release replaces `L.popup()` with `L.DomUtil.create()` when creating the popup inside `useLMarkerCluster` 6 | 7 | ### ❤️ Contributors 8 | 9 | - Gugustinette 10 | - @tratteo 11 | 12 | ## v1.2.1 13 | 14 | This release improves the `useLMarkerCluster` to help using legacy methods from Leaflet. 15 | 16 | More info : https://leaflet.nuxtjs.org/guide/marker-cluster.html 17 | 18 | ### ✨ Changes 19 | 20 | - `useLMarkerCluster` now returns 2 objects 21 | - `markers` which is the array of [Marker](https://leafletjs.com/reference.html#marker) created during the creation of the cluster 22 | - `markerCluster` which is the MarkerCluster created 23 | - Markers passed to `useLMarkerCluster` now takes a `popup` option, considered an HTML string, that automatically binds a [Popup](https://leafletjs.com/reference.html#popup) to the corresponding marker 24 | 25 | ### ❤️ Contributors 26 | 27 | - Gugustinette 28 | - @tratteo 29 | 30 | ## v1.2.0 31 | 32 | This release add support fort the [Leaflet.heat](https://github.com/Leaflet/Leaflet.heat) plugin, through an auto-imported composable `useLHeat`. 33 | 34 | More info : https://leaflet.nuxtjs.org/guide/heat.html 35 | 36 | ### ✨ Changes 37 | 38 | - `useLHeat` composable was added to support [Leaflet.heat](https://github.com/Leaflet/Leaflet.heat) 39 | - Related tests and documentation were added 40 | - `useMarkerCluster` was renamed to `useLMarkerCluster` to fit the [standards](https://nuxt.com/docs/guide/going-further/modules#always-prefix-exposed-interfaces) 41 | 42 | ### ❤️ Contributors 43 | 44 | - Gugustinette 45 | 46 | ## v1.1.0 47 | 48 | This release add support fort the [Leaflet.markercluster](https://github.com/Leaflet/Leaflet.markercluster) plugin, through an auto-imported composable `useMarkerCluster`. 49 | 50 | More info : https://leaflet.nuxtjs.org/guide/marker-cluster.html 51 | 52 | ### ✨ Changes 53 | 54 | - **Add support for Leaflet.markercluster** : [issue](https://github.com/nuxt-modules/leaflet/issues/15) 55 | 56 | ### ❤️ Contributors 57 | 58 | - Gugustinette 59 | - Daniel Roe 60 | - @antoineLZCH 61 | - @shinGangan 62 | 63 | ## v1.0.14 64 | 65 | This release is a migration from the old `nuxt3-leaflet` module to the new `@nuxtjs/leaflet` module. 66 | It includes the same features as version `1.0.13` of the old module, but also enable compatibility with Nuxt 4. 67 | 68 | Consider that this is the new module's first stable release, as previous versions are not available on npm through the `@nuxtjs` namespace. 69 | 70 | ### ✨ Changes 71 | 72 | - **Indicate compatibility with Nuxt 4** : [commit](https://github.com/nuxt-modules/leaflet/commit/00f81c18ff80341fdefecec0a0b56d067adbd524) 73 | 74 | ### ❤️ Contributors 75 | 76 | - Gugustinette 77 | - Daniel Roe 78 | 79 | ## v1.0.13 80 | 81 | This release drops the old `leaflet-runtime.ts` to take advantage of the [Vue Leaflet behavior](https://github.com/vue-leaflet/vue-leaflet/blob/db34dff79cc62bc6fa51357e953e9bcf55725c94/src/components/LMap.vue#L250-L256) when importing Leaflet. 82 | This prevent Leaflet from being imported literally everywhere in the app, even if it isn't used. 83 | 84 | ### ✨ Changes 85 | 86 | - **Drop Leaflet runtime import:** [#1](https://github.com/nuxt-modules/leaflet/issues/1) 87 | 88 | ### ❤️ Contributors 89 | 90 | - Gugustinette 91 | - Daniel Roe 92 | 93 | ## v1.0.12 94 | 95 | Initial Release 96 | 97 | ### ✨ Changes 98 | 99 | - **Auto-import Vue Leaflet components:** [v1.0.1](https://github.com/nuxt-modules/leaflet/commit/ae50d3ef634b4903878f3c2b81b0ba7a71795707#diff-9b09a2431586002325ecf88d666c07eedba4dbdec83acfa5890526aa2e18764c) 100 | - **Auto-import Leaflet as L:** [v1.0.3](https://github.com/nuxt-modules/leaflet/commit/67f25f8c8cf59e1c89711e7a938dd292d4e358df#diff-082d2c8211be1dd40cb6dc5a124074d5bb825b41568250ce265dfa4d3e0c601a) 101 | 102 | ### ❤️ Contributors 103 | 104 | - Gugustinette 105 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![@nuxtjs/leaflet](./docs/public/cover.png)](https://leaflet.nuxtjs.org) 2 | 3 | # Nuxt Leaflet 4 | 5 | [![npm version][npm-version-src]][npm-version-href] 6 | [![npm downloads][npm-downloads-src]][npm-downloads-href] 7 | [![License][license-src]][license-href] 8 | [![Nuxt][nuxt-src]][nuxt-href] 9 | 10 | A Nuxt module to use Leaflet. 11 | It was made using [Vue Leaflet](https://github.com/vue-leaflet/vue-leaflet) which is a Vue 3 wrapper for Leaflet, that exposes the original Leaflet API as Vue components. 12 | 13 | This module is really just about making it work with Nuxt without the need to configure anything. 14 | 15 | - [✨  Release Notes](/CHANGELOG.md) 16 | 17 | - [📖  Documentation](https://leaflet.nuxtjs.org) 18 | 19 | ## Features 20 | 21 | - ⚡  No configuration needed 22 | - 🦺  Typescript support 23 | - 🚠  Auto import 24 | 25 | ## Quick Setup 26 | 27 | ```bash 28 | npx nuxi@latest module add @nuxtjs/leaflet 29 | ``` 30 | 31 | That's it! You can now use Leaflet in your Nuxt app ✨ 32 | 33 | ## Usage 34 | 35 | For a complete list of the components available, check out the [official documentation](https://leaflet.nuxtjs.org/components/introduction.html) library. 36 | 37 | ### Basic 38 | 39 | ```vue 40 | 57 | 58 | 62 | ``` 63 | 64 | ## Development 65 | 66 | ```bash 67 | # Install dependencies 68 | npm install 69 | 70 | # Generate type stubs 71 | npm run dev:prepare 72 | 73 | # Develop with the playground 74 | npm run dev 75 | 76 | # Build the playground 77 | npm run dev:build 78 | 79 | # Run Vitest 80 | npm run test 81 | npm run test:watch 82 | 83 | # Release new version 84 | npm run release 85 | ``` 86 | 87 | 88 | [npm-version-src]: https://img.shields.io/npm/v/@nuxtjs/leaflet/latest.svg?style=flat&colorA=18181B&colorB=28CF8D 89 | [npm-version-href]: https://www.npmjs.com/package/@nuxtjs/leaflet 90 | 91 | [npm-downloads-src]: https://img.shields.io/npm/dm/@nuxtjs/leaflet.svg?style=flat&colorA=18181B&colorB=28CF8D 92 | [npm-downloads-href]: https://www.npmjs.com/package/@nuxtjs/leaflet 93 | 94 | [license-src]: https://img.shields.io/npm/l/@nuxtjs/leaflet.svg?style=flat&colorA=18181B&colorB=28CF8D 95 | [license-href]: https://www.npmjs.com/package/@nuxtjs/leaflet 96 | 97 | [nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js 98 | [nuxt-href]: https://nuxt.com 99 | -------------------------------------------------------------------------------- /docs/.vitepress/config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitepress' 2 | 3 | // https://vitepress.dev/reference/site-config 4 | export default defineConfig({ 5 | title: "Nuxt Leaflet", 6 | description: "Documentation for the Nuxt Leaflet module", 7 | head: [['link', { rel: 'icon', href: '/favicon.ico' }]], 8 | base: '/', 9 | themeConfig: { 10 | // https://vitepress.dev/reference/default-theme-config 11 | nav: [ 12 | { text: 'Home', link: '/' }, 13 | { text: 'Quick Start', link: '/getting-started/installation' }, 14 | { text: 'Components', link: '/components/introduction' } 15 | ], 16 | 17 | sidebar: [ 18 | { 19 | text: 'Getting Started', 20 | items: [ 21 | { text: 'Installation', link: '/getting-started/installation' }, 22 | { text: 'Usage', link: '/getting-started/usage' } 23 | ] 24 | }, 25 | { 26 | text: 'Guide', 27 | items: [ 28 | { text: 'Using L', link: '/guide/using-l' }, 29 | { text: 'Accessing a map instance', link: '/guide/accessing-map-instance' }, 30 | { text: 'Leaflet.markercluster', link: '/guide/marker-cluster' }, 31 | { text: 'Leaflet.heat', link: '/guide/heat' } 32 | ] 33 | }, 34 | { 35 | text: 'Components', 36 | collapsed: true, 37 | items: [ 38 | { text: 'Introduction', link: '/components/introduction' }, 39 | { text: 'LCircle', link: '/components/l-circle' }, 40 | { text: 'LCircleMarker', link: '/components/l-circle-marker' }, 41 | { text: 'LControlAttribution', link: '/components/l-control-attribution' }, 42 | { text: 'LControlLayers', link: '/components/l-control-layers' }, 43 | { text: 'LControlScale', link: '/components/l-control-scale' }, 44 | { text: 'LControlZoom', link: '/components/l-control-zoom' }, 45 | { text: 'LControl', link: '/components/l-control' }, 46 | { text: 'LFeatureGroup', link: '/components/l-feature-group' }, 47 | { text: 'LGeoJson', link: '/components/l-geo-json' }, 48 | { text: 'LGridLayer', link: '/components/l-grid-layer' }, 49 | { text: 'LIcon', link: '/components/l-icon' }, 50 | { text: 'LImageOverlay', link: '/components/l-image-overlay' }, 51 | { text: 'LLayerGroup', link: '/components/l-layer-group' }, 52 | { text: 'LMap', link: '/components/l-map' }, 53 | { text: 'LMarker', link: '/components/l-marker' }, 54 | { text: 'LPolygon', link: '/components/l-polygon' }, 55 | { text: 'LPolyline', link: '/components/l-polyline' }, 56 | { text: 'LPopup', link: '/components/l-popup' }, 57 | { text: 'LRectangle', link: '/components/l-rectangle' }, 58 | { text: 'LTileLayer', link: '/components/l-tile-layer' }, 59 | { text: 'LTooltip', link: '/components/l-tooltip' }, 60 | { text: 'LWmsTileLayer', link: '/components/l-wms-tile-layer' }, 61 | ] 62 | }, 63 | { 64 | text: 'About', 65 | items: [ 66 | { text: 'Q&A', link: '/about/q&a' }, 67 | ] 68 | }, 69 | ], 70 | 71 | socialLinks: [ 72 | { icon: 'github', link: 'https://github.com/nuxt-modules/leaflet' }, 73 | { icon: 'npm', link: 'https://www.npmjs.com/package/@nuxtjs/leaflet' } 74 | ], 75 | 76 | search: { 77 | provider: 'local', 78 | } 79 | }, 80 | ignoreDeadLinks: true 81 | }) 82 | -------------------------------------------------------------------------------- /docs/.vitepress/theme/custom.css: -------------------------------------------------------------------------------- 1 | /* Note : colors were taken from Nuxt branding */ 2 | :root { 3 | /* Brand Primary Color */ 4 | --vp-c-brand-1: #03C169; 5 | --vp-c-brand-2: #03C169; 6 | 7 | --vp-button-brand-bg: #03C169; 8 | 9 | /* Backgrounds */ 10 | --vp-c-bg-alt: #F8FAFC; 11 | --vp-c-bg-soft: #F8FAFC; 12 | 13 | /* Sidebar */ 14 | --vp-sidebar-bg-color: #F8FAFC; 15 | 16 | /* Gray */ 17 | --vp-c-gray-3: #F8FAFC; 18 | } 19 | 20 | .dark { 21 | /* Brand Primary Color */ 22 | --vp-c-brand-1: #00DC82; 23 | --vp-c-brand-2: #00DC82; 24 | 25 | --vp-button-brand-bg: #00DC82; 26 | 27 | /* Backgrounds */ 28 | --vp-c-bg: #020420; 29 | --vp-c-bg-alt: #121A31; 30 | --vp-c-bg-elv: #020420; 31 | --vp-c-bg-soft: #121A31; 32 | 33 | /* Sidebar */ 34 | --vp-sidebar-bg-color: #020420; 35 | 36 | /* Gray */ 37 | --vp-c-gray-3: #121A31; 38 | 39 | /* Primary Button */ 40 | --vp-button-brand-text: #0F172A; 41 | --vp-button-brand-hover-text: #0F172A; 42 | --vp-button-brand-active-text: #0F172A; 43 | --vp-button-brand-hover-bg: #03C169; 44 | 45 | /* Hero Background Image */ 46 | --vp-home-hero-image-background-image: linear-gradient(-45deg, #00dc807b 40%, #00dc801a 50%); 47 | --vp-home-hero-image-filter: blur(44px); 48 | } 49 | 50 | /* Leaflet specific style */ 51 | .leaflet-container { 52 | z-index: 0 !important; 53 | } 54 | -------------------------------------------------------------------------------- /docs/.vitepress/theme/index.js: -------------------------------------------------------------------------------- 1 | import DefaultTheme from 'vitepress/theme' 2 | import './custom.css' 3 | 4 | export default DefaultTheme -------------------------------------------------------------------------------- /docs/about/q&a.md: -------------------------------------------------------------------------------- 1 | # Q&A 2 | 3 | ## Does the module support Nuxt 2 ? 4 | 5 | No, the module at least requires Nuxt 3. 6 | 7 | For Nuxt 2, you can use [this module](https://www.npmjs.com/package/nuxt-leaflet). 8 | 9 | ## How does Leaflet compare to Mapbox ? 10 | 11 | [Mapbox](https://www.mapbox.com/) is a mapping platform that provides a suite of tools to create maps and location-based services. It includes similar features to Leaflet, but with paid plans for more advanced services. 12 | 13 | Think of Leaflet as an open-source technology, while Mapbox is a complete collection of advanced tools and services. 14 | 15 | Both are great choices, it depends on your needs and budget. To be fair, [the creator of Leaflet](https://github.com/mourner) also works at Mapbox. 16 | 17 | If you want to use Mapbox with Nuxt, you can use the [Nuxt Mapbox](https://nuxt.com/modules/nuxt-mapbox) module. 18 | 19 | ## How does Leaflet compare to MapLibre ? 20 | 21 | [MapLibre](https://maplibre.org/) is a fork of the original Mapbox GL JS library. It has very similar features to Leaflet, and is also free and open-source. 22 | 23 | :::tip Quote from [MapLibre's Github repository](https://github.com/maplibre/maplibre-gl-js) 24 | MapLibre originated as an open-source fork of mapbox-gl-js, before their switch to a non-OSS license in December 2020. 25 | 26 | The library's initial versions (1.x) were intended to be a drop-in replacement for the Mapbox’s OSS version (1.x) with additional functionality, but have evolved a lot since then. 27 | ::: 28 | 29 | If you want to use MapLibre with Nuxt, we recommend using the [Nuxt MapLibre](https://gugustinette.github.io/nuxt-maplibre) module. 30 | 31 | ## Will Leaflet.draw be supported in the future ? 32 | 33 | [Leaflet.draw](https://leaflet.github.io/Leaflet.draw/docs/leaflet-draw-latest.html) was created to provide a simple way to draw shapes on a map made with Leaflet. 34 | 35 | However, as the project is not maintained anymore (last update in 2018, see [Github repository](https://github.com/Leaflet/Leaflet.draw)), we choose not to include its support in the module. 36 | -------------------------------------------------------------------------------- /docs/components/introduction.md: -------------------------------------------------------------------------------- 1 | --- 2 | outline: deep 3 | --- 4 | 5 | ::: info 6 | Further documentation for these components was highly inspired from [Vue2 Leaflet Documentation](https://vue2-leaflet.netlify.app/components/), [Vue Leaflet Demo](https://github.com/vue-leaflet/vue-leaflet/tree/master/src/playground/views) and the original [Leaflet Documentation](https://leafletjs.com/). 7 | 8 | If you find any errors, please open an issue on the [GitHub repository](https://github.com/nuxt-modules/leaflet). 9 | Props and events can be verified by looking at the [vue-leaflet components](https://github.com/vue-leaflet/vue-leaflet/tree/master/src/components). 10 | ::: 11 | 12 | # Components 13 | 14 | The module automatically registers the following components from [Vue Leaflet](https://github.com/vue-leaflet/vue-leaflet) : 15 | 16 | - `LCircle` 17 | - `LCircleMarker` 18 | - `LControl` 19 | - `LControlAttribution` 20 | - `LControlLayers` 21 | - `LControlScale` 22 | - `LControlZoom` 23 | - `LFeatureGroup` 24 | - `LGeoJson` 25 | - `LIcon` 26 | - `LImageOverlay` 27 | - `LLayerGroup` 28 | - `LMap` 29 | - `LMarker` 30 | - `LPolygon` 31 | - `LPolyline` 32 | - `LPopup` 33 | - `LRectangle` 34 | - `LTileLayer` 35 | - `LTooltip` 36 | - `LWmsTileLayer` 37 | -------------------------------------------------------------------------------- /docs/components/l-circle-marker.md: -------------------------------------------------------------------------------- 1 | --- 2 | outline: deep 3 | --- 4 | 5 | # LCircleMarker 6 | 7 | > A circle of a fixed size with radius specified in pixels. 8 | 9 | ## Demo 10 | 11 | 20 | 21 | 22 | 28 | 33 | 34 | 35 | ```vue{8-12} 36 | 37 | 43 | 48 | 49 | ``` 50 | 51 | ## Props 52 | 53 | | Prop name | Description | Type | Required | Default | 54 | | --------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------- | 55 | | radius | Radius of the marker in pixels | Number | true | 10 | 56 | | latLng | Latitude and longitude of the marker | object\|array as [L.LatLngExpression](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/45d34da16d9556b29be0469dbb66337735690feb/types/leaflet/v0/index.d.ts#L4) | true | [0, 0] | 57 | 58 | ### Inherited props 59 | 60 | 61 | 62 | ## Events 63 | 64 | | Event name | Type | Description | 65 | | -------------- | ------- | -------------------------------------------------- | 66 | | update:visible | boolean | Triggers when the visible prop needs to be updated | 67 | | ready | object | Triggers when the component is ready | 68 | 69 | ## Slots 70 | 71 | | Name | Description | Bindings | 72 | | ------- | ----------- | -------- | 73 | | default | | | 74 | -------------------------------------------------------------------------------- /docs/components/l-circle.md: -------------------------------------------------------------------------------- 1 | --- 2 | outline: deep 3 | --- 4 | 5 | # LCircle 6 | 7 | > Draw a path in the shape of a circle around a center positioned at `latLng` coordinates. 8 | 9 | > It's an approximation and starts to diverge from a real circle closer to the poles (due to projection distortion). 10 | 11 | ## Demo 12 | 13 | 22 | 23 | 24 | 30 | 35 | 36 | 37 | ```vue{8-12} 38 | 39 | 45 | 50 | 51 | ``` 52 | 53 | ## Props 54 | 55 | | Prop name | Description | Type | Required | Default | 56 | | --------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------- | 57 | | radius | Radius of the circle, in meters | Number | true | - | 58 | | latLng | Latitude and longitude of the marker | object\|array as [L.LatLngExpression](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/45d34da16d9556b29be0469dbb66337735690feb/types/leaflet/v0/index.d.ts#L4) | true | [0, 0] | 59 | 60 | ### Inherited props 61 | 62 | 63 | 64 | ## Events 65 | 66 | | Event name | Type | Description | 67 | | -------------- | ------- | -------------------------------------------------- | 68 | | update:visible | boolean | Triggers when the visible prop needs to be updated | 69 | | ready | object | Triggers when the component is ready | 70 | 71 | ## Slots 72 | 73 | | Name | Description | Bindings | 74 | | ------- | ----------- | -------- | 75 | | default | | | 76 | -------------------------------------------------------------------------------- /docs/components/l-control-attribution.md: -------------------------------------------------------------------------------- 1 | --- 2 | outline: deep 3 | --- 4 | 5 | # LControlAttribution 6 | 7 | > The attribution control allows you to display attribution data in a small text bos on a map. 8 | 9 | ## Demo 10 | 11 | 20 | 21 | 22 | 28 | 29 | 30 | 31 | ```vue{8} 32 | 33 | 39 | 40 | 41 | ``` 42 | 43 | ## Props 44 | 45 | | Prop name | Description | Type | Required | Default | 46 | | --------- | --------------------------------------------------------------------- | --------------- | -------- | --------- | 47 | | prefix | The HTML text shown before the attributions. Pass `false` to disable. | String\|boolean | - | 'Leaflet' | 48 | 49 | ### Inherited props 50 | 51 | 52 | 53 | ## Events 54 | 55 | | Event name | Type | Description | 56 | | ---------- | ------ | ------------------------------------ | 57 | | ready | object | Triggers when the component is ready | 58 | -------------------------------------------------------------------------------- /docs/components/l-control-layers.md: -------------------------------------------------------------------------------- 1 | --- 2 | outline: deep 3 | --- 4 | 5 | # LControlLayers 6 | 7 | > The layers control gives users the ability to switch between different base layers and switch overlays on/off. 8 | 9 | ## Demo 10 | 11 | 20 | 21 | 22 | 28 | 29 | 30 | 31 | ```vue{8} 32 | 33 | 39 | 40 | 41 | ``` 42 | 43 | ## Props 44 | 45 | | Prop name | Description | Type | Required | Default | 46 | | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | ------- | 47 | | collapsed | If `true`, the control will be collapsed into an icon and expanded on mouse hover, touch, or keyboard activation. | Boolean | - | true | 48 | | autoZIndex | If `true`, the control will assing zIndexes in increasing order to all of its layers so that the order is preserved when switching them on/off. | Boolean | - | true | 49 | | hideSingleBase | If `true`, the base layers in the control will be hidden when there is only one. | Boolean | - | false | 50 | | sortLayers | Whether to sort the layers. When `false`, layers will keep the order in which they were added to the control. | Boolean | - | false | 51 | | sortFunction | A [compare function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) that will be used for sorting the layers, when `sortLayers` is `true`. The function receives both the [L.Layer](https://leafletjs.com/reference.html#layer) instances and their names, as in `sortFunction(layerA, layerB, nameA, nameB)`. By default, it sorts layers alphabetically by their name. | Function | - | * | 52 | 53 | ### Inherited props 54 | 55 | 56 | 57 | ## Events 58 | 59 | | Event name | Type | Description | 60 | | ---------- | ------ | ------------------------------------ | 61 | | ready | object | Triggers when the component is ready | 62 | -------------------------------------------------------------------------------- /docs/components/l-control-scale.md: -------------------------------------------------------------------------------- 1 | --- 2 | outline: deep 3 | --- 4 | 5 | # LControlScale 6 | 7 | > A simple scale control that shows the scale of the current center of screen in metric (m/km) and imperial (mi/ft) systems. 8 | 9 | ## Demo 10 | 11 | 20 | 21 | 22 | 28 | 29 | 30 | 31 | ```vue{8} 32 | 33 | 39 | 40 | 41 | ``` 42 | 43 | ## Props 44 | 45 | | Prop name | Description | Type | Required | Default | 46 | | -------------- | -------------------------------------------------------------------------------------------------------------- | ------- | -------- | ------- | 47 | | maxWidth | Maximum width of the control in pixels. The width is set dynamically to show round values (eg. 100, 200, 500). | Number | - | 100 | 48 | | metric | Whether to show the metric scale line (m/km). | Boolean | - | true | 49 | | imperial | Whether to show the imperial scale line (mi/ft). | Boolean | - | true | 50 | | updateWhenIdle | If `true`, the control is updated on [moveend](https://leafletjs.com/reference.html#map-moveend), otherwise it's always up-to-date (updated on [move](https://leafletjs.com/reference.html#map-move)). | Boolean | - | false | 51 | 52 | ### Inherited props 53 | 54 | 55 | 56 | ## Events 57 | 58 | | Event name | Type | Description | 59 | | ---------- | ------ | ------------------------------------ | 60 | | ready | object | Triggers when the component is ready | 61 | -------------------------------------------------------------------------------- /docs/components/l-control-zoom.md: -------------------------------------------------------------------------------- 1 | --- 2 | outline: deep 3 | --- 4 | 5 | # LControlZoom 6 | 7 | > A basic zoom control with two buttons (zoom in and zoom out). 8 | 9 | ## Demo 10 | 11 | 20 | 21 | 22 | 28 | 29 | 30 | 31 | ```vue{8} 32 | 33 | 39 | 40 | 41 | ``` 42 | 43 | ## Props 44 | 45 | | Prop name | Description | Type | Required | Default | 46 | | ------------ | -------------------------------------- | ------ | -------- | ---------- | 47 | | zoomInText | The text set on the 'zoom in' button | String | - | '+' | 48 | | zoomInTitle | The title set on the 'zoom in' button | String | - | 'Zoom in' | 49 | | zoomOutText | The text set on the 'zoom out' button | String | - | '-' | 50 | | zoomOutTitle | The title set on the 'zoom out' button | String | - | 'Zoom out' | 51 | 52 | ### Inherited props 53 | 54 | 55 | 56 | ## Events 57 | 58 | | Event name | Type | Description | 59 | | ---------- | ------ | ------------------------------------ | 60 | | ready | object | Triggers when the component is ready | 61 | -------------------------------------------------------------------------------- /docs/components/l-control.md: -------------------------------------------------------------------------------- 1 | --- 2 | outline: deep 3 | --- 4 | 5 | # LControl 6 | 7 | > Base component for implementing map controls. Handles positioning. All other controls extend from this component. 8 | 9 | ## Demo 10 | 11 | 24 | 25 | 26 | 32 | 33 | 37 | 38 | 39 | 40 | ```vue{8-13} 41 | 42 | 48 | 49 | 53 | 54 | 55 | 56 | 61 | ``` 62 | 63 | ## Props 64 | 65 | | Prop name | Description | Type | Required | Default | 66 | | ------------------------ | ----------- | ------- | -------- | ------- | 67 | | disableClickPropagation | | Boolean | - | true | 68 | | disableScrollPropagation | | Boolean | - | false | 69 | 70 | ### Inherited props 71 | 72 | 73 | 74 | ## Events 75 | 76 | | Event name | Type | Description | 77 | | ---------- | ------ | ------------------------------------ | 78 | | ready | object | Triggers when the component is ready | 79 | 80 | ## Slots 81 | 82 | | Name | Description | Bindings | 83 | | ------- | ----------- | -------- | 84 | | default | | | 85 | -------------------------------------------------------------------------------- /docs/components/l-feature-group.md: -------------------------------------------------------------------------------- 1 | --- 2 | outline: deep 3 | --- 4 | 5 | # LFeatureGroup 6 | 7 | > Extended [LLayerGroup](/components/l-layer-group.html) that makes it easier to do the same thing to all its member layers. 8 | 9 | ::: warning 10 | This still needs better documentation and examples. 11 | ::: 12 | 13 | ## Demo 14 | 15 | 24 | 25 | 26 | 32 | 33 | 34 | 35 | 36 | 37 | ```vue 38 | 39 | 45 | 46 | 47 | 48 | 49 | ``` 50 | 51 | ## Props 52 | 53 | This component does not have any specific props. 54 | 55 | ### Inherited props 56 | 57 | 58 | 59 | ## Events 60 | 61 | | Event name | Type | Description | 62 | | -------------- | ------- | -------------------------------------------------- | 63 | | update:visible | boolean | Triggers when the visible prop needs to be updated | 64 | | ready | object | Triggers when the component is ready | 65 | 66 | ## Slots 67 | 68 | | Name | Description | Bindings | 69 | | ------- | ----------- | -------- | 70 | | default | | | 71 | -------------------------------------------------------------------------------- /docs/components/l-geo-json.md: -------------------------------------------------------------------------------- 1 | --- 2 | outline: deep 3 | --- 4 | 5 | # LGeoJson 6 | 7 | > Represents a GeoJSON object or an array of GeoJSON objects. 8 | 9 | ## Demo 10 | 11 | 30 | 31 | 32 | 38 | 42 | 43 | 44 | ```vue{8-11,14-28} 45 | 46 | 52 | 56 | 57 | 58 | 73 | ``` 74 | 75 | 76 | ## Props 77 | 78 | | Prop name | Description | Type | Required | Default | 79 | | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | --------------- | ------- | 80 | | geojson | Should be an object in GeoJSON format (or an array of GeoJSON objects) that will be displayed on the map | Object\|Array as GeoJsonObject | GeoJsonObject[] | - | () => ({}) 81 | | optionsStyle | A Function defining the styling for GeoJSON lines and polygons. See more in [original Leaflet documentation](https://leafletjs.com/reference.html#geojson-style) | Function as L.StyleFunction | - | * | 82 | 83 | ### Inherited props 84 | 85 | 86 | 87 | ## Events 88 | 89 | | Event name | Type | Description | 90 | | -------------- | ------- | -------------------------------------------------- | 91 | | update:visible | boolean | Triggers when the visible prop needs to be updated | 92 | | ready | object | Triggers when the component is ready | 93 | -------------------------------------------------------------------------------- /docs/components/l-grid-layer.md: -------------------------------------------------------------------------------- 1 | --- 2 | outline: deep 3 | --- 4 | 5 | # LGridLayer 6 | 7 | > Creates a map layer where each tile is an instantiated Vue component. 8 | > Each tile component is given `coords` props by `LGridLayer` to indicate 9 | > the zoom level and position of the tile 10 | > (see https://leafletjs.com/examples/extending/extending-2-layers.html#lgridlayer-and-dom-elements). 11 | 12 | ::: warning 13 | 14 | From [Vue Leaflet](https://github.com/vue-leaflet/vue-leaflet/blob/master/src/playground/views/GridLayerDemo.vue) : 15 | 16 | TODO NEXT: While sorting out type errors in LGridLayer.vue, I realized I'm not sure 17 | how or even if its infrastructure is particularly used well. In Vue2Leaflet, 18 | you could pass an arbitrary Vue component to the LGridLayer, to be rendered 19 | for each tile with its coords passed as props. But that doesn't seem set up here. 20 | Should we replicate V2L exactly here? Set things up so that the LGridLayer's $slot 21 | can be where/how the component is setup/configured/passed/added? Simply stick with 22 | the `childRender` prop and simplify some of the logic in LGridLayer.vue? 23 | ::: 24 | 25 | ## Demo 26 | 27 | 44 | 45 | 46 | 52 | 55 | 56 | 57 | ```vue{8-10,13-28} 58 | 59 | 65 | 68 | 69 | 70 | 81 | ``` 82 | 83 | ## Props 84 | 85 | 86 | 87 | ### Inherited props 88 | 89 | 90 | 91 | ## Events 92 | 93 | | Event name | Type | Description | 94 | | -------------- | ------- | -------------------------------------------------- | 95 | | update:visible | boolean | Triggers when the visible prop needs to be updated | 96 | | ready | object | Triggers when the component is ready | 97 | -------------------------------------------------------------------------------- /docs/components/l-icon.md: -------------------------------------------------------------------------------- 1 | --- 2 | outline: deep 3 | --- 4 | 5 | # LIcon 6 | 7 | > Easy and reactive way to configure the icon of a marker 8 | 9 | ## Demo 10 | 11 | 30 | 31 | 32 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | Hello, Map! 51 | 52 | 53 | 54 | 55 | 56 | 57 | 68 | 69 | ```vue 70 | 97 | 98 | 118 | 119 | 130 | ``` 131 | 132 | ## Props 133 | 134 | | Prop name | Description | Type | Required | Default | 135 | | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------- | ------- | 136 | | iconUrl | The URL to the icon image (absolute or relative to your script path) | String | true | null | 137 | | iconRetinaUrl | The URL to a retina sized version of the icon image (absolute or relative to your script path). Used for Retina screen devices. | String | - | null | 138 | | iconSize | Size of the icon image in pixels | Object\|Array as [L.PointExpression](https://leafletjs.com/reference.html#point) | - | null | 139 | | iconAnchor | The coordinates of the "tip" of the icon (relative to its top left corner). The icon will be aligned so that this point is at the marker's geographical location. Centered by default if size is specified, also can be set in CSS with negative margins. | Object\|Array as [L.PointExpression](https://leafletjs.com/reference.html#point) | - | null | 140 | | popupAnchor | The coordinates of the point from which popups will "open", relative to the icon anchor | Object\|Array as [L.PointExpression](https://leafletjs.com/reference.html#point) | - | [0, 0] | 141 | | tooltipAnchor | The coordinates of the point from which tooltips will "open", relative to the icon anchor | Object\|Array as [L.PointExpression](https://leafletjs.com/reference.html#point) | - | [0, 0] | 142 | | shadowUrl | The URL to the icon shadow image. If not specified, no shadow image will be created | String | - | null | 143 | | shadowRetinaUrl | | String | - | null | 144 | | shadowSize | Size of the shadow image in pixels | Object\|Array as [L.PointExpression](https://leafletjs.com/reference.html#point) | - | null | 145 | | shadowAnchor | The coordinates of the "tip" of the shadow (relative to its top left corner) (the same as iconAnchor if not specified) | Object\|Array as [L.PointExpression](https://leafletjs.com/reference.html#point) | - | null | 146 | | bgPos | | Object\|Array as [L.PointExpression](https://leafletjs.com/reference.html#point) | - | [0, 0] | 147 | | className | A custom class name to assign to both icon and shadow images. Empty by default. | String | - | '' | 148 | 149 | ## Slots 150 | 151 | | Name | Description | Bindings | 152 | | ------- | ----------- | -------- | 153 | | default | | | 154 | -------------------------------------------------------------------------------- /docs/components/l-image-overlay.md: -------------------------------------------------------------------------------- 1 | --- 2 | outline: deep 3 | --- 4 | 5 | # LImageOverlay 6 | 7 | > Used to load and display a single image over specific bounds of the map. 8 | 9 | ## Demo 10 | 11 | ::: warning 12 | The demo still needs to be fixed. 13 | ::: 14 | 15 | 55 | 56 | 65 | 71 | 72 | 73 | {{ idx }} 79 | 80 | 81 | 82 | 83 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 |
97 |

Markers

98 |
    99 |
  • 100 | {{ idx }} - lng (X): {{ marker.coordinates.lng }} - lat (Y): 101 | {{ marker.coordinates.lat }} 102 |
  • 103 |
104 |
105 | 106 | ```vue 107 |