Compare commits

...

92 Commits

Author SHA1 Message Date
Jesús Arroyo Torrens
5aad78f5ac Fix setTransform function for desktop webkit 2018-07-12 15:41:32 +02:00
Andrew Cherniavskii
b507e21c51 stop pan key event even when pan anim is in progress (#6231)
When pressing pan key multiple times while pan animation is in progress, `stop` function isn't invoked.
This led to document scroll (if document is scrollable)

This commit fixes the issue to stop pan key event even when pan animation is in progress.
2018-07-09 14:58:24 +03:00
ghybs
d7f91d9a9d docs(geoJsonTutorial): typo (#6222) 2018-07-06 10:09:20 +02:00
ghybs
a5ca3d4c9d Revert "Test(GridLayer): add 2 new tests for zoom-in/-out in graphical browsers (#6201)" (#6221)
For some reason these test pass fine in PR Travis CI, but fail most of the time in Master Build Travis CI (see also https://github.com/Leaflet/Leaflet/pull/6207). Since they are just extra tests, we can happily remove them for now. If the root cause is found later on, it will be easy to merge them back.

This reverts commit 380c44fe04.
2018-07-06 10:08:45 +02:00
ghybs
ba1b253126 docs(GeoJSON): tutorial update quote
from RFC 7946 introduction for consistency.
2018-07-05 14:12:36 +03:00
ghybs
4c9e7cac4c docs(GeoJSON): use RFC link for previous HTML docs
RFC 7946 was officially published in August 2016, i.e. before Leaflet version 1.0.0 (Sep 2016). The previous GeoJSON spec website (geojson.org) displays a big "obsolete" disclaimer on it, making it confusing for developers which version they should refer to. Replace the link to use the RFC that was in use at that time, on all HTML docs since it was available, i.e. from Leaflet 1.0.0.
2018-07-05 14:12:36 +03:00
ghybs
9eb260d9f7 docs(GeoJSON): use RFC link in HTML docs
for current API documentation version (1.3.0/1.3.1) so that it is up to date. It is likely that this docs version will remain the current one for quite some time, given the release pace.
2018-07-05 14:12:36 +03:00
ghybs
e9ba7643d3 docs(GeoJSON): use RFC page in tutorial
for consistency.
2018-07-05 14:12:36 +03:00
ghybs
35e07a947c docs(GeoJSON): update link to RFC page
use the "new" RFC 7946 page (official GeoJSON specification) instead of the obsolete geojson.org website.
2018-07-05 14:12:36 +03:00
Erick Escalante Olano
95b34edbba docs(plugins): add Leaflet-Select-Polygons (#6171) 2018-06-26 15:48:36 +04:00
ghybs
380c44fe04
Test(GridLayer): add 2 new tests for zoom-in/-out in graphical browsers (#6201)
* test(GridLayer): add zoom-in for graph browser

Add a new test for "graphical browsers" for zoom-in animation, not relying on sinon.useFakeTimers so that it lets the animation executing on its own, and is less prone to breaking when the animation process is changed internally.

* test(GridLayer): add zoom-out for graph browsers

Add a new test for "graphical browsers" for zoom-out animation, not relying on sinon.useFakeTimers so that it lets the animation executing on its own, and is less prone to breaking when the animation process is changed internally.
2018-06-26 09:27:54 +04:00
Andrew Cherniavskii
9fda888df2 Test(TravisCI): run tests in Firefox (#5831)
* trying to run tests in FF

* run tests in PhantomJS first

* add chrome test run to travis

* Revert "add chrome test run to travis"

This reverts commit 933f7b5e038722b18b62180edfe4cf19aadc11ab.

* update Firefox test script in Travis CI

* use latest version of Firefox in TravisCI tests

* fix firefox artifact signature in travis config

* trying to set screen size with xvfb-run

* increase screen size

* remove DISPLAY env variable
2018-06-25 15:34:32 +04:00
Andrew Cherniavskii
757e7b6833
Merge pull request #6202 from ghybs/testGridLayerGraphicalBrowsersPanKeepBuffer
Test(GridLayer): fix 2 pan tests with keepBuffer=0 for graphical browsers
2018-06-25 10:43:22 +02:00
JLuc
7d6155b6f0 docs(Browser): more acurate 'retina' flag explanation (#6203)
See https://github.com/Leaflet/Leaflet/issues/6195#issuecomment-399510164
2018-06-25 12:13:59 +04:00
JLuc
a9f9b14a55 docs(Browser): more acurate 'retina' flag explanation #6203 (#6206)
As per issue https://github.com/Leaflet/Leaflet/issues/6195#issuecomment-399510164
2018-06-25 12:12:43 +04:00
Andrew Cherniavskii
079be526f4
Merge pull request #6199 from ghybs/testGridLayerGraphicalBrowsers
test(GridLayer): fix zoom-in/-out for graphical browsers
2018-06-25 09:44:32 +02:00
McBen
d8aa452144 Canvas: allow reset of dashArray and allow array-type as option (#6200) 2018-06-22 20:14:26 +03:00
ghybs
e54128cbae docs(plugins): add defaulticon-compatibility plugin (#6190)
to Frameworks & built systems section.
Added as first plugin in list, so that developers have less chance missing it, and it is useful to many integrations.
2018-06-22 20:10:57 +03:00
ghybs
abeff4d543 test(GridLayer): fix pan move&forth graph browsers
because graphical browsers, even in non-animated pan, will still perform tile fade-in animation, which require some frames before calling _pruneTiles().
2018-06-22 16:06:17 +04:00
ghybs
bed7cd101e test(GridLayer): fix pan keepBuffer graph browser
because graphical browsers, even in non-animated pan, will still perform tile fade-in animation, which require some frames before calling _pruneTiles().
2018-06-22 15:57:40 +04:00
ghybs
d557247d16 style(GridLayerSpec): remove trailing tabs 2018-06-22 12:35:04 +04:00
ghybs
c2d12d0521 test(GridLayer): fix graphical browser zoom out
test on number of pruned tiles during zoom-out in "graphical browsers" (i.e. not PhantomJS) was failing due to incorrect interleaving of rAF and grid.once('load') event listener, not matching the current animation algorithm.
2018-06-22 12:15:22 +04:00
ghybs
5993deb4c8 test(GridLayer): fix graphical browser zoom in
test on number of pruned tiles during zoom-in in "graphical browsers" (i.e. not PhantomJS) was failing due to missing some rAF to let the animation process fully go through and be able to prune the remaining 4 tiles.
2018-06-22 12:09:42 +04:00
Jan Žák
7c33eab7c5 Plugins: Add leaflet-lasso (#6197) 2018-06-22 09:12:41 +02:00
ghybs
8c3eaaf3e8 test(Map): set div width for getBoundsZoom parameter inside, Firefox (#6192)
* test(Map): set div width for getBoundsZoom inside

in particular Firefox has a different default width than PhantomJS, making the result different than the expected one. Wider container => can zoom higher to fit the specified bounds.

* docs(Map): getBoundsZoom add padding

3rd argument docstring.
2018-06-20 12:25:05 +02:00
Sumit Kumar
faa2bd0dac Plugins: update description for Leaflet.pm (#6191) 2018-06-20 09:46:55 +02:00
Patrick Cate
c5712fb9e9 Plugins: Added Vue2Leaflet (#6189) 2018-06-18 01:39:53 +02:00
M.Çağrı Tepebaşılı
0b6e0cd24b Add Leaflet.jsf /java server faces) plugin to the list
added a new plugin to plugins.md
2018-06-07 12:40:23 +02:00
Andrew Cherniavskii
5161140e95
Merge pull request #6164 from tcoupin/master
Plugins: add L.Control.PaintPolygon
2018-05-21 15:16:35 +03:00
Thibault Coupin
9f08a23f7f
Plugins: add L.Control.PaintPolygon 2018-05-20 16:49:56 +02:00
ronikar
24a2512b1b Update plugins.md (#6153) 2018-05-17 10:15:20 +02:00
Roman Zoller
95d6eca24c Plugins: Add Leaflet.TileLayer.Swiss (#6161) 2018-05-17 10:13:33 +02:00
Dave Leaver
00cc6ff119 Clear _resizeRequest when the map is removed (#6160) 2018-05-16 20:55:52 +03:00
Andrew Cherniavskii
fb09dd24c4
Merge pull request #6151 from theel0ja/master
Fix mixed content warnings
2018-05-05 21:28:59 +03:00
Elias Ojala
f07bc77f7f leafletjs.com https 2018-05-04 15:22:36 +03:00
Elias Ojala
60c6fa8a3e placekitten 2018-05-04 15:21:43 +03:00
Elias Ojala
ad785f2cf6 fixed a link 2018-05-04 15:21:36 +03:00
Elias Ojala
74bd6e2933 leaflet.github.com 2018-05-04 15:20:26 +03:00
Elias Ojala
525a98d20e leaflet.github.io 2018-05-04 15:19:57 +03:00
Elias Ojala
3dea761920 leafletjs link 2018-05-04 15:19:15 +03:00
Elias Ojala
ba891024d2 osm link 2018-05-04 15:18:40 +03:00
Elias Ojala
d00a355d6b mapbox link 2018-05-04 15:17:41 +03:00
Elias Ojala
7c6a7b0d6b creativecommons https 2018-05-04 15:17:13 +03:00
Elias Ojala
bd8e8bc4a3 https some gifs 2018-05-04 15:15:50 +03:00
Elias Ojala
684415e3f4 cartocdn https 2018-05-04 15:14:45 +03:00
Elias Ojala
770b88e89b https 2018-05-04 15:14:00 +03:00
Elias Ojala
50d5a0956e http://leafletjs.com/ -> https://leafletjs.com/ 2018-05-04 15:08:47 +03:00
Elias Ojala
08068b77c3 Disqus 2018-05-04 15:08:29 +03:00
Vladimir Agafonkin
a0ca28af29 Create CNAME 2018-05-03 18:19:02 +03:00
Vladimir Agafonkin
4a4326a382 Delete CNAME 2018-05-03 18:18:53 +03:00
Sergej Orlov
aaded0d926 Fixed view bounds calculation in geolocation event handler (#6139) (#6140) 2018-04-27 17:26:44 +02:00
Jan Pieter Waagmeester
bd89edd567 Fix typo in LatLng docstring. (#6138) 2018-04-20 21:12:23 +02:00
Denys Dovhan
0e9797edce Refactor(gitignore): ignore package-lock.json and yarn.lock explicitly (#6127)
https://github.com/Leaflet/Leaflet/pull/6124#issuecomment-379366811
2018-04-10 10:28:11 +04:00
Baku
0b868472a2 Apply #5498 for Polygons too (#6119) 2018-04-06 23:32:07 +03:00
Denys Dovhan
9d12f4185d Add locks and logs to .gitignore. (#6124) 2018-04-06 23:21:37 +03:00
Iván Sánchez Ortega
ac4753cb64
docs: update playground link
fixes #6121
2018-04-06 12:50:07 +02:00
Anton Joy
27989c55dd Fix for memory leak in canvas renderer (#6117) 2018-04-05 15:24:38 +03:00
Supun Praneeth
22d9cfee93 plugins: add Leaflet.bezier (#6114)
* Leaflet.bezier added to  plugin list

This plugin draw a Bézier line between two point with an animated flight object.

* typo
2018-04-03 09:07:53 +02:00
Yasunori Kirimoto
d68708d626 Plugins: add tilelayer.mierune (#6107)
* 📝 Change plugins.md

- 📝 Change plugins.md

* Plugins: mierune Capitalization
2018-03-27 10:02:48 +02:00
elmarquis
8a009fa662 Plugins: Add leaflet.GestureHandling (#6098) 2018-03-19 16:06:16 +01:00
ghybs
fe9e0f2333
Fix(Draggable): compensate for container CSS scale (#6055)
* Test(MapDragSpec): add mouse drag with CSS scaled container

This test is failing as of this commit.

* Fix(Draggable): measure drag compensating for CSS scale

so that the computed offset (i.e. user drag length) is divided by the CSS scale applied on the `_element`'s container. Later on when `Draggable` updates the `_element`'s position, the latter is affected by the CSS scale by the browser.
Added a `getSizedParentNode` function in `DomUtil` in order to automatically retrieve the closest parent node in the DOM hierarchy tree that has a non null size (so that we can compute the scale in `DomEvent.getMousePosition`), without having to specify the parent node explicitly (which is ugly).

* Fix(getMousePosition): getBoundingClientRect is in page scale

therefore it must also be divided by the container scale in order to compute the relative position of the event in the scaled container.

* Test(MarkerDragSpec): add drag with CSS scaled container

this should pass automatically at this commit, thanks to the previous modification of Draggable.

* Debug(map-scaled): add draggable marker

as well as another CSS scaled wrapper, plus some border and padding, and debugging console logs, to make sure the computations of `getMousePosition` are correct (correctly removing the border width, and compensating for CSS scale).

* Docs(getMousePosition): explicitly exclude border

* Docs(DomUtil): add return value of getSizedParentNode

was missing in docstring.

* Feat(DomUtil): add getScale function

so that it can be used by DomEvent.getMousePosition and Draggable.

* Refactor(Draggable): cache container scale

to avoid triggering browser reflow continuously during _onMove, but only on drag start (_onDown).
By compensating for the scale within Draggable instead of delegating to DomEvent.getMousePosition, it also becomes possible to check first for the clickTolerance, so that we prevents user's small movement based on screen, irrespective of rendered scale.

* Test(Map+MarkerDrag): remove scale on initial movement

that is intended to overcome Draggable clickTolerance, since now it is based on screen pixels, irrespective of applied CSS scale on the map.
Thanks to the tolerance in the expected final position, this has no effect on the result of the test, even though the overall drag is now slightly shorter.

* Refactor(DomEvent): use DomUtil.getScale in getMousePosition

to factorize scale computation (also used within Draggable).
2018-03-16 19:46:44 +04:00
Mandy Kong
c49833d882 Plugins: Adding Leaflet-Shades (#6095) 2018-03-15 15:39:20 +01:00
Sumit Kumar
6471228260 plugins: minor leaflet.pm compatibility note (#6094) 2018-03-15 09:29:14 +01:00
haoming
4f80e78528 Plugins: add Leaflet.RoughCanvas (#6093)
Add a new *render* plugin which let users draw vector map in a sketchy, hand-drawn-like, style.
2018-03-14 09:06:36 +01:00
haoming
7f17c6fcfd Fix typo in comments in VideoOverlay.js (#6090)
The example comments are wrong which confuse reader.
2018-03-12 13:53:05 +01:00
Roman Zoller
5ffe207921 Use https everywhere for OSM links (#6082)
* Use https everywhere for OSM tile URLs

Use
https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png

instead of
http://{s}.tile.osm.org/{z}/{x}/{y}.png
http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png

* Use https everywhere for OSM attribution link

Use
https://www.openstreetmap.org/copyright

instead of
http://www.openstreetmap.org/copyright
http://osm.org/copyright
2018-03-12 08:46:20 +01:00
Andrew Cherniavskii
c7b5d1deba update ssri dependency to 5.2.2 (#6086) 2018-03-09 12:20:31 +01:00
Baku
31575e8e7a 2018 (#6076)
* 2018

* 2018

* 2018
2018-03-05 22:46:47 +02:00
Franz-Benjamin Mocnik
6708981c74 plugins: tweak line breaks (#6079) 2018-03-04 19:11:09 +01:00
Franz-Benjamin Mocnik
05ba52e0ee Plugins: add geogrid.js (ISEA3H geodetic grids) (#6078) 2018-03-04 19:04:55 +01:00
Matt Steele
018bac0e9e Docs(Polyline): closestLayerPoint add missing param doc (#6060)
as commented on PR #5701 (https://github.com/Leaflet/Leaflet/pull/5701#issuecomment-357726857)
2018-02-20 16:40:24 +04:00
ghybs
fa374e67a2 Fix(TileLayer.WMS & Canvas): get rid of calls to global L (#6048)
* Fix(TileLayerWMS): get rid of L.TileLayer global call

and rely on imported TileLayer instead.

* Fix(Canvas): get rid of L.stamp global call

and rely on imported Util.stamp instead.
2018-02-12 13:52:10 +01:00
ghybs
870365de4c Fix(MarkerDrag): get rid of L.DomUtil calls (#6047)
* Style(MarkerDrag): fix smart tab indentation

* Fix(MarkerDrag): get rid of L.DomUtil global call

and rely on imported DomUtil instead.
2018-02-12 13:51:37 +01:00
ghybs
224bb9372b
Test(MarkerDragSpec): remove commented code (#6049) 2018-02-12 16:39:15 +04:00
Andrew
e3b049cefd Chore(scripts): Remove jake dependency and use NPM scripts instead (#5828)
* run `docs` via npm

* add shebang line to integrity.js, so npm will resolve node binary automatically

* remove unnecessary build-jake npm script

* add test.js script as replacement of Jakefile.js

* remove Jakefile, remove jake from devDependencies

* update docs

* move scripts to separate directory

* change shebang line from nodejs to js

* change shebang line from js to node

* update docs

* use Karma cli instead of custom test script

* add pretest and test-nolint scripts, remove lint scripts from travis.ci

Run linting scripts in pretest script, this way test script will automatically trigger code linting.

Add test-nolint script to have possibility to run tests without triggering pretest script with linting. This is useful when running tests in different browsers and tere's no sense to lint code more than one time

* replace shebang lines with node executable in npm scripts

* remove note about nodejs symlink in CONTRIBUTING.md
2018-02-05 11:15:32 +04:00
Moritz
be8899c0e4 plugins: add Leaflet Truesize (#6039) 2018-02-02 14:03:28 +01:00
Rich Harris
d188cc5ede add pkg.module (#6021)
* add pkg.module version

* get tests to pass

* export noConflict
2018-02-01 10:42:54 -05:00
Dražen Tutić
d3175e807f Plugins: add EdgeScaleBar (#6036)
Add plugin EdgeScaleBar that draw scale bars along map edges in Web Mercator projection.
2018-01-31 16:32:03 +01:00
louMoxy
3e8e76c790 Fix race condition when removing canvas before it has rendered (#6033)
Fixes #6030: Cancel animation frame request before removing the map.
This fixes the bug where the the delayed call to _redraw is trying to get the drawing context which has already been destroyed.
2018-01-29 15:36:50 +01:00
Andrew
c3a6a5b60a Move external dependencies to node_modules (#6028)
* remove sinon from repo and add sinon and karma-sinon devDeps

* remove expect from repo and add karma-expect to devDeps instead

* fix path to sinon and expect in html file for browser testing

* include leaflet-src directly from dist instead of symlink pointing to it
2018-01-29 09:38:05 +04:00
ghybs
510c3e7ba7 Test(ImageOverlay+TileLayer): crossOrigin option add 5th test case (#6027)
when passing `crossOrigin: ''` (empty string) option, the `crossorigin` attribute should also be set an empty string value (valid keyword, with same effect as `"anonymous"` value). Need to add this test, because in JavaScript the empty string is a falsy value that could have been caught as `false` and led to no `crossorigin` attribute set.
2018-01-25 13:46:34 +01:00
Andrew
ad8fc9c36b Fix(GridLayer): Do not fire 'tileload' event if tile src is empty image (#6025)
* do not fire 'load' event if tile src is the empty image (i.e. L.Util.emptyImageUrl)

* add TileLayer setUrl test
2018-01-25 11:08:05 +04:00
ghybs
2dc70945f8 Test(ImageOverlay+TileLayer): crossOrigin option to IMG crossorigin attribute (#6022)
* Test(ImageOverlay): crossOrigin option to IMG crossorigin attribute

typical values: false (default), true => '', <string> => <string>
now that a string value can be passed to this option.

* Test(TileLayer): crossOrigin option to IMG crossorigin attribute

typical values: false (default), true => '', <string> => <string>
now that a string value can be passed to this option.

* Style(TileLayerSpec): remove commented code

* Style(TileLayerSpec): remove more commented code
2018-01-24 15:24:02 +01:00
Mjumbe Poe
34251900ae Respect the preferCanvas option in all panes (#6019)
When creating a renderer for a pane other than overlayPane, use the same logic as default to determine whether to create a canvas or svg renderer.
2018-01-23 19:52:10 +01:00
caleb logan
b2cb8f79e8 Feat(TileLayer+ImageOverlay): add 'use-credentials' CORS Option (#6016)
* Added support for crossorigin using a String besides a Boolean (typically set `crossOrigin: 'use-credentials' / 'anonymous' / '' / true / false (default))

* Changed boolean to result in empty string and updated docs
2018-01-23 16:50:08 +04:00
ghybs
80ee940e14 Docs(tutorials): map panes use more explicit tiles (#6018)
so that it is more obvious what the difference is between the base map, the labels, and when both are stacked.
The chosen tile is similar to the initial view of the result example below (example.html), and contains many labels.
2018-01-19 10:40:45 +01:00
Andrew
bb08848734
Merge pull request #6017 from Leaflet/pluginRotatedMarker
Docs(plugins): add Rotated Marker plugin
2018-01-19 09:05:59 +01:00
Jeffrey Warren
fb7af21d55 Docs(plugins): add leaflet-blurred-location plugin (#6015)
to "Map interaction > User interface" section.
2018-01-19 09:01:20 +04:00
ghybs
d74e3340a1
Docs(plugins): add Rotated Marker plugin
by Benjamin Becquet, who already submitted a few plugins on this list and mentioned this one in https://github.com/Leaflet/Leaflet/issues/143
Added into "Overlay Display > Markers & renderers" section.
2018-01-19 08:43:31 +04:00
ghybs
86099a8502
Test(TileLayer): check zoomOffset option is used (#6011)
following issue #6004 (fixed by PR #6006).
Added 2 dedicated tests.
Unfortunately I could not add a test for detectRetina option that easily, because since the move to Rollup, Browser values became internal variables, and overriding them later on does not have any effect on Leaflet internal references… Not sure how to workaround this for the sake of testing.
2018-01-19 06:12:11 +04:00
Andrew
ae8a1a645a
Release 1.3.1 (#6010)
* update changelog

* add blog post

* update reference

* update download page

* update version in config.yml

* update announcement

* point reference.html to 1.3.1 docs

Also add reference-1.3.1.html, which redirects to 1.3.0 docs

* update integrity hashes

* redirect reference.html directly to 1.3.0 to avoid double redirect
2018-01-18 13:56:04 +01:00
Thomas
756dd14d3b Docs(plugins): add a plugin that displays path and direction of marker (#6008)
* add a plugin

* Correct the demo address of the plugin

* Correct the demo address of the plugin

(The link does not work (404 error). Most probably the trailing slash (/) should be removed.)

* Update plugins.md

remove the mistake (<te) at line 1045

* correct plugin name

change marker-drection to marker-direction( miss i in word 'drection')

* Update plugins.md
2018-01-18 16:37:49 +04:00
161 changed files with 1216 additions and 6365 deletions

3
.gitignore vendored
View File

@ -17,3 +17,6 @@ bower.json
component.json
debug/local/
Gemfile.lock
package-lock.json
yarn.lock
*.log

View File

@ -8,6 +8,7 @@ addons:
- dist
target_paths:
- content/leaflet/${NAME}
firefox: latest
env:
global:
- ARTIFACTS_BUCKET=leafletjs-cdn
@ -20,6 +21,9 @@ env:
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 ..

View File

@ -3,6 +3,13 @@ Leaflet Changelog
(all changes without author notice are by [@mourner](https://github.com/mourner))
## 1.3.1 (2018-01-18)
### Bug fixes
* Fix `L.TileLayer`regression, which caused incorrect tile URLs ([#6006](https://github.com/Leaflet/Leaflet/issues/6006) by [ghybs](https://github.com/ghybs))
## 1.3.0 (2018-01-15)
### API changes

View File

@ -36,7 +36,7 @@ here are some tips for creating a helpful report that will make fixing it much e
* Write a **descriptive, specific title**. Bad: *Problem with polylines*. Good: *Doing X in IE9 causes Z*.
* Include **browser, OS and Leaflet version** info in the description.
* Create a **simple test case** that demonstrates the bug (e.g. using [Leaflet playground](http://playground-leaflet.rhcloud.com/)).
* Create a **simple test case** that demonstrates the bug (e.g. using [Leaflet plunker](http://leafletjs.com/edit.html)).
* Check whether the bug can be reproduced in **other browsers**.
* Check if the bug occurs in the stable version, master, or both.
* *Bonus tip:* if the bug only appears in the master version but the stable version is fine,
@ -68,8 +68,9 @@ please consider submitting another pull request with the corresponding [document
### Setting up the Build System
The Leaflet build system uses [Node](http://nodejs.org/), and the [Jake](http://jakejs.com/) Javascript build tool.
To set up the Leaflet build system, install Node then run the following commands in the project root to install dependencies:
The Leaflet build system uses [NodeJS](http://nodejs.org/).
To set up the Leaflet build system, install [NodeJS](https://nodejs.org/).
Then run the following commands in the project root to install dependencies:
```
npm install
@ -125,13 +126,13 @@ install [PhantomJS](http://phantomjs.org/) (and make sure it's in your `PATH`),
then run:
```
npm run test
npm test
```
To run all the tests in actual browsers at the same time, you can do:
```
npm run test -- --ff --chrome --safari --ie
npm test -- --browsers Firefox,Chrome,Safari,IE
```
To run the tests in a browser manually, open `spec/index.html`.
@ -141,7 +142,7 @@ To run the tests in a browser manually, open `spec/index.html`.
To generate a detailed report about test coverage (which helps tremendously when working on test improvements), run:
```
npm run test -- --cov
npm test -- --cov
```
After that, open `coverage/<environment>/index.html` in a browser to see the report.

View File

@ -1,107 +0,0 @@
/*
Leaflet building, testing and linting scripts.
To use, install Node, then run the following commands in the project root:
npm install -g jake
npm install
To check the code for errors and build Leaflet from source, run "jake".
To run the tests, run "jake test". To build the documentation, run "jake docs".
For a custom build, open build/build.html in the browser and follow the instructions.
*/
var buildDocs = require('./build/docs'),
git = require('git-rev-sync'),
path = require('path');
function hint(msg, args) {
return function () {
console.log(msg);
jake.exec('node node_modules/eslint/bin/eslint.js ' + args,
{printStdout: true}, function () {
console.log('\tCheck passed.\n');
complete();
});
};
}
// Returns the version string in package.json, plus a semver build metadata if
// this is not an official release
function calculateVersion(officialRelease) {
var version = require('./package.json').version;
if (officialRelease) {
return version;
} else {
return version + '+' + git.short();
}
}
desc('Check Leaflet source for errors with ESLint');
task('lint', {async: true}, hint('Checking for JS errors...', 'src'));
desc('Check Leaflet specs source for errors with ESLint');
task('lintspec', {async: true}, hint('Checking for specs JS errors...', 'spec/suites'));
desc('Run PhantomJS tests');
task('test', ['lint', 'lintspec'], {async: true}, function () {
var karma = require('karma'),
testConfig = {configFile : path.join(__dirname, './spec/karma.conf.js')};
testConfig.browsers = ['PhantomJSCustom'];
function isArgv(optName) {
return process.argv.indexOf(optName) !== -1;
}
if (isArgv('--chrome')) {
testConfig.browsers.push('Chrome');
}
if (isArgv('--safari')) {
testConfig.browsers.push('Safari');
}
if (isArgv('--ff')) {
testConfig.browsers.push('Firefox');
}
if (isArgv('--ie')) {
testConfig.browsers.push('IE');
}
if (isArgv('--cov')) {
testConfig.preprocessors = {
'src/**/*.js': 'coverage'
};
testConfig.coverageReporter = {
type : 'html',
dir : 'coverage/'
};
testConfig.reporters = ['coverage'];
}
console.log('Running tests...');
var server = new karma.Server(testConfig, function(exitCode) {
if (!exitCode) {
console.log('\tTests ran successfully.\n');
complete();
} else {
process.exit(exitCode);
}
});
server.start();
});
desc('Build documentation');
task('docs', {}, function() {
buildDocs();
});
task('default', ['test', 'build']);
jake.addListener('complete', function () {
process.exit();
});

View File

@ -1,4 +1,4 @@
Copyright (c) 2010-2017, Vladimir Agafonkin
Copyright (c) 2010-2018, Vladimir Agafonkin
Copyright (c) 2010-2011, CloudMade
All rights reserved.

7
build/docs.js Normal file → Executable file
View File

@ -1,4 +1,3 @@
var packageDef = require('../package.json');
function buildDocs() {
@ -34,4 +33,8 @@ function buildDocs() {
fs.writeFileSync('dist/reference-' + packageDef.version + '.html', out);
}
module.exports = buildDocs;
if (require.main === module) {
buildDocs();
} else {
module.exports = buildDocs;
}

View File

@ -1,4 +1,3 @@
// This script calculates the integrity hashes of the files in dist/ , and
// **overwrites** the values in the documentation.

View File

@ -142,7 +142,7 @@
<div class="footer">
<p>© 2017 <a href="http://agafonkin.com/en">Vladimir Agafonkin</a>. Maps © <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors.</p>
<p>© 2017 <a href="http://agafonkin.com/en">Vladimir Agafonkin</a>. Maps © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors.</p>
</div>
</div>

View File

@ -3,8 +3,9 @@
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 = require('../package.json').version;
let {version} = pkg;
let release;
// Skip the git branch+rev in the banner when doing a release build
@ -19,19 +20,37 @@ if (process.env.NODE_ENV === 'release') {
const banner = `/* @preserve
* Leaflet ${version}, a JS library for interactive maps. http://leafletjs.com
* (c) 2010-2017 Vladimir Agafonkin, (c) 2010-2011 CloudMade
* (c) 2010-2018 Vladimir Agafonkin, (c) 2010-2011 CloudMade
*/
`;
const outro = `var oldL = window.L;
exports.noConflict = function() {
window.L = oldL;
return this;
}
// Always export us to window global (see #2364)
window.L = exports;`;
export default {
input: 'src/Leaflet.js',
output: {
file: 'dist/leaflet-src.js',
output: [
{
file: pkg.main,
format: 'umd',
name: 'L',
banner: banner,
outro: outro,
sourcemap: true
},
{
file: pkg.module,
format: 'es',
banner: banner,
sourcemap: true
}
],
legacy: true, // Needed to create files loadable by IE8
plugins: [
release ? json() : rollupGitVersion()

View File

@ -9,7 +9,7 @@ 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-2016 Vladimir Agafonkin, (c) 2010-2011 CloudMade
* (c) 2010-2018 Vladimir Agafonkin, (c) 2010-2011 CloudMade
*/
`;

View File

@ -24,8 +24,8 @@
</div>
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
//Disable the hack fix

View File

@ -26,13 +26,13 @@
var map = L.map('map').setView([50.5, 0], 5);
var OSM_Mapnik = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
var OSM_Mapnik = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map);
var OSM_BlackAndWhite = L.tileLayer('http://{s}.tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'
});
L.control.layers({

View File

@ -15,8 +15,8 @@
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}),
osm2 = new L.TileLayer(osmUrl, {attribution: 'Hello world'});

View File

@ -16,8 +16,8 @@
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
var map = new L.Map('map', {zoom: 15, layers: [osm]});

View File

@ -18,8 +18,8 @@
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
latlng = new L.LatLng(50.5, 30.51);

View File

@ -19,8 +19,8 @@
<script>
map = L.map('map', { center: [0, 0], zoom: 3, maxZoom: 4 });
var osm = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osm = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
}).addTo(map);
L.DomUtil.get('removeAdd').onclick = function() {

View File

@ -17,8 +17,8 @@
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}),
latlng = new L.LatLng(50.5, 30.51);

View File

@ -17,8 +17,8 @@
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
var map = L.map('map')

View File

@ -10,11 +10,21 @@
<link rel="stylesheet" href="../css/screen.css" />
<style>
html, body {
margin: 0;
padding: 0;
}
#wrapper {
transform: scale(.5, .25); /* scaleX0 = .5 ; scaleY0 = .25 */
transform-origin: 0 0;
padding: 40px 100px; /* displayed padding-top = scaleY0 * 40px = 10px ; displayed padding-left = scaleX0 * 100px = 50px */
}
#map {
width: 400px;
height: 300px;
transform: scale(1.5, 1.5);
transform: scale(3, 8); /* scaleX = .5 * 3 = 1.5 ; scaleY = .25 * 8 = 2 */
transform-origin: 0 0;
border-width: 30px 70px; /* displayed border-top-width = scaleY * 30px = 60px ; displayed border-left-width = scaleX * 70px = 105px */
}
</style>
@ -22,17 +32,34 @@
</head>
<body>
<div id="wrapper">
<div id="map"></div>
</div>
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
var map = L.map('map')
.setView([50.5, 30.51], 15)
.addLayer(osm);
var mapContainer = map.getContainer();
var marker = L.marker([50.5, 30.51], {
draggable: true
}).addTo(map);
map.on('drag', function (event) {
console.log('map:');
console.log(L.DomEvent.getMousePosition(event.originalEvent, mapContainer));
});
marker.on('drag', function (event) {
console.log('marker:');
console.log(L.DomEvent.getMousePosition(event.originalEvent, mapContainer));
});
</script>
</body>
</html>

View File

@ -18,8 +18,8 @@
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
var map = L.map('map')

View File

@ -55,8 +55,8 @@
console.log('poly click');
});
var osm = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osm = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
}).addTo(map);
</script>
</body>

View File

@ -54,8 +54,8 @@
console.log('poly click');
});
var osm = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osm = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
}).addTo(map);
</script>
</body>

View File

@ -20,8 +20,8 @@
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm1 = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}),
osm2 = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}),
bounds = new L.LatLngBounds(new L.LatLng(49.5, -11.3), new L.LatLng(61.2, 2.5));

View File

@ -17,8 +17,8 @@
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}),
bounds = new L.LatLngBounds(new L.LatLng(49.5, Number.NEGATIVE_INFINITY), new L.LatLng(61.2, Number.POSITIVE_INFINITY));

View File

@ -17,8 +17,8 @@
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}),
bounds = new L.LatLngBounds(new L.LatLng(49.5, -11.3), new L.LatLng(61.2, 2.5));

View File

@ -81,8 +81,8 @@
CASE 1: no opacity set on any layers
**********/
// OSM Basemap
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors';
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors';
var osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: ''}).addTo(map1);

View File

@ -17,8 +17,8 @@
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
var map = L.map('map')

View File

@ -22,8 +22,8 @@
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
var map = L.map('map')

View File

@ -21,8 +21,8 @@
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}),
latlng = new L.LatLng(50.5, 30.51);

View File

@ -29,8 +29,8 @@
var map = L.map('map').setView(center, 13);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
L.polygon([[41.21, 9.42], [41.22, 9.40], [41.23, 9.40]]).addTo(map).bindTooltip('Default centered polygon tooltip');

View File

@ -16,8 +16,8 @@
<script>
var map = new L.Map('map');
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {attribution: osmAttrib}),
osm2 = L.tileLayer(osmUrl, {attribution: osmAttrib});

View File

@ -59,8 +59,8 @@
var sf = [37.77, -122.42],
trd = [63.41, 10.41];
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm1 = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}),
osm2 = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}),
center = L.latLng(63.41, 10.41);

View File

@ -18,8 +18,8 @@
// Check the 'center' setting of the scroll-wheel, double-click and touch-zoom
// handlers
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {minZoom: 14, attribution: osmAttrib}),
latlng = new L.LatLng(51.1788409,-1.82618);

View File

@ -19,9 +19,9 @@
var map = L.map('map').setView(L.latLng(50.5, 30.51), 0);
var osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {attribution: osmAttrib, minZoom: 0, maxZoom: 10}).addTo(map),
osm2 = L.tileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {attribution: 'Hello world', minZoom: 5, maxZoom: 18});
var osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {attribution: osmAttrib, minZoom: 0, maxZoom: 10}).addTo(map),
osm2 = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {attribution: 'Hello world', minZoom: 5, maxZoom: 18});
L.control.layers({
'OSM (5-18)': osm2,

View File

@ -58,7 +58,7 @@
}).setView(dc, 14);
var positron = L.tileLayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="http://cartodb.com/attributions">CartoDB</a>'
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="http://cartodb.com/attributions">CartoDB</a>'
}).addTo(map);
var path = new L.Polyline([kyiv, trd, lnd, mad, dc, sf]).addTo(map);

View File

@ -25,7 +25,7 @@
map = new L.Map('map', {preferCanvas: true});
// create the tile layer with correct attribution
var osmUrl = 'http://a.tile.openstreetmap.org/{z}/{x}/{y}.png';
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
var osmAttrib = 'Map data © OpenStreetMap contributors';
var osm = new L.TileLayer(osmUrl, { minZoom: 1, maxZoom: 17, attribution: osmAttrib, detectRetina: true });
map.addLayer(osm);

View File

@ -19,8 +19,8 @@
preferCanvas: true
}).locate();
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
var vanillaLayer = new L.LayerGroup();

View File

@ -15,8 +15,8 @@
<div id="map"></div>
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
var map = L.map('map', {

View File

@ -33,8 +33,8 @@
<script>
function makeMap(container, options) {
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
var map = L.map(container, options)

View File

@ -9,7 +9,7 @@
<script>
var map,
mapDiv,
osm = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png');
osm = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png');
var recreateMap = function(){

View File

@ -20,8 +20,8 @@
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
var map = L.map('map')

View File

@ -26,7 +26,7 @@
<script>
function addLayerAndMarker(map) {
var layer = new L.TileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
var layer = new L.TileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom : 18
}).addTo(map);

View File

@ -26,7 +26,7 @@
<script>
function addLayerAndMarkers(map) {
var layer = new L.TileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
var layer = new L.TileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom : 18
}).addTo(map);

View File

@ -24,8 +24,8 @@
profiler and examine times for _on, _off and fire.
*/
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
var map = L.map('map')

View File

@ -47,8 +47,8 @@
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}),
latlng = new L.LatLng(39.05, 8.40);

View File

@ -22,8 +22,8 @@
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}),
latlng = new L.LatLng(50.5, 30.51);

View File

@ -17,8 +17,8 @@
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
var map = L.map('map')

View File

@ -22,8 +22,8 @@ var map = L.map('map').setView([36.9, -95.4], 5);
map.on('contextmenu', function (e) {
alert('The map has been right-clicked');
});
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
}).addTo(map);

View File

@ -24,8 +24,8 @@
map.setView([51.505, -0.09], 13);
var osm = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osm = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
}).addTo(map);
var a_popup = L.popup().setContent('Previously created')

View File

@ -23,8 +23,8 @@
<script>
var osm = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osm = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
});
var map = L.map('map')

View File

@ -16,7 +16,7 @@
<div id="map"></div>
<script>
var map = L.map('map').setView([51.505, -0.09], 13);
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map);
map.on('click', function(e) {
L.popup().setLatLng(e.latlng).setContent('Hello').openOn(map);
});

View File

@ -27,7 +27,7 @@
map = new L.Map('map');
// create the tile layer with correct attribution
var osmUrl = 'http://a.tile.openstreetmap.org/{z}/{x}/{y}.png';
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
var osm = new L.TileLayer(osmUrl, { minZoom: 1, maxZoom: 17 });
map.addLayer(osm);
map.fitBounds(new L.LatLngBounds([51,7],[51,7]));

View File

@ -96,7 +96,7 @@
var map = L.map('map', mapopts);
var positron = L.tileLayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="http://cartodb.com/attributions">CartoDB</a>'
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="http://cartodb.com/attributions">CartoDB</a>'
})
var grid = L.gridLayer({

View File

@ -55,7 +55,7 @@
//In any map, set minZoom and/or maxZoom, plus bounceAtZoomLimits to false.
var positron = L.tileLayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="http://cartodb.com/attributions">CartoDB</a>'
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="http://cartodb.com/attributions">CartoDB</a>'
}).addTo(map);
var marker = L.marker(myCenter);

View File

@ -15,7 +15,7 @@
<button onclick="boundsExtendLatLng()">Extend the bounds of the center rectangle with the lower left marker</button>
<script src="route.js"></script>
<script>
var osmUrl = 'http://{s}.tile.osm.org/{z}/{x}/{y}.png',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osm = new L.TileLayer(osmUrl, {maxZoom: 18});
var latLng = new L.LatLng(54.18815548107151, -7.657470703124999);

View File

@ -18,8 +18,8 @@
<script src="geojson-sample.js"></script>
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}),
rectangle,
featureGroup;

View File

@ -51,8 +51,8 @@
var map = L.map('map').setView([37.8, -96], 4);
var osm = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osm = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
}).addTo(map);

View File

@ -18,7 +18,7 @@
zoom: 3,
preferCanvas: true
});
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
minZoom: 1,
maxZoom: 17,
label: 'open street map'

View File

@ -18,7 +18,7 @@
<script>
var osmUrl = 'http://api.tiles.mapbox.com/v4/mapbox.light/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
var map = L.map('map', {preferCanvas: true})

View File

@ -16,8 +16,8 @@
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
var bounds = new L.LatLngBounds(new L.LatLng(54.559322, -5.767822), new L.LatLng(56.1210604, -3.021240));

File diff suppressed because one or more lines are too long

View File

@ -23,7 +23,7 @@
// buffer += text + "\r\n";
//}
var osmUrl = 'http://{s}.tile.osm.org/{z}/{x}/{y}.png',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osm = new L.TileLayer(osmUrl, {maxZoom: 18}),
map = new L.Map('map', {layers: [osm], center: new L.LatLng(51.505, -0.04), zoom: 13});

View File

@ -15,8 +15,8 @@
<button onclick="map.fitBounds(poly.getBounds())">Zoom to polygon</button>
<script src="route.js"></script>
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
var poly_points = [

View File

@ -18,8 +18,8 @@
<script src="route.js"></script>
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
for (var i = 0, latlngs = [], len = route.length; i < len; i++) {

View File

@ -16,8 +16,8 @@
<script src="route.js"></script>
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
for (var i = 0, latlngs = [], len = route.length; i < len; i++) {

View File

@ -34,8 +34,8 @@
.bindPopup("I am a polygon.")
.addTo(map);
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}).addTo(map);
</script>

View File

@ -13,8 +13,8 @@
<script src="route.js"></script>
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
for (var i = 0, latlngs = [], len = route.length; i < len; i++) {

View File

@ -13,8 +13,8 @@
<script src="route.js"></script>
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
var svg = L.svg();

View File

@ -1,15 +1,15 @@
exclude: [build, debug, node_modules, spec, src, CNAME, Jakefile.js, reference-tpl.html, CHANGELOG.md, README.md, LICENSE, DOCS-TODO.md]
exclude: [build, debug, node_modules, spec, src, CNAME, reference-tpl.html, CHANGELOG.md, README.md, LICENSE, DOCS-TODO.md]
markdown: kramdown
kramdown:
entity_output: as_input
latest_leaflet_version: 1.3.0
latest_leaflet_version: 1.3.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-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ=="
integrity_hash_source: "sha512-2h9aokfcaYW7k0VPn1JqbQDQCaNQRrZJwetlnQ88yJrtIzGLVW/2StdQKoE+TIVNNTUxf6SVa+2vW2KB2EXnnA=="
integrity_hash_uglified: "sha512-C7BBF9irt5R7hqbUm2uxtODlUVs+IsNu2UULGuZN7gM+k/mmeG4xvIEac01BtQa4YIkUpp23zZC4wIwuXaPMQA=="
integrity_hash_source: "sha512-IkGU/uDhB9u9F8k+2OsA6XXoowIhOuQL1NTgNZHY1nkURnqEGlDZq3GsfmdJdKFe1k1zOc6YU2K7qY+hF9AodA=="
integrity_hash_uglified: "sha512-/Nsx9X4HebavoBvEBuyp3I7od5tA0UzAxs+j83KgC8PU0kgB4XiK4Lfe4y4cgBtaRJQEIFCW+oC506aPT2L1zw=="

View File

@ -21,10 +21,10 @@ bodyclass: post-page
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
<a href="https://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>

View File

@ -10,11 +10,11 @@
{% if title == '' %}
<meta property="og:title" content="Leaflet — an open-source JavaScript library for interactive maps" />
<meta property="og:description" content="Leaflet is a modern, lightweight open-source JavaScript library for mobile-friendly interactive maps." />
<meta property="og:image" content="http://leafletjs.com/docs/images/logo.png" />
<meta property="og:image" content="https://leafletjs.com/docs/images/logo.png" />
<meta itemprop="name" content="Leaflet">
<meta itemprop="description" content="Leaflet — a modern, lightweight open-source JavaScript library for mobile-friendly interactive maps.">
<meta itemprop="image" content="http://leafletjs.com/docs/images/logo.png">
<meta itemprop="image" content="https://leafletjs.com/docs/images/logo.png">
{% endif %}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@ -23,12 +23,12 @@
<link rel="shortcut icon" type="image/x-icon" href="{{ root }}docs/images/favicon.ico" />
<link href="http://leafletjs.com/atom.xml" type="application/atom+xml" rel="alternate" title="Leaflet Dev Blog Atom Feed" />
<link href="https://leafletjs.com/atom.xml" type="application/atom+xml" rel="alternate" title="Leaflet Dev Blog Atom Feed" />
<link rel="stylesheet" href="{{ root }}docs/css/normalize.css" />
<link rel="stylesheet" href="{{ root }}docs/css/main.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700,300' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700,300' rel='stylesheet' type='text/css'>
<script src="{{ root }}docs/highlight/highlight.pack.js"></script>
<link rel="stylesheet" href="{{ root }}docs/highlight/styles/github-gist.css" />
@ -41,17 +41,17 @@
<script>
ACCESS_TOKEN = 'pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw';
MB_ATTR = 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>';
MB_ATTR = 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, ' +
'<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="https://www.mapbox.com/">Mapbox</a>';
MB_URL = 'https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=' + ACCESS_TOKEN;
OSM_URL = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
OSM_ATTRIB = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors';
OSM_URL = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
OSM_ATTRIB = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors';
</script>
</head>
<body{% if page.bodyclass %} class="{{ page.bodyclass }}"{% endif %}>
<h1><a href="http://leafletjs.com"><img src="{{ root }}docs/images/logo.png" alt="Leaflet" width="300" /></a></h1>
<h1><a href="https://leafletjs.com/"><img src="{{ root }}docs/images/logo.png" alt="Leaflet" width="300" /></a></h1>
<h3 class="tagline">an open-source JavaScript library<br> for mobile-friendly interactive maps</h3>
<ul class="nav">
@ -105,13 +105,13 @@
{{ content }}
<div class="footer">
<p>&copy; 2017 <a href="http://agafonkin.com/en">Vladimir Agafonkin</a>. Maps &copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors.</p>
<p>&copy; 2017 <a href="http://agafonkin.com/en">Vladimir Agafonkin</a>. Maps &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors.</p>
</div>
</div>
<nav class="ext-links">
<a class="ext-link twitter" href="http://twitter.com/LeafletJS" title="Follow LeafletJS on Twitter"><img alt="Follow LeafletJS on Twitter" src="{{root}}docs/images/twitter-round.png" width="46" /></a>
<a class="ext-link twitter" href="https://twitter.com/LeafletJS" title="Follow LeafletJS on Twitter"><img alt="Follow LeafletJS on Twitter" src="{{root}}docs/images/twitter-round.png" width="46" /></a>
<a class="ext-link github" href="http://github.com/Leaflet/Leaflet" title="View Source on GitHub"><img alt="View Source on GitHub" src="{{root}}docs/images/github-round.png" width="46" /></a>
<a class="ext-link forum" href="https://stackoverflow.com/questions/tagged/leaflet" title="Ask for help on Stack Overflow"><img alt="Leaflet questions on Stack Overflow" src="{{root}}docs/images/forum-round.png" width="46" /></a>
</nav>

View File

@ -84,11 +84,11 @@ If you have any issues also please log a bug on <a href="https://github.com/leaf
Enjoy!<br />
Dave Leaver.
<link rel="stylesheet" href="http://leaflet.github.io/Leaflet.markercluster/dist/MarkerCluster.css" />
<link rel="stylesheet" href="http://leaflet.github.io/Leaflet.markercluster/dist/MarkerCluster.Default.css" />
<!--[if lte IE 8]><link rel="stylesheet" href="http://leaflet.github.io/Leaflet.markercluster/dist/MarkerCluster.Default.ie.css" /><![endif]-->
<script src="http://leaflet.github.io/Leaflet.markercluster/dist/leaflet.markercluster-src.js"></script>
<script src="http://leaflet.github.io/Leaflet.markercluster/example/realworld.388.js"></script>
<link rel="stylesheet" href="https://leaflet.github.io/Leaflet.markercluster/dist/MarkerCluster.css" />
<link rel="stylesheet" href="https://leaflet.github.io/Leaflet.markercluster/dist/MarkerCluster.Default.css" />
<!--[if lte IE 8]><link rel="stylesheet" href="https://leaflet.github.io/Leaflet.markercluster/dist/MarkerCluster.Default.ie.css" /><![endif]-->
<script src="https://leaflet.github.io/Leaflet.markercluster/dist/leaflet.markercluster-src.js"></script>
<script src="https://leaflet.github.io/Leaflet.markercluster/example/realworld.388.js"></script>
<script>
var mapbox = new L.TileLayer(MB_URL, {maxZoom: 18, attribution: MB_ATTR, id: 'examples.map-i875mjb7'}),

View File

@ -41,8 +41,8 @@ Leaflet.draw is very simple to drop into you Leaflet application. The following
var map = L.map('map').setView([175.30867, -37.77914], 13);
// add an OpenStreetMap tile layer
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
// Initialize the FeatureGroup to store editable layers
@ -96,14 +96,14 @@ I've had a great time implementing this plugin. I hope you enjoy using it. If yo
Cheers,
Jacob Toye
<link rel="stylesheet" href="http://leaflet.github.com/Leaflet.draw/lib/leaflet/leaflet.css" />
<link rel="stylesheet" href="http://leaflet.github.com/Leaflet.draw/leaflet.draw.css" />
<link rel="stylesheet" href="https://leaflet.github.io/Leaflet.draw/lib/leaflet/leaflet.css" />
<link rel="stylesheet" href="https://leaflet.github.io/Leaflet.draw/leaflet.draw.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://leaflet.github.com/Leaflet.draw/lib/leaflet/leaflet.ie.css" />
<link rel="stylesheet" href="http://leaflet.github.com/Leaflet.draw/leaflet.draw.ie.css" />
<link rel="stylesheet" href="https://leaflet.github.io/Leaflet.draw/lib/leaflet/leaflet.ie.css" />
<link rel="stylesheet" href="https://leaflet.github.io/Leaflet.draw/leaflet.draw.ie.css" />
<![endif]-->
<script src="http://leaflet.github.com/Leaflet.draw/libs/leaflet/leaflet.js"></script>
<script src="http://leaflet.github.com/Leaflet.draw/leaflet.draw.js"></script>
<script src="https://leaflet.github.io/Leaflet.draw/libs/leaflet/leaflet.js"></script>
<script src="https://leaflet.github.io/Leaflet.draw/leaflet.draw.js"></script>
<style>
.leaflet-bar {
@ -116,8 +116,8 @@ Jacob Toye
var map = L.map('map').setView([-37.77914, 175.30867], 16);
// add an OpenStreetMap tile layer
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
// Initialize the FeatureGroup to store editable layers

View File

@ -7,7 +7,7 @@ authorsite: http://agafonkin.com/en
---
One of the greatest things about Leaflet is its powerful plugin ecosystem.
The [Leaflet plugins page](http://leafletjs.com/plugins.html) lists dozens of awesome plugins, and more are being added every week.
The [Leaflet plugins page](https://leafletjs.com/plugins.html) lists dozens of awesome plugins, and more are being added every week.
This guide lists a number of best practices for publishing a Leaflet plugin that meets the quality standards of Leaflet itself. Also available [in the repo](https://github.com/Leaflet/Leaflet/blob/master/PLUGIN-GUIDE.md).

View File

@ -10,7 +10,7 @@ I know this blog hasn't been updated for a long time &mdash; 1.5 years actually!
We're on the finishing line of releasing Leaflet 1.0 &mdash; the biggest and greatest Leaflet release _ever_. The latest stable version, 0.7.3, is already perfect, so you won't believe how much awesome stuff we've managed to pack into the upcoming release &mdash; 914 commits later! But I'll leave that for a separate `1.0-beta1` blog post after we fix [that one last issue](https://github.com/Leaflet/Leaflet/pull/3307).
Meanwhile, I'm happy to present you the new redesigned [Leaflet website](http://leafletjs.com/)! Now finally mobile-friendly, simple, clean, minimal and modern, just like the library itself. Also notice the floating menu when scrolling down the [Docs](/reference.html) and [Plugins](/plugins.html) pages, a highly requested feature that'll make navigation much easier. Big thanks to [Rowan Hogan](https://github.com/rowanhogan) for the help with the new design!
Meanwhile, I'm happy to present you the new redesigned [Leaflet website](https://leafletjs.com/)! Now finally mobile-friendly, simple, clean, minimal and modern, just like the library itself. Also notice the floating menu when scrolling down the [Docs](/reference.html) and [Plugins](/plugins.html) pages, a highly requested feature that'll make navigation much easier. Big thanks to [Rowan Hogan](https://github.com/rowanhogan) for the help with the new design!
P.S. I recently made a quirky 13-minute video for the [Geospatial World Forum](http://www.geospatialworldforum.org/), sharing the fun story behind Leaflet and how it became what it is today. Watch it and share it with your geofriends so that we can make the GIS world fun again!

View File

@ -54,7 +54,7 @@ I'm incredibly thankful to everyone who made this release possible &mdash; by us
Special thanks to [Iván Sánchez](https://github.com/IvanSanchez), [Yohan Boniface](https://github.com/yohanboniface), [John Firebaugh](https://github.com/jfirebaugh), [Dave Leaver](https://github.com/danzel), [Patrick Arlt](https://github.com/patrickarlt), [Per Liedman](https://github.com/perliedman), [Jake Wilson](https://github.com/Jakobud) and [Steve Kashishian](https://github.com/snkashis) for lots of amazing contributions and support throughout the last year. All these people are now a part of the core Leaflet team. Keep'em coming!
![](http://www.reactiongifs.com/r/msy.gif)
![](https://www.reactiongifs.com/r/msy.gif)
Love,<br />
Vladimir.

View File

@ -29,7 +29,7 @@ Help us help you by taking a minute to learn [how to write a good bug report](ht
Last but not least, huge thanks to everybody using Leaflet. Keep creating great maps!
**Note to plugin developers**: we encourage you to upgrade your plugins to be compatible with the latest beta release. The 1.0 API is pretty stable at this point and many users are starting to use the beta version in production. Additionally, as 1.0 final release approaches, we want to get more serious about the quality of plugins that get [on the official list](http://leafletjs.com/plugins.html), making sure they're maintained and compatible with recent Leaflet releases.
**Note to plugin developers**: we encourage you to upgrade your plugins to be compatible with the latest beta release. The 1.0 API is pretty stable at this point and many users are starting to use the beta version in production. Additionally, as 1.0 final release approaches, we want to get more serious about the quality of plugins that get [on the official list](https://leafletjs.com/plugins.html), making sure they're maintained and compatible with recent Leaflet releases.
Best,
Iván & Vladimir & Yohan.

View File

@ -75,7 +75,7 @@ f2.wait(100).moveTo(350, 200, 0)
.down().wait(500).moveBy(-200, 0, 1000).wait(500).up().wait(500);
</code></pre>
You can check this in the [live prosthetic-hand demos](http://leaflet.github.io/prosthetic-hand/demos/).
You can check this in the [live prosthetic-hand demos](https://leaflet.github.io/prosthetic-hand/demos/).
The prosthetic-hand library is not perfect, and some types of events only work in some browsers, but it can help trigger mouse/touch/pointer events in a repeatable way, with adjustable timing, allowing developers to keep both hands at the debugger. The timing modes allow granular control of the events fired, allowing to run less iterations of the code for the same gesture, which in turn means a simpler, better understanding of what's going on.

View File

@ -19,7 +19,7 @@ Leaflet 1.0-rc1 closes down on edge cases and API inconsistencies that were pres
* The first ever Microsoft Edge hack (handle inconsistent `dblclick` behaviour on Win10 touchscreens)
* Unit tests with `prosthetic-hand`, letting us be sure that touch interactions behave consistently. This has its [own blog post](http://leafletjs.com/2016/03/20/debugging-touch-interactions.html).
* Unit tests with `prosthetic-hand`, letting us be sure that touch interactions behave consistently. This has its [own blog post](https://leafletjs.com/2016/03/20/debugging-touch-interactions.html).
### Changes in the API documentation

View File

@ -47,4 +47,4 @@ And of course, let's celebrate!
Love,<br>
The Leaflet team.
![](http://www.reactiongifs.com/wp-content/uploads/2013/06/umad.gif)
![](https://www.reactiongifs.com/wp-content/uploads/2013/06/umad.gif)

View File

@ -10,7 +10,7 @@ As part of our "we really promised a faster release cycle" vision, we are publis
Compared to 1.0.1, this release fixes about a dozen bugs, and a couple new options. The full list of changes can be found on [the changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md).
As usual, check the [downloads page](http://leafletjs.com/download.html) to get this release.
As usual, check the [downloads page](https://leafletjs.com/download.html) to get this release.
### Next plans?

View File

@ -20,7 +20,7 @@ backported a few fixes for Internet Explorer 8, and some miscellaneous fixes.
The full list of changes can be found on [the changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md).
As usual, check the [downloads page](http://leafletjs.com/download.html) to get this release.
As usual, check the [downloads page](https://leafletjs.com/download.html) to get this release.
Cheers,<br>

View File

@ -8,11 +8,11 @@ authorsite: http://www.liedman.net
We have released Leaflet version 1.1.0, the first version built with [ES6 modules](https://babeljs.io/learn-es2015/#ecmascript-2015-features-modules) - a big step forward ensuring Leaflet is up to date with how modern JavaScript is written. For users upgrading to this release, this change should not make a difference, while it offers the possibility to import individual parts of Leaflet individually if your app is built with ES6. As a consequence, 1.1.0 is also the first version built without Leaflet's now deprecated custom build system, in favor of using [Rollup](https://rollupjs.org/).
Also new in this release is the new `L.VideoOverlay` class, allowing [overlaying video on your maps](http://leafletjs.com/examples/video-overlay/).
Also new in this release is the new `L.VideoOverlay` class, allowing [overlaying video on your maps](https://leafletjs.com/examples/video-overlay/).
We also managed to fix over 30 bugs with the help of about 20 different contributors: see the full [changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md) for details.
To get the new release, update your dependencies in your favorite package manager, or check the [downloads page](http://leafletjs.com/download.html).
To get the new release, update your dependencies in your favorite package manager, or check the [downloads page](https://leafletjs.com/download.html).
Cheers,<br>
The Leaflet team.

View File

@ -12,7 +12,7 @@ For the future, we expect to work out a new recommendation for authoring Leaflet
As usual, we also managed to close off a number of other bugs and make a couple of minor improvements, all with the help of our many contributors - a big thank you to all who contributed to the release this summer! See the full [changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md) for details.
To get the new release, update your dependencies in your favorite package manager, or check the [downloads page](http://leafletjs.com/download.html).
To get the new release, update your dependencies in your favorite package manager, or check the [downloads page](https://leafletjs.com/download.html).
Cheers,<br>
The Leaflet team.

View File

@ -11,7 +11,7 @@ Long awaited Leaflet 1.3.0 has just been released!
This release contains a lot of bugfixes, improvements and a couple new options.
Big thanks to all contributors who made this release possible! See the full [changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md) for details.
To get the new release, update your dependencies in your favorite package manager, or check the [downloads page](http://leafletjs.com/download.html).
To get the new release, update your dependencies in your favorite package manager, or check the [downloads page](https://leafletjs.com/download.html).
Cheers,<br>
The Leaflet team.

View File

@ -0,0 +1,18 @@
---
layout: post
title: Announcing Leaflet 1.3.1
description: a new bugfix release
author: Andrew Cherniavskii
authorsite: https://github.com/cherniavskii
---
Leaflet 1.3.1 has just been released!
This release fixes `L.TileLayer` regression, introduced in 1.3.0. Oops!
See [changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md) for details.
To get the new release, update your dependencies in your favorite package manager, or check the [downloads page](https://leafletjs.com/download.html).
Cheers,<br>
The Leaflet team.

View File

@ -6,11 +6,11 @@ title: Leaflet Developer Blog Atom Feed
<title>Leaflet Dev Blog</title>
<link href="http://leafletjs.com/atom.xml" rel="self"/>
<link href="http://leafletjs.com"/>
<link href="https://leafletjs.com/atom.xml" rel="self"/>
<link href="https://leafletjs.com"/>
<updated>{{ site.time | date_to_xmlschema }}</updated>
<id>http://leafletjs.com/</id>
<id>https://leafletjs.com/</id>
<author>
<name>Vladimir Agafonkin</name>
@ -19,9 +19,9 @@ title: Leaflet Developer Blog Atom Feed
{% for post in site.posts %}
<entry>
<title>{{ post.title }}</title>
<link href="http://leafletjs.com{{ post.url }}"/>
<link href="https://leafletjs.com{{ post.url }}"/>
<updated>{{ post.date | date_to_xmlschema }}</updated>
<id>http://leafletjs.com{{ post.id }}</id>
<id>https://leafletjs.com{{ post.id }}</id>
<content type="html">{{ post.content | xml_escape }}</content>
</entry>
{% endfor %}

View File

@ -12,8 +12,8 @@ bodyclass: download-page
<th>Description</th>
</tr>
<tr>
<td><a href="http://cdn.leafletjs.com/leaflet/v1.3.0/leaflet.zip">Leaflet 1.3.0</a></td>
<td>Stable version, released on January 15, 2018.</td>
<td><a href="http://cdn.leafletjs.com/leaflet/v1.3.1/leaflet.zip">Leaflet 1.3.1</a></td>
<td>Stable version, released on January 18, 2018.</td>
</tr>
<tr>
<td><a href="https://leafletjs-cdn.s3.amazonaws.com/content/leaflet/master/leaflet.zip">Leaflet 1.3-dev</a></td>
@ -89,10 +89,10 @@ which installs easily and works well across all major platforms.
Here are the steps to set it up:
1. [Download and install Node](http://nodejs.org)
2. Run the following commands in the command line:
2. Run the following command in the command line:
<pre><code>npm install</code></pre>
Now that you have everything installed, from inside the Leaflet directory, run:
<pre><code>npm run build</code></pre>
Now that you have everything installed, run `npm run build` inside the Leaflet directory.
This will combine and compress the Leaflet source files, saving the build to the `dist` folder.

View File

@ -15,7 +15,7 @@
cssFile: 'https://unpkg.com/leaflet/dist/leaflet.css',
css: 'body {\n\tmargin: 0;\n}\nhtml, body, #leaflet {\n\theight: 100%\n}',
jsFile: 'https://unpkg.com/leaflet/dist/leaflet-src.js',
js: "var map = new L.Map('leaflet', {\n\tlayers: [\n\t\tnew L.TileLayer('//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {\n\t\t\t'attribution': 'Map data © <a href=\"http://openstreetmap.org\">OpenStreetMap</a> contributors'\n\t\t})\n\t],\n\tcenter: [0, 0],\n\tzoom: 0\n});"
js: "var map = new L.Map('leaflet', {\n\tlayers: [\n\t\tnew L.TileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {\n\t\t\t'attribution': 'Map data © <a href=\"http://openstreetmap.org\">OpenStreetMap</a> contributors'\n\t\t})\n\t],\n\tcenter: [0, 0],\n\tzoom: 0\n});"
};
var hash = location.hash.substr(1);

View File

@ -9,9 +9,9 @@ title: Choropleth Tutorial
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
maxZoom: 18,
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>',
attribution: 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, ' +
'<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
id: 'mapbox.light'
}).addTo(map);

View File

@ -10,9 +10,9 @@ title: Choropleth Tutorial
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
maxZoom: 18,
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>',
attribution: 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, ' +
'<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
id: 'mapbox.light'
}).addTo(map);

View File

@ -40,9 +40,9 @@ css: "#map {
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
maxZoom: 18,
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>',
attribution: 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, ' +
'<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
id: 'mapbox.light'
}).addTo(map);

View File

@ -5,8 +5,8 @@ title: Custom Icons Tutorial
<script>
var map = L.map('map').setView([51.5, -0.09], 13);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
var LeafIcon = L.Icon.extend({

View File

@ -5,8 +5,8 @@ title: Custom Icons Tutorial
<script>
var map = L.map('map').setView([51.5, -0.09], 13);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
var LeafIcon = L.Icon.extend({

View File

@ -20,10 +20,10 @@ Let's illustrate with a custom `L.TileLayer` that will display random kitten ima
L.TileLayer.Kitten = L.TileLayer.extend({
getTileUrl: function(coords) {
var i = Math.ceil( Math.random() * 4 );
return "http://placekitten.com/256/256?image=" + i;
return "https://placekitten.com/256/256?image=" + i;
},
getAttribution: function() {
return "<a href='http://placekitten.com/attribution.html'>PlaceKitten</a>"
return "<a href='https://placekitten.com/attribution.html'>PlaceKitten</a>"
}
});
@ -46,10 +46,10 @@ For the KittenLayer, you should create a file like `L.KittenLayer.js` with:
L.TileLayer.Kitten = L.TileLayer.extend({
getTileUrl: function(coords) {
var i = Math.ceil( Math.random() * 4 );
return "http://placekitten.com/256/256?image=" + i;
return "https://placekitten.com/256/256?image=" + i;
},
getAttribution: function() {
return "<a href='http://placekitten.com/attribution.html'>PlaceKitten</a>"
return "<a href='https://placekitten.com/attribution.html'>PlaceKitten</a>"
}
});

View File

@ -13,10 +13,10 @@ title: KittenLayer
L.TileLayer.Kitten = L.TileLayer.extend({
getTileUrl: function(coords) {
var i = Math.ceil( Math.random() * 4 );
return "http://placekitten.com/256/256?image=" + i;
return "https://placekitten.com/256/256?image=" + i;
},
getAttribution: function() {
return "<a href='http://placekitten.com/attribution.html'>PlaceKitten</a>"
return "<a href='https://placekitten.com/attribution.html'>PlaceKitten</a>"
}
});

View File

@ -9,9 +9,9 @@ title: GeoJSON tutorial
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
maxZoom: 18,
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>',
attribution: 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, ' +
'<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
id: 'mapbox.light'
}).addTo(map);

View File

@ -18,9 +18,9 @@
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
maxZoom: 18,
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>',
attribution: 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, ' +
'<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
id: 'mapbox.light'
}).addTo(map);

View File

@ -5,17 +5,17 @@ title: Using GeoJSON with Leaflet
<h3>Using GeoJSON with Leaflet</h3>
<p>GeoJSON is becoming a very popular data format among many GIS technologies and services — it's simple, lightweight, straightforward, and Leaflet is quite good at handling it. In this example, you'll learn how to create and interact with map vectors created from <a href="http://geojson.org/">GeoJSON</a> objects.</p>
<p>GeoJSON is becoming a very popular data format among many GIS technologies and services — it's simple, lightweight, straightforward, and Leaflet is quite good at handling it. In this example, you'll learn how to create and interact with map vectors created from <a href="https://tools.ietf.org/html/rfc7946">GeoJSON</a> objects.</p>
{% include frame.html url="example.html" %}
<h3>About GeoJSON</h3>
<p>According to <a href="http://geojson.org">http://geojson.org</a>:</p>
<p>According to <a href="https://tools.ietf.org/html/rfc7946">GeoJSON Specification (RFC 7946)</a>:</p>
<blockquote>GeoJSON is a format for encoding a variety of geographic data structures. A GeoJSON object may represent a geometry, a feature, or a collection of features. GeoJSON supports the following geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection. Features in GeoJSON contain a geometry object and additional properties, and a feature collection represents a list of features.</blockquote>
<blockquote>GeoJSON is a format for encoding a variety of geographic data structures […]. A GeoJSON object may represent a region of space (a Geometry), a spatially bounded entity (a Feature), or a list of Features (a FeatureCollection). GeoJSON supports the following geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection. Features in GeoJSON contain a Geometry object and additional properties, and a FeatureCollection contains a list of Features.</blockquote>
<p>Leaflet supports all of the GeoJSON types above, but <a href="http://geojson.org/geojson-spec.html#feature-objects">Features</a> and <a href="http://geojson.org/geojson-spec.html#feature-collection-objects">FeatureCollections</a> work best as they allow you to describe features with a set of properties. We can even use these properties to style our Leaflet vectors. Here's an example of a simple GeoJSON feature:</p>
<p>Leaflet supports all of the GeoJSON types above, but <a href="https://tools.ietf.org/html/rfc7946#section-3.2">Features</a> and <a href="https://tools.ietf.org/html/rfc7946#section-3.3">FeatureCollections</a> work best as they allow you to describe features with a set of properties. We can even use these properties to style our Leaflet vectors. Here's an example of a simple GeoJSON feature:</p>
<pre><code>var geojsonFeature = {
"type": "Feature",

Some files were not shown because too many files have changed in this diff Show More