diff --git a/.bundlemonrc.json b/.bundlemonrc.json new file mode 100644 index 00000000000..e9bba3c5344 --- /dev/null +++ b/.bundlemonrc.json @@ -0,0 +1,18 @@ +{ + "baseDir": "dist", + "files": [ + { + "path": "leaflet.js" + } + ], + "reportOutput": [ + [ + "github", + { + "checkRun": true, + "commitStatus": true, + "prComment": false + } + ] + ] +} diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000000..0a5e51c2013 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +version: 2 +updates: + - package-ecosystem: npm + directory: / + open-pull-requests-limit: 999 + rebase-strategy: disabled + schedule: + interval: weekly + ignore: + - dependency-name: eslint-config-mourner + update-types: ["version-update:semver-major"] + - dependency-name: sinon + update-types: ["version-update:semver-major"] diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000000..cd21f6252c5 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,149 @@ +name: CI +on: [push, pull_request] +env: + NODE_VERSION: 16 +jobs: + setup: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-2019] + steps: + - name: Check out repository + uses: actions/checkout@v2 + + - name: Set up Node + uses: actions/setup-node@v2 + with: + node-version: ${{ env.NODE_VERSION }} + check-latest: true + cache: npm + + - name: Cache dependencies + id: cache-dependencies + uses: actions/cache@v2 + with: + path: node_modules + key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} + + - name: Install dependencies + if: steps.cache-dependencies.outputs.cache-hit != 'true' + run: npm ci + + - name: Build project + run: npm run build + env: + NODE_ENV: ${{ startsWith(github.ref, 'refs/tags/v') && 'release' || '' }} + + - name: Cache setup + uses: actions/cache@v2 + with: + path: ./* + key: ${{ runner.os }}-${{ github.sha }} + + run: + needs: setup + runs-on: ubuntu-latest + strategy: + matrix: + command: [lint, bundlemon] + steps: + - name: Restore setup + uses: actions/cache@v2 + with: + path: ./* + key: ${{ runner.os }}-${{ github.sha }} + + - name: Set up Node + uses: actions/setup-node@v2 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Run ${{ matrix.command }} task + run: npm run ${{ matrix.command }} + env: + BUNDLEMON_PROJECT_ID: 61e0545915f6c3000980d0ed + CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} + + test: + needs: setup + runs-on: ${{ matrix.os || 'ubuntu-latest' }} + strategy: + fail-fast: false + matrix: + include: + - browser: Chrome1280x1024 + - browser: FirefoxTouch + - browser: FirefoxNoTouch + - browser: IE + os: windows-2019 + - browser: IE10 + os: windows-2019 + steps: + - name: Restore setup + uses: actions/cache@v2 + with: + path: ./* + key: ${{ runner.os }}-${{ github.sha }} + + - name: Set up Node + uses: actions/setup-node@v2 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Run tests on ${{ matrix.browser }} + run: npm test -- --browsers ${{ matrix.browser }} + + publish-artifacts: + needs: setup + if: github.repository_owner == 'Leaflet' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')) + runs-on: ubuntu-latest + steps: + - name: Restore setup + uses: actions/cache@v2 + with: + path: ./* + key: ${{ runner.os }}-${{ github.sha }} + + - name: Compress artifacts + working-directory: dist + run: zip -r leaflet.zip . + + - name: Determine directory for artifacts + id: artifacts-directory + run: | + VERSION=$(git tag --points-at HEAD) + echo "::set-output name=path::content/leaflet/${VERSION:-master}" + + - name: Publish artifacts + uses: jakejarvis/s3-sync-action@v0.5.1 + with: + args: --acl public-read --delete --exact-timestamps + env: + AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + SOURCE_DIR: dist + DEST_DIR: ${{ steps.artifacts-directory.outputs.path }} + + publish-npm: + needs: setup + if: github.repository_owner == 'Leaflet' && startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + steps: + - name: Restore setup + uses: actions/cache@v2 + with: + path: ./* + key: ${{ runner.os }}-${{ github.sha }} + + - name: Set up Node + uses: actions/setup-node@v2 + with: + node-version: ${{ env.NODE_VERSION }} + registry-url: https://registry.npmjs.org + + - name: Publish to NPM + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.gitignore b/.gitignore index f3eb61742a6..2e410f4f4a2 100644 --- a/.gitignore +++ b/.gitignore @@ -13,10 +13,8 @@ dist/reference.html coverage/ *.js.html .mailmap -bower.json component.json debug/local/ Gemfile.lock -package-lock.json yarn.lock *.log diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 105e42c4df1..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -sudo: false -language: node_js -node_js: - - node -addons: - artifacts: - paths: - - dist - target_paths: - - content/leaflet/${NAME} - firefox: latest -env: - global: - - ARTIFACTS_BUCKET=leafletjs-cdn - - ARTIFACTS_PERMISSIONS=public-read - - secure: |- - JlC1rD7WryxlUbWmD3NWVX9E60XB/+ss7+j0OaY3WqWziGUWDCuoVkOMGXnp - Ev27O8qhlmRkeyiimUN64UzK0yeZ139DcZMY6r4A5E2kwHYRAO/H/zl5RAGo - Yd9GUPwZfr3xV8WhH2GFy/L/mRjkGwue2o6ZxdsqBOKfYaF9Ryg= - - secure: |- - XW1hzORAtSpTgTKkQwel5gRMDy6SotzeSRsVV2jQCn46VIMx8G/J5nOI+ImL - yeoH12PhCR0h39dM7mq8TYJo5DHwvbotI5nQhpMruSt8eMFbym8nGiqQh806 - fSJXkxmQ4MAjUdNFDIirBHhdZme8q3PueFzJ+5odFMvPGn/aITQ= -script: - - npm test - - xvfb-run --server-args="-screen 0 1280x1024x16" npm run test-nolint -- --browsers Firefox -after_success: - - npm run build - - cd dist && zip -x .DS_Store -r leaflet.zip . && cd .. - - NAME=$TRAVIS_BRANCH - - '[[ $TRAVIS_PULL_REQUEST != ''false'' ]] && NAME=$TRAVIS_PULL_REQUEST' - - '[[ -n $TRAVIS_TAG ]] && NAME=$TRAVIS_TAG' diff --git a/CHANGELOG.md b/CHANGELOG.md index ff3871b91e3..8b3541d57d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,92 @@ Leaflet Changelog (all changes without author notice are by [@mourner](https://github.com/mourner)) +## 1.7.1 (2020-09-04) + +### Bug fixes + +* Fix build toolchain to reflect uglifyjs upgrade from v2 to v3 (by [@ivansanchez](https://github.com/ivansanchez)) + +## 1.7.0 (2020-09-03) + +### API changes + +* `VideoOverlay` now can take a `muted` option ([#7071](https://github.com/Leaflet/Leaflet/pull/7071) by [@ronikar](https://github.com/ronikar)) +* The `featureGroup` factory method now takes `options`, as the `FeatureGroup` constructor ([#7160](https://github.com/Leaflet/Leaflet/pull/7160) by [@frogcat](https://github.com/frogcat)) + +### Improvements + +* Use passive event listeners for `touchstart`/`touchend` events ([#7008](https://github.com/Leaflet/Leaflet/pull/7008) by [@yneet](https://github.com/yneet)) +* Better detection of `PointerEvents`-capable browsers in `L.Browser`, and related changes to `Tap`, `Drag`, and `TouchZoom` handlers ([#7010](https://github.com/Leaflet/Leaflet/pull/7010), ([#7033](https://github.com/Leaflet/Leaflet/pull/7041), ([#7036](https://github.com/Leaflet/Leaflet/pull/7036), ([#7068](https://github.com/Leaflet/Leaflet/pull/7068), ([#7195](https://github.com/Leaflet/Leaflet/pull/7195) by [@johnd0e](https://github.com/johnd0e)) +* Add more browser profiles for the automated tests ([#7115](https://github.com/Leaflet/Leaflet/pull/7115) by [@johnd0e](https://github.com/johnd0e)) + +### Bug fixes + +* Fix canvas renderer not clearing the canvas on some zoom transformations, was affecting opacity of items ([#6915](https://github.com/Leaflet/Leaflet/pull/6915) by [@chipta](https://github.com/chipta)) +* Fix detection of passive events in `L.Browser` ([#6930](https://github.com/Leaflet/Leaflet/pull/6930) by [@Ivan-Perez](https://github.com/Ivan-Perez)) +* Prefix MS-specific CSS style to prevent warnings (by [@ivansanchez](https://github.com/ivansanchez), kudos to [@zachricha](https://github.com/zachricha) for [#6960](https://github.com/Leaflet/Leaflet/pull/6960)) +* Clean up `moveend` listener from `map.setMaxBounds` ([#6958](https://github.com/Leaflet/Leaflet/pull/6958) by [@simon04](https://github.com/simon04)) +* Fix wrong scope of `bind` call in ESM environments ([#6970](https://github.com/Leaflet/Leaflet/pull/6970) by [@shintonik](https://github.com/shintonik)) +* Check that `closePopup` exists before calling it automatically ([#6962](https://github.com/Leaflet/Leaflet/pull/6962) by [@pke](https://github.com/pke)) +* Fix exception when calling `layerGroup.hasLayer()` with wrong `layerId` ([#6998](https://github.com/Leaflet/Leaflet/pull/6998) by [@johnd0e](https://github.com/johnd0e)) +* Remove `click` filter targeting Android 4.x browsers ([#7013](https://github.com/Leaflet/Leaflet/pull/7013) by [@johnd0e](https://github.com/johnd0e)) +* Fix touch zoom handler context ([#7036](https://github.com/Leaflet/Leaflet/pull/7036) by [@johnd0e](https://github.com/johnd0e)) +* Tests for `Bounds.overlaps()` and `Bounds.intersects()` ([#7075](https://github.com/Leaflet/Leaflet/pull/7075) by [@mondeja](https://github.com/mondeja)) +* Fix event propagation in a popup's container ([#7091](https://github.com/Leaflet/Leaflet/pull/7091) by [@johnd0e](https://github.com/johnd0e)) +* Fix tile flickering when `maxNativeZoom === maxZoom` ([#7094](https://github.com/Leaflet/Leaflet/pull/7094) by [@johnd0e](https://github.com/johnd0e)) +* Fix `GridLayer`'s zoom-level loading algorithm ([#7123](https://github.com/Leaflet/Leaflet/pull/7123) by [@johnd0e](https://github.com/johnd0e)) +* Fix `tooltipAnchor` behavior for different tooltip directions ([#7155](https://github.com/Leaflet/Leaflet/pull/7155) by [@Istador](https://github.com/Istador)) + +### Docs & Web Site + +* Updated examples to use non-legacy Mapbox tiles, and related changes ([#6905](https://github.com/Leaflet/Leaflet/pull/6905) by [@riastrad](https://github.com/riastrad)) ([#6922](https://github.com/Leaflet/Leaflet/pull/6922) by [@danswick](https://github.com/danswick)) ([#6995](https://github.com/Leaflet/Leaflet/pull/6995) by [@riastrad](https://github.com/riastrad)) +* Fix documentation for `Polyline.addLatLng()` ([#6924](https://github.com/Leaflet/Leaflet/pull/6924) by [@life777](https://github.com/life777)) +* CRS tutorial: change link for UQM tool to an archived version (by [@ivansanchez](https://github.com/ivansanchez)) +* Fixed minor spelling errors in documentation ([#6850](https://github.com/Leaflet/Leaflet/pull/6850) by [@flopp](https://github.com/flopp)) ([#6944](https://github.com/Leaflet/Leaflet/pull/6944) by [@jieter](https://github.com/jieter)) +* Fixed typo in panes documentation (by [#6939](https://github.com/Leaflet/Leaflet/pull/6939) by [@R4M80MrX](https://github.com/R4M80MrX)) +* Fixed broken URL in quick-start example ([#6982](https://github.com/Leaflet/Leaflet/pull/6982) by [@ekbarber](https://github.com/ekbarber)) +* Fix documentation for `map.setMaxBounds()` ([#7001](https://github.com/Leaflet/Leaflet/pull/7001) by [@johnd0e](https://github.com/johnd0e)) +* Fix tilt code in handler tutorial ([#7014](https://github.com/Leaflet/Leaflet/pull/7014) by [@vncntcltt](https://github.com/vncntcltt)) +* Fix instructions for using `jekyll` when building docs ([#7014](https://github.com/Leaflet/Leaflet/pull/7014) by [@vncntcltt](https://github.com/vncntcltt)) +* Update WMS servers in WMS tutorial ([#7014](https://github.com/Leaflet/Leaflet/pull/7014) by [@vncntcltt](https://github.com/vncntcltt)) +* Website constrast changes and minor cleanup (by [@mourner](https://github.com/mourner)) +* Fixed typo in WMS example ([#7098](https://github.com/Leaflet/Leaflet/pull/7098) by [@andreasnuesslein](https://github.com/andreasnuesslein)) +* Fix documentation for `divOverlay.getElement()` ([#7111](https://github.com/Leaflet/Leaflet/pull/7111) by [@mondeja](https://github.com/mondeja)) +* Fix documentation for `Marker.shadowPane` ([#7135](https://github.com/Leaflet/Leaflet/pull/7135) by [@mi-v](https://github.com/mi-v)) +* Update URL about NPM in developer docs ([#7161](https://github.com/Leaflet/Leaflet/pull/7161) by [@iamtekson](https://github.com/iamtekson)) +* Fix documentation for `Layer.removeFrom()` regarding `LayerGroup`s (by [@ivansanchez](https://github.com/ivansanchez)) +* Fix documentation for `LatLngBounds.overlaps()` [#7194](https://github.com/Leaflet/Leaflet/pull/7194) by [@DerZade](https://github.com/DerZade)) + +## 1.6.0 (2019-11-17) + +### API changes + +* `GeoJSON.resetStyle` - allow invocation without an argument ([#6663](https://github.com/Leaflet/Leaflet/pull/6663) by [joukewitteveen](https://github.com/joukewitteveen)) +* Add new `markersInheritOptions` option to `L.GeoJSON` ([#6866](https://github.com/Leaflet/Leaflet/pull/6866) by [ghybs](https://github.com/ghybs)) + +### Improvements + +* Use passive event listeners ([#6694](https://github.com/Leaflet/Leaflet/pull/6694) by [danielkorte](https://github.com/danielkorte)) +* Add `oldLatLng` coordinates to `L.CircleMarker` `move` event ([#6719](https://github.com/Leaflet/Leaflet/pull/6719) by [errnesto](https://github.com/errnesto)) +* Add tests ([#6839](https://github.com/Leaflet/Leaflet/pull/6839), [#6841](https://github.com/Leaflet/Leaflet/pull/6841) by [ghybs](https://github.com/ghybs)) +* Add test case to ensure scientific notation is formatted correctly ([#6877](https://github.com/Leaflet/Leaflet/pull/6877) by [desean1625](https://github.com/desean1625)) + +### Bug fixes +* Fix performance issue with `L.Util.formatNum` ([#6668](https://github.com/Leaflet/Leaflet/pull/6668) by [cherniavskii](https://github.com/cherniavskii)) +* Respect `className` option in `SVGOverlay` and `VideoOverlay` ([#6679](https://github.com/Leaflet/Leaflet/pull/6679) by [IvanSanchez](https://github.com/IvanSanchez)) +* Cancel the canvas `mousehover` throttle on `mouseout` ([#6749](https://github.com/Leaflet/Leaflet/pull/6749) by [IvanSanchez](https://github.com/IvanSanchez)) +* Check for style being passed in `L.Path.setStyle` ([#6728](https://github.com/Leaflet/Leaflet/pull/6728) by [TheRealTorreySmith](https://github.com/TheRealTorreySmith)) +* Fix `dblclick` event when both Pointer Events and Touch Events are available ([#6855](https://github.com/Leaflet/Leaflet/pull/6855) by [filcab](https://github.com/filcab)) +* Properly unbind animation proxy events when removing map ([#6867](https://github.com/Leaflet/Leaflet/pull/6867) by [ghybs](https://github.com/ghybs)) +* Fix race condition in `Marker` when icon is not present ([#6794](https://github.com/Leaflet/Leaflet/pull/6794) by [BenTalagan](https://github.com/BenTalagan)) + +### Docs & Web Site + +* Update SvgOverlay code example ([#6658](https://github.com/Leaflet/Leaflet/pull/6658) by [cherniavskii](https://github.com/cherniavskii)) +* Fix mobile locate accuracy snippet ([#6693](https://github.com/Leaflet/Leaflet/pull/6693) by [ghybs](https://github.com/ghybs)) +* Fix broken accordions ([#6770](https://github.com/Leaflet/Leaflet/pull/6770) by [mbachner](https://github.com/mbachner)) +* Fix misleading `L.Marker` docs sections ([#6871](https://github.com/Leaflet/Leaflet/pull/6871) by [chloe-mc](https://github.com/chloe-mc)) + ## 1.5.1 (2019-05-08) * Fix module export regression ([#6647](https://github.com/Leaflet/Leaflet/pull/6647) by [cherniavskii](https://github.com/cherniavskii)) @@ -805,7 +891,7 @@ Animation code in Leaflet had undergone a major rewrite (main PR: [#2382](https: * Fixed `Map` `panInsideBounds` to accept array-form bounds (by [@RLRR](https://github.com/RLRR)). [#3489](https://github.com/Leaflet/Leaflet/pull/3489) * Fixed marker draggable state to persist when removing and adding back to the map (by [@IvanSanchez](https://github.com/IvanSanchez)). [#3488](https://github.com/Leaflet/Leaflet/pull/3488) * Fixed inertia not working when parallel to axis (by [@rikvanmechelen](https://github.com/rikvanmechelen)). [#3432](https://github.com/Leaflet/Leaflet/issues/3432) -* Fixed images and SVG inside popups having max-width property overriden (by [@yohanboniface](https://github.com/yohanboniface)). [#3452](https://github.com/Leaflet/Leaflet/pull/3452) +* Fixed images and SVG inside popups having max-width property overridden (by [@yohanboniface](https://github.com/yohanboniface)). [#3452](https://github.com/Leaflet/Leaflet/pull/3452) * Fixed cursors when dragging is disabled (by [@juliensoret](https://github.com/juliensoret)). [#3219](https://github.com/Leaflet/Leaflet/issues/3219) [#3233](https://github.com/Leaflet/Leaflet/pull/3233) * Fixed `LatLng` `wrap` to not drop altitude (by [@IvanSanchez](https://github.com/IvanSanchez)). [#3420](https://github.com/Leaflet/Leaflet/issues/3420) * Fixed Firefox for Android not being detected as mobile (by [@IvanSanchez](https://github.com/IvanSanchez)). [#3419](https://github.com/Leaflet/Leaflet/pull/3419) @@ -1103,7 +1189,7 @@ Note tha we skipped 0.7.6 version for which we accidentally published a broken b ### Dev Workflow improvements -* Leaflet builds (*.js files in the `dist` folder) were removed from the repo and are now done automatically on each commit for `master` and `stable` branches by [Travis CI](travis-ci.org/Leaflet/Leaflet). The download links are on the [Leafet download page](http://leafletjs.com/download.html). +* Leaflet builds (*.js files in the `dist` folder) were removed from the repo and are now done automatically on each commit for `master` and `stable` branches by [Travis CI](travis-ci.org/Leaflet/Leaflet). The download links are on the [Leaflet download page](http://leafletjs.com/download.html). ## 0.6.2 (2013-06-28) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 66af7034751..ad3f54a5218 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -118,15 +118,13 @@ on rebuilding the bundles whenever any source file changes. ## Running the Tests -To run the tests from the command line, -install [PhantomJS](http://phantomjs.org/) (and make sure it's in your `PATH`), -then run: +To run the tests from the command line, install [Google Chrome](https://www.google.com/chrome/) then run: ``` npm test ``` -To run all the tests in actual browsers at the same time, you can do: +To run the tests in other browsers at the same time, you can do: ``` npm test -- -- --browsers Firefox,Chrome,Safari,IE @@ -153,10 +151,10 @@ If you need to make edits in a local repository to see how it looks in the proce 1. [Install Ruby](http://www.ruby-lang.org/en/) if you don't have it yet. 2. Run `gem install jekyll`. 3. Enter the directory where you cloned the Leaflet repository - 4. Run `bundle install` - 5. Make sure you are in the `master` branch by running `git checkout master` - 6. Enter the documentation subdirectory by running `cd docs` - 7. Run `jekyll serve --watch`. + 4. Make sure you are in the `master` branch by running `git checkout master` + 5. Enter the documentation subdirectory by running `cd docs` + 6. Run `bundle install` + 7. Run `jekyll serve --watch` (if you have a Gem::LoadError error run `bundle exec jekyll serve --watch` instead) 8. Open `localhost:4000` in your web browser. Now any file changes will be updated when you reload pages automatically. diff --git a/FAQ.md b/FAQ.md index 4a675214c83..8949ee80109 100644 --- a/FAQ.md +++ b/FAQ.md @@ -137,5 +137,3 @@ updated automatically on each commit to the repo. We removed the built versions from the repository because it's a chore to build and commit them manually on each change, and it often complicates merging branches and managing contributions. - -There's a common complaint that Leaflet can't be used with [Bower](http://bower.io/) because of that, but we'll resolve the issue soon. diff --git a/LICENSE b/LICENSE index d3e8ddfc7b7..7e994c8773c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,23 +1,26 @@ -Copyright (c) 2010-2019, Vladimir Agafonkin +BSD 2-Clause License + +Copyright (c) 2010-2022, Vladimir Agafonkin Copyright (c) 2010-2011, CloudMade All rights reserved. -Redistribution and use in source and binary forms, with or without modification, are -permitted provided that the following conditions are met: +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright notice, this list of - conditions and the following disclaimer. +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, this list - of conditions and the following disclaimer in the documentation and/or other materials - provided with the distribution. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR -TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/PLUGIN-GUIDE.md b/PLUGIN-GUIDE.md index d337ac0d7b4..9aff1985d00 100644 --- a/PLUGIN-GUIDE.md +++ b/PLUGIN-GUIDE.md @@ -134,7 +134,7 @@ And most importantly, keep it simple. Leaflet is all about *simplicity*. NPM (Node Packaged Modules) is a package manager and code repository for JavaScript. Publishing your module on NPM allows other developers to quickly find and install your plugin as well as any other plugins it depends on. -NPM has an excellent [developers guide](https://www.npmjs.org/doc/misc/npm-developers.html) to help you through the process. +NPM has an excellent [developers guide](https://docs.npmjs.com/using-npm/developers.html) to help you through the process. When you publish your plugin you should add a dependency on `leaflet` to your `package.json` file. This will automatically install Leaflet when your package is installed. @@ -213,7 +213,7 @@ Now your plugin is available as an AMD and CommonJS module and can be used in mo Once your plugin is published, it is a good idea to add it to the [Leaflet plugins list](http://leafletjs.com/plugins.html). To do so: * [Fork](https://help.github.com/articles/fork-a-repo/) the Leaflet repo. -* In the `docs/plugins.md` file, find the section your plugin should go in, and add a table row with information and links about your plugin. +* In the `docs/_plugins/` folder, copy the `template.md` file and add it to a category folder. Then put the information and links about your plugin into the new plugin file. * Commit the code to your fork. * [Open a pull request](https://help.github.com/articles/creating-a-pull-request/) from your fork to Leaflet's original repo. diff --git a/README.md b/README.md index 81d7736a220..0df4de082c0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Leaflet Leaflet is the leading open-source JavaScript library for **mobile-friendly interactive maps**. -Weighing just about 37 KB of gzipped JS code, it has all the mapping [features][] most developers ever need. +Weighing just about 39 KB of gzipped JS plus 4 KB of gzipped CSS code, it has all the mapping [features][] most developers ever need. Leaflet is designed with *simplicity*, *performance* and *usability* in mind. It works efficiently across all major desktop and mobile platforms out of the box, @@ -18,7 +18,7 @@ If you want to **get involved** with Leaflet development, check out the [contrib Let's make the best mapping library that will ever exist, and push the limits of what's possible with online maps! -[![Build Status](https://travis-ci.org/Leaflet/Leaflet.svg?branch=master)](https://travis-ci.org/Leaflet/Leaflet) +[![CI](https://github.com/Leaflet/Leaflet/actions/workflows/main.yml/badge.svg)](https://github.com/Leaflet/Leaflet/actions/workflows/main.yml) [contributors]: https://github.com/Leaflet/Leaflet/graphs/contributors [features]: http://leafletjs.com/#features diff --git a/RELEASE.md b/RELEASE.md index bd366d0271b..cf4b0a9869f 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,28 +1,21 @@ -Documentation for the release process of Leaflet. +## Releasing a new version of Leaflet -**Please note that you will need to have a git remote called `origin` that points to Leaflet's GitHub repo, since the publish script assumes it** -- [ ] Make a new release branch (for example named `prepare-X.Y.Z`) -- [ ] Make sure you do not have any `package.lock.json` or `yarn.lock` locally, since they can potentially make you build with the wrong package versions -- [ ] Update [the changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md) since last release and commit to the release branch -- [ ] Write a blog post about the new release and put in `/docs/_posts` and commit to the release branch -- [ ] Bump version number in `package.json` and commit to `master` -- [ ] Run `npm run release` +- [ ] Update [the changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md) since last release and commit. +- [ ] Run `npm version ` (this will bump the version in `package.json` and create a new tag). +- [ ] Run `git push --follow-tags` to push the commit created by NPM to Github (together with the tag). +- [ ] Wait for the CI to complete and follow the logs to make sure it runs successfully. - [ ] Verify that the release was correctly published to NPM by checking: - [ ] [Leaflet NPM package page](https://www.npmjs.com/package/leaflet) - [ ] files on [Leaflet unpkg page](https://unpkg.com/leaflet@latest/) -- [ ] Update API docs: - - [ ] run `npm run docs` - - [ ] Copy the built docs from `dist/reference-X.Y.Z.html` to `docs/reference-X.Y.Z.html`, remove content before first and after second "CUT HERE" comment - - [ ] Insert YAML front matter, see old `docs/reference-X.Y.Z.html` for reference - - [ ] Commit the new docs to the release branch -- [ ] Update `docs/reference.html` to redirect to the new version and commit the change to the release branch -- [ ] Update integrity hashes: - - [ ] Checkout the release tag (`git checkout vX.Y.Z`) - - [ ] Run `npm run integrity` or simply `node ./build/integrity.js` if you're not on Debian - - [ ] Copy the hashes and update `integrity_hash_css`, `integrity_hash_source` and `integrity_hash_uglified` in `docs/_config.yml`; commit changes to the release branch -- [ ] Update link to latest release in `docs/download.html`, and commit to the release branch -- [ ] Add link to new version reference in `docs/reference-versions.html`, and commit to the release branch -- [ ] Update `latest_leaflet_version` (and possibly `latest_leaflet_reference`) in `docs/_config.yml` and commit to the release branch -- [ ] Update the announcement section in `docs/index.html` and commit to the release branch -- [ ] If it looks like everything is good at this point, merge the release branch into `master` - [ ] Make a new release on [Leaflet's GitHub release page](https://github.com/Leaflet/Leaflet/releases/) with the most important parts of the changelog + +### Updating docs after the release + +- [ ] Make a new branch for the update +- [ ] Write a blog post about the new release and put it in `/docs/_posts` +- [ ] If necessary to preserve previous version's docs, rename `dist/reference.html` to `dist/reference-X.Y.Z.html` and add it to the list in `docs/reference-versions.html` +- [ ] Run `npm run docs` to generate the new `docs/reference.html` +- [ ] Run `npm run integrity` and make sure `docs/_config.yml` is updated with new hashes +- [ ] Update link to latest release in `docs/download.md` +- [ ] Update the announcement section in `docs/index.html` +- [ ] Commit all the changes and submit a PR for someone to review diff --git a/build/banner.js b/build/banner.js new file mode 100644 index 00000000000..327745a70e0 --- /dev/null +++ b/build/banner.js @@ -0,0 +1,7 @@ +export function createBanner(version) { + return `/* @preserve + * Leaflet ${version}, a JS library for interactive maps. https://leafletjs.com + * (c) 2010-${new Date().getFullYear()} Vladimir Agafonkin, (c) 2010-2011 CloudMade + */ +`; +} diff --git a/build/docs.js b/build/docs.js index b3ada60a64b..e90544849a4 100755 --- a/build/docs.js +++ b/build/docs.js @@ -1,5 +1,3 @@ -var packageDef = require('../package.json'); - function buildDocs() { console.log('Building Leaflet documentation with Leafdoc ...'); @@ -13,7 +11,7 @@ function buildDocs() { // Note to Vladimir: Iván's never gonna uncomment the following line. He's // too proud of the little leaves around the code. - //doc.setLeadingChar('@'); + // doc.setLeadingChar('@'); // Leaflet uses a couple of non-standard documentable things. They are not // important enough to be classes/namespaces of their own, and should @@ -27,7 +25,7 @@ function buildDocs() { doc.addFile('build/docs-misc.leafdoc', false); var out = doc.outputStr(); - var path = 'dist/reference-' + packageDef.version + '.html'; + var path = 'docs/reference.html'; var fs = require('fs'); diff --git a/build/integrity.js b/build/integrity.js index d6d92076cde..974976cf480 100755 --- a/build/integrity.js +++ b/build/integrity.js @@ -17,11 +17,11 @@ console.log('dist/leaflet.css: ', integrityCss.toString()); var docConfig = fs.readFileSync('docs/_config.yml').toString(); -docConfig = docConfig. - replace(/latest_leaflet_version:.*/, 'latest_leaflet_version: ' + version). - replace(/integrity_hash_source:.*/, 'integrity_hash_source: "' + integritySrc.toString() + '"'). - replace(/integrity_hash_uglified:.*/, 'integrity_hash_uglified: "' + integrityUglified.toString() + '"'). - replace(/integrity_hash_css:.*/, 'integrity_hash_css: "' + integrityCss.toString() + '"'); +docConfig = docConfig + .replace(/latest_leaflet_version:.*/, 'latest_leaflet_version: ' + version) + .replace(/integrity_hash_source:.*/, 'integrity_hash_source: "' + integritySrc.toString() + '"') + .replace(/integrity_hash_uglified:.*/, 'integrity_hash_uglified: "' + integrityUglified.toString() + '"') + .replace(/integrity_hash_css:.*/, 'integrity_hash_css: "' + integrityCss.toString() + '"'); // console.log('New jekyll docs config: \n', docConfig); diff --git a/build/leafdoc-templates/html.hbs b/build/leafdoc-templates/html.hbs index a6f35ef65eb..74c51a7c873 100644 --- a/build/leafdoc-templates/html.hbs +++ b/build/leafdoc-templates/html.hbs @@ -1,153 +1,128 @@ - - - - {{ title }} - +--- +layout: v2 +title: Documentation +bodyclass: api-page +--- - - - - - - - - - -
+

Leaflet API reference

- +

This reference reflects Leaflet {{site.latest_leaflet_version}}. Check this list if you are using a different version of Leaflet.

-

Leaflet API reference

-
- -
-

UI Layers

- -

Raster Layers

- -

Vector Layers

- -
-
-

Other Layers

- -

Basic Types

- -

Controls

- -
-
- - - - - - -

Utility

- -

DOM Utility

- -
-
-

Base Classes

- - -

Misc

- -
+
+ - - {{{ body }}} - - - +
+

UI Layers

+ +

Raster Layers

+ +

Vector Layers

+
+
+

Other Layers

+ +

Basic Types

+ +

Controls

+ +
+
+

Utility

+ +

DOM Utility

+ +
+
+

Base Classes

+ - - +

Misc

+ +
+
- +{{{ body }}} diff --git a/build/publish.sh b/build/publish.sh deleted file mode 100755 index 31b9876c453..00000000000 --- a/build/publish.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -npm update - -VERSION=$(node --eval "console.log(require('./package.json').version);") - -npm test || exit 1 - -echo "Ready to publish Leaflet version $VERSION." -echo "Has the version number been bumped?" -read -n1 -r -p "Press Ctrl+C to cancel, or any other key to continue." key - -git checkout -b build - -export NODE_ENV=release - -npm run-script build - -echo "Creating git tag v$VERSION..." - -git add dist/leaflet-src.js dist/leaflet.js dist/leaflet-src.esm.js dist/leaflet-src.js.map dist/leaflet.js.map dist/leaflet-src.esm.js.map -f - -git commit -m "v$VERSION" - -git tag v$VERSION -f -git push --tags -f - -echo "Uploading to NPM..." - -npm publish - -git checkout master -git branch -D build - -echo "All done." -echo "Remember to run 'npm run-script integrity' and then commit the changes to the master branch, in order to update the website." diff --git a/build/rollup-config.js b/build/rollup-config.js index 2e2db54663d..ea7258feb48 100644 --- a/build/rollup-config.js +++ b/build/rollup-config.js @@ -1,58 +1,54 @@ -// Config file for running Rollup in "normal" mode (non-watch) +// Config file for running Rollup -import rollupGitVersion from 'rollup-plugin-git-version' -import json from 'rollup-plugin-json' -import gitRev from 'git-rev-sync' -import pkg from '../package.json' - -let {version} = pkg; -let release; +import rollupGitVersion from 'rollup-plugin-git-version'; +import json from '@rollup/plugin-json'; +import gitRev from 'git-rev-sync'; +import pkg from '../package.json'; +import {createBanner} from './banner'; +const release = process.env.NODE_ENV === 'release'; +const watch = process.argv.indexOf('-w') > -1 || process.argv.indexOf('--watch') > -1; // Skip the git branch+rev in the banner when doing a release build -if (process.env.NODE_ENV === 'release') { - release = true; -} else { - release = false; - const branch = gitRev.branch(); - const rev = gitRev.short(); - version += '+' + branch + '.' + rev; -} - -const banner = `/* @preserve - * Leaflet ${version}, a JS library for interactive maps. http://leafletjs.com - * (c) 2010-2019 Vladimir Agafonkin, (c) 2010-2011 CloudMade - */ -`; +const version = release ? pkg.version : `${pkg.version}+${gitRev.branch()}.${gitRev.short()}`; +const banner = createBanner(version); const outro = `var oldL = window.L; -exports.noConflict = function() { +leaflet.noConflict = function() { window.L = oldL; return this; } - // Always export us to window global (see #2364) -window.L = exports;`; +window.L = leaflet;`; -export default { +/** @type {import('rollup').RollupOptions} */ +const config = { input: 'src/Leaflet.js', output: [ { file: pkg.main, format: 'umd', - name: 'L', + name: 'leaflet', banner: banner, outro: outro, - sourcemap: true - }, - { - file: 'dist/leaflet-src.esm.js', - format: 'es', - banner: banner, - sourcemap: true + sourcemap: true, + freeze: false, + esModule: false } ], - legacy: true, // Needed to create files loadable by IE8 plugins: [ release ? json() : rollupGitVersion() ] }; + +if (!watch) { + config.output.push( + { + file: 'dist/leaflet-src.esm.js', + format: 'es', + banner: banner, + sourcemap: true, + freeze: false + } + ); +} +export default config; diff --git a/build/rollup-watch-config.js b/build/rollup-watch-config.js deleted file mode 100644 index 1c604047229..00000000000 --- a/build/rollup-watch-config.js +++ /dev/null @@ -1,29 +0,0 @@ -// Config file for running Rollup in "watch" mode -// This adds a sanity check to help ourselves to run 'rollup -w' as needed. - -import rollupGitVersion from 'rollup-plugin-git-version' -import gitRev from 'git-rev-sync' - -const branch = gitRev.branch(); -const rev = gitRev.short(); -const version = require('../package.json').version + '+' + branch + '.' + rev; -const banner = `/* @preserve - * Leaflet ${version}, a JS library for interactive maps. http://leafletjs.com - * (c) 2010-2019 Vladimir Agafonkin, (c) 2010-2011 CloudMade - */ -`; - -export default { - input: 'src/Leaflet.js', - output: { - file: 'dist/leaflet-src.js', - format: 'umd', - name: 'L', - banner: banner, - sourcemap: true - }, - legacy: true, // Needed to create files loadable by IE8 - plugins: [ - rollupGitVersion() - ] -}; diff --git a/debug/hacks/jitter.html b/debug/hacks/jitter.html index 14858f8160b..29cd01a0083 100644 --- a/debug/hacks/jitter.html +++ b/debug/hacks/jitter.html @@ -8,7 +8,7 @@ - + diff --git a/debug/leaflet-include.js b/debug/leaflet-include.js deleted file mode 120000 index 23dfb1d9bd2..00000000000 --- a/debug/leaflet-include.js +++ /dev/null @@ -1 +0,0 @@ -../dist/leaflet-src.js \ No newline at end of file diff --git a/debug/map/canvas.html b/debug/map/canvas.html index 9234b356c19..ccca55407b3 100644 --- a/debug/map/canvas.html +++ b/debug/map/canvas.html @@ -7,7 +7,7 @@ - + diff --git a/debug/map/control-layers.html b/debug/map/control-layers.html index 32b87b03f98..25dafef018b 100644 --- a/debug/map/control-layers.html +++ b/debug/map/control-layers.html @@ -7,7 +7,7 @@ - +
diff --git a/debug/map/controls.html b/debug/map/controls.html index be9488897f8..24906ed5194 100644 --- a/debug/map/controls.html +++ b/debug/map/controls.html @@ -7,7 +7,7 @@ - + diff --git a/debug/map/geolocation.html b/debug/map/geolocation.html index e54d3474425..774710e4312 100644 --- a/debug/map/geolocation.html +++ b/debug/map/geolocation.html @@ -8,7 +8,7 @@ - + diff --git a/debug/map/grid.html b/debug/map/grid.html index 11f4b6005cd..3757ea7ddcd 100644 --- a/debug/map/grid.html +++ b/debug/map/grid.html @@ -9,7 +9,7 @@ - + diff --git a/debug/map/image-overlay.html b/debug/map/image-overlay.html index 13790b5089a..bf1cb1a8ab3 100644 --- a/debug/map/image-overlay.html +++ b/debug/map/image-overlay.html @@ -9,7 +9,7 @@ - + diff --git a/debug/map/layer_remove_add.html b/debug/map/layer_remove_add.html index 3fd81328497..dcbc7120a8e 100644 --- a/debug/map/layer_remove_add.html +++ b/debug/map/layer_remove_add.html @@ -9,7 +9,7 @@ - + diff --git a/debug/map/map-mobile.html b/debug/map/map-mobile.html index fa9ec287894..5ce5c93cdb1 100644 --- a/debug/map/map-mobile.html +++ b/debug/map/map-mobile.html @@ -9,7 +9,7 @@ - + diff --git a/debug/map/map-popup.html b/debug/map/map-popup.html index a0cf98d9c78..e3cb98371c9 100644 --- a/debug/map/map-popup.html +++ b/debug/map/map-popup.html @@ -9,7 +9,7 @@ - + diff --git a/debug/map/map-scaled.html b/debug/map/map-scaled.html index 8b88ff7b977..a99809f1dfe 100644 --- a/debug/map/map-scaled.html +++ b/debug/map/map-scaled.html @@ -28,7 +28,7 @@ } - + diff --git a/debug/map/map.html b/debug/map/map.html index 489fb13dfef..1687eaa02ab 100644 --- a/debug/map/map.html +++ b/debug/map/map.html @@ -9,7 +9,7 @@ - + diff --git a/debug/map/marker-autopan.html b/debug/map/marker-autopan.html index 6bad94391fe..c708cdd43a0 100644 --- a/debug/map/marker-autopan.html +++ b/debug/map/marker-autopan.html @@ -9,7 +9,7 @@ - + diff --git a/debug/map/markers.html b/debug/map/markers.html index 0730f3ea973..3a696f3acce 100644 --- a/debug/map/markers.html +++ b/debug/map/markers.html @@ -9,7 +9,7 @@ - + diff --git a/debug/map/max-bounds-bouncy.html b/debug/map/max-bounds-bouncy.html index bd6d866ae88..f8b1849eafb 100644 --- a/debug/map/max-bounds-bouncy.html +++ b/debug/map/max-bounds-bouncy.html @@ -9,7 +9,7 @@ - + diff --git a/debug/map/max-bounds-infinite.html b/debug/map/max-bounds-infinite.html index e7c460b783a..02cbba4b53e 100644 --- a/debug/map/max-bounds-infinite.html +++ b/debug/map/max-bounds-infinite.html @@ -9,7 +9,7 @@ - + diff --git a/debug/map/max-bounds.html b/debug/map/max-bounds.html index 5e4bf9ccff8..4801af14189 100644 --- a/debug/map/max-bounds.html +++ b/debug/map/max-bounds.html @@ -9,7 +9,7 @@ - + diff --git a/debug/map/opacity.html b/debug/map/opacity.html index a83a1530f8f..738623dc92b 100644 --- a/debug/map/opacity.html +++ b/debug/map/opacity.html @@ -9,7 +9,7 @@ - + - +
diff --git a/debug/map/tile-opacity.html b/debug/map/tile-opacity.html index 5ddf63642c0..31036136d9e 100644 --- a/debug/map/tile-opacity.html +++ b/debug/map/tile-opacity.html @@ -7,7 +7,7 @@ - + diff --git a/debug/map/tooltip.html b/debug/map/tooltip.html index 2cd73ec3aac..de686193fb5 100644 --- a/debug/map/tooltip.html +++ b/debug/map/tooltip.html @@ -7,7 +7,7 @@ - + - + diff --git a/debug/tests/add_remove_layers.html b/debug/tests/add_remove_layers.html index 3b61b184582..02e8db3e89d 100644 --- a/debug/tests/add_remove_layers.html +++ b/debug/tests/add_remove_layers.html @@ -9,7 +9,7 @@ - +
diff --git a/debug/tests/bringtoback.html b/debug/tests/bringtoback.html index e6460255a27..af1d8ea99fb 100644 --- a/debug/tests/bringtoback.html +++ b/debug/tests/bringtoback.html @@ -8,7 +8,7 @@ - + diff --git a/debug/tests/canvasloop.html b/debug/tests/canvasloop.html index 997f8ff07a6..6e3027dcb69 100644 --- a/debug/tests/canvasloop.html +++ b/debug/tests/canvasloop.html @@ -4,7 +4,7 @@ - + diff --git a/debug/tests/click_on_canvas.html b/debug/tests/click_on_canvas.html index d4e02de03d3..a72ef887fb6 100644 --- a/debug/tests/click_on_canvas.html +++ b/debug/tests/click_on_canvas.html @@ -9,7 +9,7 @@ - +
diff --git a/debug/tests/custom-panes.html b/debug/tests/custom-panes.html index 0a6fd08618b..ef993fa12f1 100644 --- a/debug/tests/custom-panes.html +++ b/debug/tests/custom-panes.html @@ -2,15 +2,15 @@ Leaflet debug page - + - + - + - - - + + + - + @@ -63,7 +63,7 @@ },1); } } - + var polygon = (new L.Polygon([ [39, 8.40], [39.10, 8.50], @@ -73,7 +73,7 @@ .on('mouseout',update('exit1')) .on('click',update('click1')) .bindPopup('Triangle 1'); - + var polygon2 = (new L.Polygon([ [39.03, 8.30], [39.10, 8.40], @@ -84,11 +84,11 @@ .on('click',update('click2')) .bindPopup('Triangle 2'); - + var marker = new L.Marker(latlng, {draggable: true}) .bindPopup('Marker');; map.addLayer(marker); - + // map.on('mousemove', function (e) { // marker.setLatLng(e.latlng); @@ -97,7 +97,7 @@ .on('mousemove',update('move3')) .on('mouseout',update('exit3')) .on('click',update('click3')); - + // We should be able to move marker around in a fluid way, // plus going over the polygon with no issue. diff --git a/debug/tests/opacity.html b/debug/tests/opacity.html index 6747d9d2e01..6098a57eab1 100644 --- a/debug/tests/opacity.html +++ b/debug/tests/opacity.html @@ -14,7 +14,7 @@ } - + diff --git a/debug/tests/popup_offset.html b/debug/tests/popup_offset.html index a101853d7b4..83ff95616e0 100644 --- a/debug/tests/popup_offset.html +++ b/debug/tests/popup_offset.html @@ -9,7 +9,7 @@ - + diff --git a/debug/tests/popupcontextmenuclicks.html b/debug/tests/popupcontextmenuclicks.html index 8080f9e1e4d..1251065d401 100644 --- a/debug/tests/popupcontextmenuclicks.html +++ b/debug/tests/popupcontextmenuclicks.html @@ -9,7 +9,7 @@ - + diff --git a/debug/tests/remove_while_dragging.html b/debug/tests/remove_while_dragging.html index 6539738e3c7..5726c782e01 100644 --- a/debug/tests/remove_while_dragging.html +++ b/debug/tests/remove_while_dragging.html @@ -7,7 +7,7 @@ - + diff --git a/debug/tests/removetilewhilepan.html b/debug/tests/removetilewhilepan.html index 8475b0fff6e..0b9bd1c27b2 100644 --- a/debug/tests/removetilewhilepan.html +++ b/debug/tests/removetilewhilepan.html @@ -8,7 +8,7 @@ - + diff --git a/debug/tests/reuse_popups.html b/debug/tests/reuse_popups.html index f1bafbfad54..5feddb99b7d 100644 --- a/debug/tests/reuse_popups.html +++ b/debug/tests/reuse_popups.html @@ -6,7 +6,7 @@ - +
diff --git a/debug/tests/rtl.html b/debug/tests/rtl.html index 2344856cf62..81605a233d6 100644 --- a/debug/tests/rtl.html +++ b/debug/tests/rtl.html @@ -9,7 +9,7 @@ - + diff --git a/debug/tests/set_icon_reuse_dom.html b/debug/tests/set_icon_reuse_dom.html index e4bb7d489c6..f5985f66f3c 100644 --- a/debug/tests/set_icon_reuse_dom.html +++ b/debug/tests/set_icon_reuse_dom.html @@ -5,7 +5,7 @@ - +
diff --git a/debug/tests/svg_clicks.html b/debug/tests/svg_clicks.html index 9056d75e7b9..871b9807d9b 100644 --- a/debug/tests/svg_clicks.html +++ b/debug/tests/svg_clicks.html @@ -8,7 +8,7 @@ - + diff --git a/debug/tests/tile-bounds.html b/debug/tests/tile-bounds.html index c5e6b757d1a..57408906f9b 100644 --- a/debug/tests/tile-bounds.html +++ b/debug/tests/tile-bounds.html @@ -9,7 +9,7 @@ - + diff --git a/debug/tests/touch-shake.html b/debug/tests/touch-shake.html index 7ecdf14d444..1588f1781d1 100644 --- a/debug/tests/touch-shake.html +++ b/debug/tests/touch-shake.html @@ -11,7 +11,7 @@ - + diff --git a/debug/tests/touch-zoom-bounce.html b/debug/tests/touch-zoom-bounce.html index e5486062eea..d3c818b4b60 100644 --- a/debug/tests/touch-zoom-bounce.html +++ b/debug/tests/touch-zoom-bounce.html @@ -11,7 +11,7 @@ - + diff --git a/debug/vector/bounds-extend.html b/debug/vector/bounds-extend.html index 611460fcf01..c3cd3b84257 100644 --- a/debug/vector/bounds-extend.html +++ b/debug/vector/bounds-extend.html @@ -7,7 +7,7 @@ - +
diff --git a/debug/vector/feature-group-bounds.html b/debug/vector/feature-group-bounds.html index de2bc24d617..82947fde4b3 100644 --- a/debug/vector/feature-group-bounds.html +++ b/debug/vector/feature-group-bounds.html @@ -7,7 +7,7 @@ - + diff --git a/debug/vector/geojson.html b/debug/vector/geojson.html index b13733c83bc..54cb3e041c7 100644 --- a/debug/vector/geojson.html +++ b/debug/vector/geojson.html @@ -40,7 +40,7 @@ } - + diff --git a/debug/vector/inherit-dashArray.html b/debug/vector/inherit-dashArray.html index 01d0019e8b6..853ccd98a64 100644 --- a/debug/vector/inherit-dashArray.html +++ b/debug/vector/inherit-dashArray.html @@ -7,7 +7,7 @@ - +
diff --git a/debug/vector/moving-canvas.html b/debug/vector/moving-canvas.html index 043bad5d4fc..3e7ab7424c1 100644 --- a/debug/vector/moving-canvas.html +++ b/debug/vector/moving-canvas.html @@ -9,7 +9,7 @@ - + @@ -17,9 +17,9 @@ + diff --git a/debug/vector/touchzoomemu.html b/debug/vector/touchzoomemu.html index 6402f6b2d1e..f7a8d7f4702 100644 --- a/debug/vector/touchzoomemu.html +++ b/debug/vector/touchzoomemu.html @@ -7,7 +7,7 @@ - +
diff --git a/debug/vector/vector-bounds.html b/debug/vector/vector-bounds.html index 3984a6944e3..1504ef44d8a 100644 --- a/debug/vector/vector-bounds.html +++ b/debug/vector/vector-bounds.html @@ -7,7 +7,7 @@ - +
diff --git a/debug/vector/vector-canvas.html b/debug/vector/vector-canvas.html index 16e1be79a51..aa92675abc1 100644 --- a/debug/vector/vector-canvas.html +++ b/debug/vector/vector-canvas.html @@ -7,7 +7,7 @@ - +
diff --git a/debug/vector/vector-mobile.html b/debug/vector/vector-mobile.html index 66385d4583c..5c059f21ce5 100644 --- a/debug/vector/vector-mobile.html +++ b/debug/vector/vector-mobile.html @@ -9,7 +9,7 @@ - +
diff --git a/debug/vector/vector-simple.html b/debug/vector/vector-simple.html index 6bb4280f287..ff6589482dd 100644 --- a/debug/vector/vector-simple.html +++ b/debug/vector/vector-simple.html @@ -9,14 +9,14 @@ - +
+
diff --git a/debug/vector/vector2.html b/debug/vector/vector2.html index 2050f2a2a81..3c19dc497ce 100644 --- a/debug/vector/vector2.html +++ b/debug/vector/vector2.html @@ -6,7 +6,7 @@ - +
diff --git a/dist/leaflet.css b/dist/leaflet.css index 983d60592b0..01dd2379f9b 100644 --- a/dist/leaflet.css +++ b/dist/leaflet.css @@ -45,7 +45,10 @@ } /* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */ /* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */ -.leaflet-container .leaflet-overlay-pane svg, +.leaflet-container .leaflet-overlay-pane svg { + max-width: none !important; + max-height: none !important; + } .leaflet-container .leaflet-marker-pane img, .leaflet-container .leaflet-shadow-pane img, .leaflet-container .leaflet-tile-pane img, @@ -53,6 +56,8 @@ .leaflet-container .leaflet-tile { max-width: none !important; max-height: none !important; + width: auto; + padding: 0; } .leaflet-container.leaflet-touch-zoom { @@ -166,9 +171,6 @@ /* zoom and fade animations */ -.leaflet-fade-anim .leaflet-tile { - will-change: opacity; - } .leaflet-fade-anim .leaflet-popup { opacity: 0; -webkit-transition: opacity 0.2s linear; @@ -183,9 +185,7 @@ -ms-transform-origin: 0 0; transform-origin: 0 0; } -.leaflet-zoom-anim .leaflet-zoom-animated { - will-change: transform; - } + .leaflet-zoom-anim .leaflet-zoom-animated { -webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1); -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1); @@ -256,9 +256,6 @@ svg.leaflet-image-layer.leaflet-interactive path { .leaflet-container a { color: #0078A8; } -.leaflet-container a.leaflet-active { - outline: 2px solid orange; - } .leaflet-zoom-box { border: 2px dotted #38f; background: rgba(255,255,255,0.5); @@ -268,6 +265,7 @@ svg.leaflet-image-layer.leaflet-interactive path { /* general typography */ .leaflet-container { font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif; + font: 0.75rem/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif; } @@ -393,7 +391,7 @@ svg.leaflet-image-layer.leaflet-interactive path { } /* Default icon URLs */ -.leaflet-default-icon-path { +.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */ background-image: url(images/marker-icon.png); } @@ -419,6 +417,7 @@ svg.leaflet-image-layer.leaflet-interactive path { .leaflet-container .leaflet-control-attribution, .leaflet-container .leaflet-control-scale { font-size: 11px; + font-size: 0.69rem; } .leaflet-left .leaflet-control-scale { margin-left: 5px; @@ -432,6 +431,7 @@ svg.leaflet-image-layer.leaflet-interactive path { line-height: 1.1; padding: 2px 5px 1px; font-size: 11px; + font-size: 0.69rem; white-space: nowrap; overflow: hidden; -moz-box-sizing: border-box; @@ -485,6 +485,7 @@ svg.leaflet-image-layer.leaflet-interactive path { height: 20px; position: absolute; left: 50%; + margin-top: -1px; margin-left: -20px; overflow: hidden; pointer-events: none; @@ -495,6 +496,7 @@ svg.leaflet-image-layer.leaflet-interactive path { padding: 1px; margin: -10px auto 0; + pointer-events: auto; -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); @@ -517,13 +519,12 @@ svg.leaflet-image-layer.leaflet-interactive path { width: 18px; height: 14px; font: 16px/14px Tahoma, Verdana, sans-serif; - color: #c3c3c3; + color: #757575; text-decoration: none; - font-weight: bold; background: transparent; } .leaflet-container a.leaflet-popup-close-button:hover { - color: #999; + color: #585858; } .leaflet-popup-scrolled { overflow: auto; @@ -532,7 +533,7 @@ svg.leaflet-image-layer.leaflet-interactive path { } .leaflet-oldie .leaflet-popup-content-wrapper { - zoom: 1; + -ms-zoom: 1; } .leaflet-oldie .leaflet-popup-tip { width: 24px; @@ -541,9 +542,6 @@ svg.leaflet-image-layer.leaflet-interactive path { -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)"; filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678); } -.leaflet-oldie .leaflet-popup-tip-container { - margin-top: -1px; - } .leaflet-oldie .leaflet-control-zoom, .leaflet-oldie .leaflet-control-layers, @@ -578,7 +576,7 @@ svg.leaflet-image-layer.leaflet-interactive path { pointer-events: none; box-shadow: 0 1px 3px rgba(0,0,0,0.4); } -.leaflet-tooltip.leaflet-clickable { +.leaflet-tooltip.leaflet-interactive { cursor: pointer; pointer-events: auto; } @@ -638,3 +636,13 @@ svg.leaflet-image-layer.leaflet-interactive path { margin-left: -12px; border-right-color: #fff; } + +/* Printing */ + +@media print { + /* Prevent printers from removing background-images of controls. */ + .leaflet-control { + -webkit-print-color-adjust: exact; + color-adjust: exact; + } + } diff --git a/docs/_config.yml b/docs/_config.yml index 98b55f58b0f..ecacd84705f 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -5,12 +5,16 @@ markdown: kramdown kramdown: entity_output: as_input -latest_leaflet_version: 1.5.1 -latest_leaflet_reference: 1.5.0 +latest_leaflet_version: 1.7.1 # Integrity hashes for both leaflet.js and leaflet-src.js # These will be shown in the downloads page # See https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity -integrity_hash_css: "sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ==" -integrity_hash_source: "sha512-eldJj3obVsCO9Tlrj/J8AFrrTFD4+sN8d9HdwKAqZuSgHloWOm6IzetLy1uQnwh9qLssrY3TAgIJQfjPfQJxHQ==" -integrity_hash_uglified: "sha512-GffPMF3RvMeYyc1LWMHtK8EbPv0iNZ8/oTtHPx9/cc2ILxQ+u905qIwdpULaqDkyBKgOaB57QTMg7ztg8Jm2Og==" +integrity_hash_css: "sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A==" +integrity_hash_source: "sha512-I5Hd7FcJ9rZkH7uD01G3AjsuzFy3gqz7HIJvzFZGFt2mrCS4Piw9bYZvCgUE0aiJuiZFYIJIwpbNnDIM6ohTrg==" +integrity_hash_uglified: "sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA==" + + +collections: + plugins: + output: false diff --git a/docs/_includes/plugin_category_table.html b/docs/_includes/plugin_category_table.html new file mode 100644 index 00000000000..974928cdd23 --- /dev/null +++ b/docs/_includes/plugin_category_table.html @@ -0,0 +1,22 @@ +{% assign filteredplugins = site.plugins | where: "category", include.category %} + +
Enter Move Exit Click
Triangle 1:
+{% for plugin in filteredplugins %} + + + + + + +{% endfor %} +
PluginDescriptionDemoMaintainer
{{ plugin.name }}{{ plugin.content }} + {% if plugin.demo %} + Demo + {% endif %} + + {% if plugin.category %} + {{ plugin.author }} + {% else %} + {{ plugin.author }} + {% endif %} +
diff --git a/docs/_layouts/post.html b/docs/_layouts/post.html index 54dcea10fd2..4fedd316490 100644 --- a/docs/_layouts/post.html +++ b/docs/_layouts/post.html @@ -13,18 +13,3 @@

{{ page.title }}

{{ content }} -
- - - -comments powered by Disqus - diff --git a/docs/_layouts/v2.html b/docs/_layouts/v2.html index 50c9e8b4faa..930166a8c10 100644 --- a/docs/_layouts/v2.html +++ b/docs/_layouts/v2.html @@ -1,5 +1,5 @@ - + {% capture title %}{% if page.title %}{{ page.title }} - {% elsif post.title %}{{ post.title }} - {% endif %}{% endcapture %} @@ -11,7 +11,7 @@ - + @@ -49,81 +49,85 @@ -

Leaflet

-

an open-source JavaScript library
for mobile-friendly interactive maps

- - - -
- - -{{ content }} - - - -
- -