` renderer, when layers are non-interactive and lines are dashed.
+
+* 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](https://leafletjs.com/2016/03/20/debugging-touch-interactions.html).
+
+
+### Changes in the API documentation
+
+The API documentation is now generated from docstrings, thanks to a new tool dubbed [🍂doc](https://github.com/Leaflet/Leafdoc) (or "leafdoc").
+
+Previously, the API documentation was edited manually. This involved a lot of copy-pasting and - over time - bits of code started not to match the documentation.
+
+Most complex software projects use some form of [docstrings](https://en.wikipedia.org/wiki/Docstring) and tools like [JavaDoc](https://en.wikipedia.org/wiki/Javadoc), [NaturalDocs](http://www.naturaldocs.org/) or [JSdoc](http://usejsdoc.org/) to convert the docstrings into webpages.
+
+But the documentation for Leaflet requires a few special bits - docstrings cover methods and properties, but they do not cover options nor events, and we wanted to maintain the current look and feel of the documentation. 🍂doc was then born to overcome these limitations.
+
+Leaflet uses class inheritance quite extensively, and the old documentation was sometimes not clear about it. Some users struggled to find the available methods for some of the classes, and inherited options were sometimes mentioned, sometimes not. 🍂doc fixes this by including the documentation of all inherited methods/options/events/properties, collapsed by default:
+
+
+
+The [build system](https://github.com/Leaflet/Leaflet/blob/master/CONTRIBUTING.md#setting-up-the-build-system) now builds a HTML file with the API docs alongside the minified `leaflet.js` file. Documentation will be updated on every release based on that file, and pull requests to the `gh-pages` branch to fix the documentation will be automatically rejected.
+
+### Get the release candidate
+
+As with previous releases, you can use our CDN:
+
+
+
+
+A non-minified version of the javascript file is also available as:
+
+
+
+The release is also available through NPM (`npm install leaflet@rc`), [GitHub download](https://github.com/Leaflet/Leaflet/archive/v1.0.0-rc.1.zip), and [CDN download](http://cdn.leafletjs.com/leaflet/v1.0.0-rc.1/leaflet.zip). We discourage using Bower.
+
+
+### The team in person
+
+This Release Candidate leapt forward when most of the Leaflet team met in Madrid for a weekend to fix bugs and discuss architectural decisions, and whether some big features should make it to 1.0 or be postponed.
+
+
+This photograph might have been digitally altered to include somebody who couldn't come to Madrid that weekend.
+
+
+
+
+
+Iván and Yohan want to extend a special thanks to the roll of toilet paper.
+
+
+
+
+We enjoyed meeting in person and fighting bugs together. It proved to be a very productive thing to do, as about 20 issues were closed that day. Hopefully another in-person meeting will happen soon, with another release!
+
+
+We hope you enjoy Leaflet 1.0-rc1 as much as we did coding it!
+
+
+Best,
+Iván & Vladimir & Yohan & Per & Zsolt.
diff --git a/src/public/Leaflet-1.7.1/docs/_posts/2016-07-16-leaflet-1.0-rc2.md b/src/public/Leaflet-1.7.1/docs/_posts/2016-07-16-leaflet-1.0-rc2.md
new file mode 100644
index 0000000..197ec95
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/_posts/2016-07-16-leaflet-1.0-rc2.md
@@ -0,0 +1,60 @@
+---
+layout: post
+title: Announcing Leaflet 1.0-rc2
+description: Leaflet 1.0 Release Candidate 2 is out
+author: Yohan Boniface
+authorsite: http://yohanboniface.me
+---
+
+Here comes the second release candidate for Leaflet 1.0, the most stable Leaflet version ever!
+
+
+Leaflet 1.0-rc2 is mainly bug fixing, with two notable exceptions. The full list of changes is in the [1.0.0-rc2 changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md#10-rc2-july-18-2016) as usual.
+
+
+### Notable changes
+
+* Event refactoring: thanks to an initial work from [@fab1an](https://github.com/fab1an), coordinated by [@perliedman](https://github.com/perliedman), the events are greatly optimized: they are faster, and consume less memory.
+
+* New `L.Tooltip` class: started as a port of Leaflet.Label plugin to Leaflet core, and then reworked, this new class allows to display small tooltips attached to map features. The API is very similar to what Leaflet.Label was (with some exceptions in [options naming and default values](https://github.com/Leaflet/Leaflet.label#upgrade-path-to-ltooltip)), so the upgrade path from Leaflet.Label to `L.Tooltip` should be straightforward, and we encourage you to do so while upgrading your Leaflet to 1.0.
+
+
+
+More in the [1.0.0-rc2 changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md#10-rc2-july-18-2016).
+
+## What's left for 1.0.0-final
+
+The Leaflet team is very happy about the progress from rc1 to rc2, but not all features were tackled.
+
+Notably, the scroll zoom with an Apple Magic Mouse has proven to be very tricky to debug (especially since not all members of the team have access to one). Getting a good experience when scroll-zooming with this particular device had been planned for rc2 but ultimately it was pushed back for 1.0.0-final.
+
+While there are no big features planned, a few but [mischievous and tricky bugs are left](https://github.com/Leaflet/Leaflet/milestone/21) - such as subpixel offset, CSS trickery, zoom vibration.
+
+### Leafdays
+
+The core team being spread all over Europe, we are doing so called "Leafdays" from time to time to remotely work together during one full day. Here is a debug session with [@perliedman](https://github.com/perliedman) screen sharing:
+
+
+
+Next face-to-face session will be during [FOSS4G](http://2016.foss4g.org/) in Bonn, in August, and we hope to see you there. Will this be the final 1.0 release session?
+
+### Get the release candidate
+
+As with previous releases, you can use the CDN:
+
+
+
+
+
+A non-minified version of the javascript file is also available as:
+
+
+
+The release is also available through NPM (`npm install leaflet@rc`), [GitHub download](https://github.com/Leaflet/Leaflet/archive/v1.0.0-rc.2.zip), and [CDN download](http://cdn.leafletjs.com/leaflet/v1.0.0-rc.2/leaflet.zip). We discourage using Bower.
+
+Use it, enjoy it, and please report any [issue](https://github.com/Leaflet/Leaflet/issues) to help preparing the final Leaflet 1.0 release!
+
+
+Best,
+
+The "Leafteam"
diff --git a/src/public/Leaflet-1.7.1/docs/_posts/2016-08-05-leaflet-1.0-rc3.md b/src/public/Leaflet-1.7.1/docs/_posts/2016-08-05-leaflet-1.0-rc3.md
new file mode 100644
index 0000000..910d421
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/_posts/2016-08-05-leaflet-1.0-rc3.md
@@ -0,0 +1,53 @@
+---
+layout: post
+title: Announcing Leaflet 1.0-rc3
+description: Leaflet 1.0 Release Candidate 3 is out
+author: Yohan Boniface
+authorsite: http://yohanboniface.me
+---
+
+A regression in the way event listeners were called pushed the Leaflet team to freeze a new release candidate, so here is the third one.
+
+
+### Bug fixing, bug fixing, bug fixing!
+
+The previous release candidate landed an event refactoring and the new `L.Tooltip` class, and, how bizarre,
+almost all the fixes in this release are related to those two changes!
+
+The main regression affected the way Leaflet was calling the event listeners: the order we were calling the listeners was not the same they have been registered.
+
+Before the rc2, Leaflet was handling differently listeners with and without explicit context. The former were always called before the later, no matter the order they were registered, but their order was unpredictable. In the meantime, listeners without explicit context, while always called after the other ones, were called in registration order.
+
+While in the task of refactoring events for rc2, in order to make them faster, we also factorized those pieces of code. But we did it the wrong way!
+
+This third release is then about making all the listeners behave in a predictable way. While this is a clear improvement, it may have side effects in corner cases. So be warry when upgrading!
+
+Nothing more to highlight about this quick fixup release, check the [1.0.0-rc3 changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md#10-rc3-august-3-2016) for the full list of changes.
+
+### Summer hacking
+
+Releasing during summer, while all the team is having a break, has some funny side effects. This release was mainly done while traveling, by train and airplane.
+And partly in some small village in Iraq under 53° Celsius!
+
+
+
+### Get the release candidate
+
+As with previous releases, you can use the CDN:
+
+
+
+
+
+A non-minified version of the javascript file is also available at:
+
+
+
+The release is also available through NPM (`npm install leaflet@rc`), [GitHub download](https://github.com/Leaflet/Leaflet/archive/v1.0.0-rc.3.zip), and [CDN download](http://cdn.leafletjs.com/leaflet/v1.0.0-rc.3/leaflet.zip). We discourage using Bower.
+
+Use it, enjoy it, and please report any [issue](https://github.com/Leaflet/Leaflet/issues) to help preparing the final Leaflet 1.0 release!
+
+
+Best,
+
+The "Leafteam"
diff --git a/src/public/Leaflet-1.7.1/docs/_posts/2016-09-27-leaflet-1.0-final.md b/src/public/Leaflet-1.7.1/docs/_posts/2016-09-27-leaflet-1.0-final.md
new file mode 100644
index 0000000..352c0d1
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/_posts/2016-09-27-leaflet-1.0-final.md
@@ -0,0 +1,50 @@
+---
+layout: post
+title: Meet Leaflet 1.0.
+description: Today marks the final release of Leaflet 1.0. It's a culmination of several years of work and the fastest, most stable and polished Leaflet release ever.
+author: Vladimir Agafonkin
+authorsite: http://agafonkin.com/en
+---
+
+
+
+Today marks the final release of Leaflet 1.0. It's a culmination of several years of work by dozens of contributors from all over the world. This is the fastest, most stable and polished Leaflet release ever.
+
+[The changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md) contains _over 400 changes_ compared to the previous stable, v0.7.7. The highlights include:
+
+- Huge performance improvements in all aspects of the library and vector layers in particular.
+- New `L.Tooltip` class for all your dynamic labeling needs.
+- Flyover animations (zooming and panning in a curve with `map.flyTo`).
+- Fractional zoom level support (`map.setZoom(12.34)`).
+- Much better tile loading algorithm with less flickering.
+- Custom pane management (including multiple vector layer panes and interleaving vectors and tile layers).
+- Better support for non-standard projections.
+- More accessibility features.
+- Vastly improved documentation.
+- _Tons_ of bugfixes and stability improvements.
+
+This release wouldn't be possible without such an amazing, diverse, loving community. We're incredibly proud to be a part of it. Thank you very much for your kind support!
+
+### New release cycle
+
+This release is a way overdue and has taken too long. In part this can be attributed to our initial ambition for 1.0 that required rewriting many parts of the library almost from scratch, in part due to perfectionism (some of the beta/rc releases were already more stable than our last stable release), and in part because we underestimated the cost of introducing big breaking changes in a library used by thousands of developers.
+
+Starting with 1.0, we're switching to a fast release cycle, where a new version will come out every 2–4 weeks. We'll also prefer many small, incremental changes (with releases in between) over ambitious rewriting quests.
+
+### What's next?
+
+In addition to supporting the new release with fixes and improvements, the following areas will now get our close attention:
+
+- A cleaner, more stable plugin ecosystem. We want to make sure that all popular plugins work well with the latest release and are maintained. We'll revise our plugin list page, tighten our review process, take more key plugins under the wing of the Leaflet organization on GitHub and spend more time working on them.
+- Tutorials and examples to cover more advanced features of the library, its popular plugins, and integrations with libraries like D3 and React/Angular.
+- Explore switching to a more modern JavaScript flavor and module system (ES6, Babel, Rollup).
+- Map rotation support.
+
+Please help us test this new release, make sure it works with your favorite plugins, get involved in discussions on GitHub, and don't forget we're always looking for [new contributors](https://github.com/Leaflet/Leaflet/blob/master/CONTRIBUTING.md)!
+
+And of course, let's celebrate!
+
+Love,
+The Leaflet team.
+
+
diff --git a/src/public/Leaflet-1.7.1/docs/_posts/2016-11-21-leaflet-1.0.2.md b/src/public/Leaflet-1.7.1/docs/_posts/2016-11-21-leaflet-1.0.2.md
new file mode 100644
index 0000000..734a673
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/_posts/2016-11-21-leaflet-1.0.2.md
@@ -0,0 +1,25 @@
+---
+layout: post
+title: Announcing Leaflet 1.0.2
+description: Leaflet 1.0.2, a bugfix release, is out
+author: Iván Sánchez Ortega
+authorsite: http://ivan.sanchezortega.es
+---
+
+As part of our "we really promised a faster release cycle" vision, we are publishing Leaflet 1.0.2.
+
+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](https://leafletjs.com/download.html) to get this release.
+
+### Next plans?
+
+Now, Leaflet uses a set of scripts to put a lot of files together. While this has been reliable for years, we want to embrace some of the features of contemporary JavaScript.
+
+We have been working on reorganizing the codebase to implement ES6 modules. This means a cleaner, easier to understand build system, and slightly smaller file sizes thanks to [RollupJS](http://rollupjs.org/).
+
+We aim for a 1.1.0 release with the new rollup builds. Even though it's not a very exciting development, this will pave the way for experimenting with new ways of having Leaflet plugins.
+
+
+Cheers,
+The Leaflet team.
diff --git a/src/public/Leaflet-1.7.1/docs/_posts/2017-01-23-leaflet-1.0.3.md b/src/public/Leaflet-1.7.1/docs/_posts/2017-01-23-leaflet-1.0.3.md
new file mode 100644
index 0000000..0c0fc0c
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/_posts/2017-01-23-leaflet-1.0.3.md
@@ -0,0 +1,27 @@
+---
+layout: post
+title: Announcing Leaflet 1.0.3
+description: Leaflet 1.0.3, a bugfix release, is out
+author: Iván Sánchez Ortega
+authorsite: http://ivan.sanchezortega.es
+---
+
+Leaflet 1.0.3 is now out, with about a dozen bugfixes since 1.0.2.
+
+One of the main highlights is the handling of `dblblick` events for web browsers
+which support [`PointerEvent`s](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent).
+Until now, the only browser which used `PointerEvent`s were Internet Explorer and Edge;
+but now that Chrome has [enabled support in version 55](https://developers.google.com/web/updates/2016/11/nic55#pointer-events),
+the Leaflet code for checking for double clicks and touchscreens had to change.
+
+Leaflet 1.0.3 also improved the performance and behaviour of `L.Canvas` rendering,
+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](https://leafletjs.com/download.html) to get this release.
+
+
+Cheers,
+The Leaflet team.
diff --git a/src/public/Leaflet-1.7.1/docs/_posts/2017-06-27-leaflet-1.1.0.md b/src/public/Leaflet-1.7.1/docs/_posts/2017-06-27-leaflet-1.1.0.md
new file mode 100644
index 0000000..ad001e5
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/_posts/2017-06-27-leaflet-1.1.0.md
@@ -0,0 +1,18 @@
+---
+layout: post
+title: Announcing Leaflet 1.1.0
+description: a new version, based on ES6 modules, has been released
+author: Per Liedman
+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](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](https://leafletjs.com/download.html).
+
+Cheers,
+The Leaflet team.
diff --git a/src/public/Leaflet-1.7.1/docs/_posts/2017-08-08-leaflet-1.2.0.md b/src/public/Leaflet-1.7.1/docs/_posts/2017-08-08-leaflet-1.2.0.md
new file mode 100644
index 0000000..2d0dff1
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/_posts/2017-08-08-leaflet-1.2.0.md
@@ -0,0 +1,18 @@
+---
+layout: post
+title: Leaflet 1.2.0 has been released
+description: a new bugfix release
+author: Per Liedman
+authorsite: http://www.liedman.net
+---
+
+Leaflet 1.2.0 has just been released. The major reason for this release is to address an unfortunate regression in the 1.1.0 release, [causing trouble with several plugins](https://github.com/Leaflet/Leaflet/issues/5589). Traditionally, Leaflet plugins has altered and added to Leaflet's namespace (the `L` global), something which is no longer allowed after Leaflet was rebuilt on ES6 modules (an imported module is read-only). To preserve backwards compatibility, we have made a workaround to make the Leaflet namespace and its contents mutable again.
+
+For the future, we expect to work out a new recommendation for authoring Leaflet plugins, that takes into account how modern JavaScript is built with ES6 modules, instead of modifying the Leaflet namespace.
+
+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](https://leafletjs.com/download.html).
+
+Cheers,
+The Leaflet team.
diff --git a/src/public/Leaflet-1.7.1/docs/_posts/2018-01-15-leaflet-1.3.0.md b/src/public/Leaflet-1.7.1/docs/_posts/2018-01-15-leaflet-1.3.0.md
new file mode 100644
index 0000000..7d9da22
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/_posts/2018-01-15-leaflet-1.3.0.md
@@ -0,0 +1,17 @@
+---
+layout: post
+title: Announcing Leaflet 1.3.0
+description: a new bugfix release
+author: Andrew Cherniavskii
+authorsite: https://github.com/cherniavskii
+---
+
+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](https://leafletjs.com/download.html).
+
+Cheers,
+The Leaflet team.
diff --git a/src/public/Leaflet-1.7.1/docs/_posts/2018-01-18-leaflet-1.3.1.md b/src/public/Leaflet-1.7.1/docs/_posts/2018-01-18-leaflet-1.3.1.md
new file mode 100644
index 0000000..d430103
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/_posts/2018-01-18-leaflet-1.3.1.md
@@ -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,
+The Leaflet team.
diff --git a/src/public/Leaflet-1.7.1/docs/_posts/2018-07-17-leaflet-1.3.2.md b/src/public/Leaflet-1.7.1/docs/_posts/2018-07-17-leaflet-1.3.2.md
new file mode 100644
index 0000000..af9bd71
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/_posts/2018-07-17-leaflet-1.3.2.md
@@ -0,0 +1,17 @@
+---
+layout: post
+title: Announcing Leaflet 1.3.2
+description: a new bugfix release
+author: Andrew Cherniavskii
+authorsite: https://github.com/cherniavskii
+---
+
+Leaflet 1.3.2 is out!
+
+This release contains some bugfixes and improvements :)
+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](https://leafletjs.com/download.html).
+
+Cheers,
+The Leaflet team.
diff --git a/src/public/Leaflet-1.7.1/docs/_posts/2018-07-18-leaflet-1.3.3.md b/src/public/Leaflet-1.7.1/docs/_posts/2018-07-18-leaflet-1.3.3.md
new file mode 100644
index 0000000..653ad4d
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/_posts/2018-07-18-leaflet-1.3.3.md
@@ -0,0 +1,20 @@
+---
+layout: post
+title: Announcing Leaflet 1.3.3
+description: a new bugfix release
+author: Andrew Cherniavskii
+authorsite: https://github.com/cherniavskii
+---
+
+Leaflet 1.3.3 is out!
+
+This release fixes global variable `L` not being exposed. See [#6238](https://github.com/Leaflet/Leaflet/issues/6238) for details.
+
+Big thanks to our users for reporting this issue!
+
+Changelog is available [here](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md).
+
+To get the new release, update your dependencies in your favorite package manager, or check the [downloads page](https://leafletjs.com/download.html).
+
+Cheers,
+The Leaflet team.
diff --git a/src/public/Leaflet-1.7.1/docs/_posts/2018-08-21-leaflet-1.3.4.md b/src/public/Leaflet-1.7.1/docs/_posts/2018-08-21-leaflet-1.3.4.md
new file mode 100644
index 0000000..573b297
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/_posts/2018-08-21-leaflet-1.3.4.md
@@ -0,0 +1,21 @@
+---
+layout: post
+title: Announcing Leaflet 1.3.4
+description: New patch release is out
+author: Andrew Cherniavskii
+authorsite: https://github.com/cherniavskii
+---
+
+Leaflet 1.3.4 is out!
+
+This release contains some bugfixes and improvements :)
+Big thanks to all contributors who made this release possible!
+
+Changelog is available [here](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md).
+
+Want to receive notification when new Leaflet release is available? Subscribe to [this issue](https://github.com/Leaflet/Leaflet/issues/6295).
+
+To get the new release, update your dependencies in your favorite package manager, or check the [downloads page](https://leafletjs.com/download.html).
+
+Cheers,
+The Leaflet team.
diff --git a/src/public/Leaflet-1.7.1/docs/_posts/2018-12-30-leaflet-1.4.0.md b/src/public/Leaflet-1.7.1/docs/_posts/2018-12-30-leaflet-1.4.0.md
new file mode 100644
index 0000000..30cfa36
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/_posts/2018-12-30-leaflet-1.4.0.md
@@ -0,0 +1,19 @@
+---
+layout: post
+title: Announcing Leaflet 1.4.0
+description: New Year's release is out!
+author: Andrew Cherniavskii
+authorsite: https://github.com/cherniavskii
+---
+
+Leaflet 1.4.0 is out!
+
+This minor version release brings new useful [Map.panInside](https://leafletjs.com/reference.html#map-paninside) method, as well as bugfixes and improvements! :)
+Big thanks to all contributors who made this release possible!
+
+Changelog is available [here](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md).
+
+To get the new release, update your dependencies in your favorite package manager, or check the [downloads page](https://leafletjs.com/download.html).
+
+Happy New Year,
+The Leaflet team.
diff --git a/src/public/Leaflet-1.7.1/docs/_posts/2019-05-08-leaflet-1.5.0.md b/src/public/Leaflet-1.7.1/docs/_posts/2019-05-08-leaflet-1.5.0.md
new file mode 100644
index 0000000..f06fca0
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/_posts/2019-05-08-leaflet-1.5.0.md
@@ -0,0 +1,27 @@
+---
+layout: post
+title: Announcing Leaflet 1.5.0
+description: New release is out!
+author: Andrew Cherniavskii
+authorsite: https://github.com/cherniavskii
+---
+
+Leaflet 1.5.0 is out!
+
+This release brings some new features, as well as bugfixes and improvements!
+
+Here are some highlights:
+- new `keepAspectRatio` option for `VideoOverlay`
+- support for `keydown` and `keyup` events
+- new `shadowPane` option for `Marker`
+- fixed layers controls state when using multiple maps
+- update attribution link to HTTPS
+
+Big thanks to all contributors who made this release possible!
+
+Changelog is available [here](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md).
+
+To get the new release, update your dependencies in your favorite package manager, or check the [downloads page](https://leafletjs.com/download.html).
+
+Cheers,
+The Leaflet team.
diff --git a/src/public/Leaflet-1.7.1/docs/_posts/2019-05-08-leaflet-1.5.1.md b/src/public/Leaflet-1.7.1/docs/_posts/2019-05-08-leaflet-1.5.1.md
new file mode 100644
index 0000000..718d222
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/_posts/2019-05-08-leaflet-1.5.1.md
@@ -0,0 +1,18 @@
+---
+layout: post
+title: Announcing Leaflet 1.5.1
+description: Hotfix release is out!
+author: Andrew Cherniavskii
+authorsite: https://github.com/cherniavskii
+---
+
+Leaflet 1.5.1 is out!
+
+This is a hotfix release, which fixes module export regression in 1.5.0.
+
+Changelog is available [here](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md).
+
+To get the new release, update your dependencies in your favorite package manager, or check the [downloads page](https://leafletjs.com/download.html).
+
+Cheers,
+The Leaflet team.
diff --git a/src/public/Leaflet-1.7.1/docs/_posts/2019-11-17-leaflet-1.6.0.md b/src/public/Leaflet-1.7.1/docs/_posts/2019-11-17-leaflet-1.6.0.md
new file mode 100644
index 0000000..cc1938d
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/_posts/2019-11-17-leaflet-1.6.0.md
@@ -0,0 +1,26 @@
+---
+layout: post
+title: Announcing Leaflet 1.6.0
+description: New release is out!
+author: Andrew Cherniavskii
+authorsite: https://github.com/cherniavskii
+---
+
+Leaflet 1.6.0 is out!
+
+This release brings some new features, as well as bugfixes and improvements!
+
+Here are some highlights:
+- add `oldLatLng` coordinates to `L.CircleMarker` `move` event
+- add new `markersInheritOptions` option to `L.GeoJSON`
+- fix `dblclick` on iOS 13
+- use passive event listeners
+
+Big thanks to all contributors who made this release possible!
+
+Changelog is available [here](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md).
+
+To get the new release, update your dependencies in your favorite package manager, or check the [downloads page](https://leafletjs.com/download.html).
+
+Cheers,
+The Leaflet team.
diff --git a/src/public/Leaflet-1.7.1/docs/_posts/2020-09-03-leaflet-1.7.0.md b/src/public/Leaflet-1.7.1/docs/_posts/2020-09-03-leaflet-1.7.0.md
new file mode 100644
index 0000000..facd776
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/_posts/2020-09-03-leaflet-1.7.0.md
@@ -0,0 +1,18 @@
+---
+layout: post
+title: Announcing Leaflet 1.7.0
+description: Leaflet 1.7.0 now available
+author: Iván Sánchez Ortega
+authorsite: https://ivan.sanchezortega.es
+---
+
+During the last year or so, mainstream web browsers have subtly changed the way that touchscreens work; unfortunately, Leaflet 1.6.0 and previous versions now exhibit some quirks on touchscreens.
+
+Leaflet 1.7.0 fixes that by bringing several changes to how `PointerEvent`s are detected and handled, and using passive touch event listeners when available.
+
+Besides that, there's a bunch of small bug and documentation fixes, detailed in [the changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md). Thanks to everyone who sent a fix, no matter how small!
+
+To get the new release, update your dependencies in your favorite package manager, or check the [downloads page](https://leafletjs.com/download.html).
+
+Cheers,
+The Leaflet team.
diff --git a/src/public/Leaflet-1.7.1/docs/atom.xml b/src/public/Leaflet-1.7.1/docs/atom.xml
new file mode 100644
index 0000000..2f3ad66
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/atom.xml
@@ -0,0 +1,29 @@
+---
+title: Leaflet Developer Blog Atom Feed
+---
+
+
+
+ Leaflet Dev Blog
+
+
+
+
+ {{ site.time | date_to_xmlschema }}
+ https://leafletjs.com/
+
+
+ Vladimir Agafonkin
+
+
+ {% for post in site.posts %}
+
+ {{ post.title }}
+
+ {{ post.date | date_to_xmlschema }}
+ https://leafletjs.com{{ post.id }}
+ {{ post.content | xml_escape }}
+
+ {% endfor %}
+
+
diff --git a/src/public/Leaflet-1.7.1/docs/blog.md b/src/public/Leaflet-1.7.1/docs/blog.md
new file mode 100644
index 0000000..ac2a751
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/blog.md
@@ -0,0 +1,24 @@
+---
+layout: v2
+title: Blog
+bodyclass: blog-page
+---
+
+## Leaflet Developer Blog
+
+The main place for all important Leaflet-related news, tutorials, tips and development notes. [Subscribe to Atom feed](atom.xml)
+
+---
+
+{% for post in site.posts %}
+
+
+ {{ post.date | date_to_string }}
+
+
+
+
{{ post.description }} …
+
+
+{% unless forloop.last %} {% endunless %}
+{% endfor %}
diff --git a/src/public/Leaflet-1.7.1/docs/docs/css/main.css b/src/public/Leaflet-1.7.1/docs/docs/css/main.css
new file mode 100644
index 0000000..bb7a50e
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/docs/css/main.css
@@ -0,0 +1,1095 @@
+
+/* general styles */
+
+html, body, input, select, button, textarea, table {
+ font-size: 100%;
+ font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-rendering: optimizeLegibility;
+}
+
+body {
+ line-height: 1.5;
+ color: black;
+ background-color: white;
+}
+
+p {
+ margin: 24px 0;
+}
+
+a, a span.hljs-string {
+ color: #199900;
+}
+
+a:hover, a:focus {
+ color: #160;
+}
+
+hr {
+ background: #ccc;
+ color: #ccc;
+ height: 1px;
+ margin: 0 0 1.4em;
+ border: none;
+ clear: both;
+}
+
+.clearfix:before,
+.clearfix:after {
+ content: " ";
+ display: table;
+}
+
+.clearfix:after {
+ clear: both;
+}
+
+table {
+ width: 100%;
+ border-collapse: collapse;
+ margin-bottom: 2em;
+}
+
+th, td {
+ text-align: left;
+ border: 0;
+ border: 1px solid #eee;
+ padding: 0.5em 1em 0.5em 1em;
+}
+
+table th {
+ background: #eee;
+}
+
+table td {
+ color: #666;
+}
+
+table td:first-child {
+ color: #777;
+}
+
+table td:last-child {
+ color: black;
+}
+
+table td code i {
+ color: #00A707;
+}
+
+table td code b {
+ color: black;
+ font-weight: normal;
+}
+
+iframe {
+ border: none;
+}
+
+
+/* headings */
+
+h2 {
+ font-weight: 400;
+ font-size: 2em;
+ font-weight: 300;
+ color: black;
+ margin-top: 1.6em;
+ padding-top: .2em;
+}
+
+h2:first-child {
+ margin-top: 1em;
+}
+
+h2:target {
+ color: #1EB300;
+}
+
+h3 {
+ margin-top: 1.5em;
+ padding-top: .5em;
+ color: black;
+ font-weight: 500;
+ font-size: 1.4em;
+}
+
+.blog-page h3 {
+ padding-top: 0;
+}
+
+h4 {
+ font-size: 1.1em;
+ font-weight: 500;
+ margin: 1em 0 1em;
+}
+
+
+/* general layout */
+
+.container {
+ max-width: 54em;
+ padding: 0 6em 1.5em;
+ margin: 0 auto;
+}
+.footer {
+ margin-top: 50px;
+ color: #777;
+}
+
+
+/* header */
+
+h1 {
+ margin: 1.25em 0 1.5em;
+ text-align: center;
+}
+
+h1 a {
+ display: block;
+ margin: auto;
+ padding: 0 2em;
+ -webkit-transition: 0.8s all;
+ -webkit-animation: leafanim 3s ease 3s 1 normal none;
+ transition: 0.8s all;
+ animation: leafanim 3s ease 3s 1 normal none;
+}
+
+@-webkit-keyframes leafanim {
+ 50% { -webkit-filter: hue-rotate(-70deg) saturate(1.2); }
+}
+
+@keyframes leafanim {
+ 50% { -webkit-filter: hue-rotate(-70deg) saturate(1.2); }
+}
+
+h1 a img {
+ display: block;
+ margin: auto;
+ max-width: 100%;
+}
+
+h1 a:hover, h1 a:focus {
+ -webkit-filter: hue-rotate(-70deg) saturate(1.5);
+}
+
+h3.tagline {
+ font-weight: 300;
+ font-size: 1.5em;
+ margin-top: -.75em;
+ padding: 0;
+ color: #333;
+ text-align: center;
+ margin-bottom: 30px;
+}
+
+.nav {
+ overflow: hidden;
+ list-style: none;
+ padding: 0 30px;
+ text-align: center;
+ font-size: 1.25em;
+ margin-bottom: 40px;
+ border-bottom: 1px solid #ccc;
+ padding-bottom: 40px;
+}
+
+.nav li {
+ display: inline-block;
+ padding: .333em .5em;
+ color: #999;
+}
+
+.nav li a {
+ font-weight: 400;
+ text-decoration: none;
+}
+
+.ext-links {
+ position: fixed;
+ top: 1.5em;
+ right: 1.5em;
+}
+
+.ext-link {
+ display: block;
+ opacity: 0.7;
+ -webkit-animation: fadein 1s;
+ animation: fadein 1s;
+}
+.ext-link:hover {
+ opacity: 1;
+}
+@-webkit-keyframes fadein {
+ from { opacity: 0; }
+ to { opacity: 0.7; }
+}
+@keyframes fadein {
+ from { opacity: 0; }
+ to { opacity: 0.7; }
+}
+
+
+/* content */
+
+.container code, .container pre code {
+ font-family: "Consolas", "Menlo", "Lucida Console", "Courier New", monospace;
+ -webkit-font-smoothing: subpixel-antialiased;
+}
+.container pre code {
+ font-size: 14px;
+ padding: .75em 1em;
+ border-radius: 5px;
+ white-space: pre;
+ overflow: auto;
+}
+.container pre {
+ border-radius: 5px;
+}
+
+.container .map {
+ border: 1px solid #ccc;
+}
+.container .map:focus {
+ border-color: #999;
+}
+
+.quiet {
+ color: #888;
+}
+
+
+/* frontpage */
+
+.map-home {
+ height: 300px;
+ margin-top: 50px;
+ margin-bottom: 50px;
+}
+
+.usedby-title {
+ text-align: center;
+ background-color: #f5f5f5;
+ padding: 1em 1em 0.5em;
+ margin: 0;
+}
+
+.usedby {
+ margin: 0 0 3em;
+ text-align: center;
+ padding: 0 3em 0;
+ background-color: #f5f5f5;
+}
+
+.logo {
+ display: inline-block;
+ opacity: 0.8;
+ height: 32px;
+ overflow: hidden;
+ text-indent: -9999px;
+ margin: 1em;
+ background: url(../images/logos.png);
+ background-repeat: no-repeat;
+ background-size: 100%;
+ vertical-align: middle;
+ -webkit-transition: opacity .15s ease;
+ transition: opacity .15s ease;
+}
+
+.logo:hover { opacity: 1; }
+
+.logo-foursquare {
+ background-position: 50% -4px;
+ width: 135px;
+}
+
+.logo-pinterest {
+ background-position: 50% -39px;
+ width: 115px;
+}
+
+.logo-500px {
+ background-position: 50% -48px;
+ width: 52px;
+ background-size: 80px;
+}
+
+.logo-evernote {
+ background-position: 50% -169px;
+ width: 170px;
+ height: 43px;
+}
+
+.logo-ftimes {
+ background-position: 50% -190px;
+ width: 112px;
+ height: 40px;
+ background-size: 145px;
+}
+
+.logo-github {
+ background-position: 50% -178px;
+ width: 110px;
+}
+
+.logo-wpost {
+ background-position: 50% -327px;
+ width: 170px;
+}
+
+.logo-npr {
+ background-position: 50% -214px;
+ width: 100px;
+ height: 34px;
+}
+
+.logo-usatoday {
+ background-position: 50% -299px;
+ width: 120px;
+ height: 30px;
+}
+
+.logo-facebook {
+ background-position: 50% -356px;
+ width: 130px;
+}
+
+.logo-flickr {
+ background-position: 50% -277px;
+ width: 92px;
+ height: 29px;
+}
+
+.logo-datagov {
+ background-position: 50% -452px;
+ width: 135px;
+ height: 26px;
+}
+
+.logo-ign {
+ background-position: 50% -393px;
+ width: 110px;
+}
+
+.logo-etsy {
+ background-position: 50% -428px;
+ width: 57px;
+ background-size: 110px;
+}
+
+.logo-european-commission {
+ background-position: 50% -526px;
+ width: 125px;
+}
+
+.logo-nps {
+ background-position: 50% -483px;
+ width: 32px;
+ height: 40px;
+ margin-top: .5em;
+ margin-bottom: .5em;
+ background-size: 106px;
+}
+
+.logo-openstreetmap {
+ background-position: 50% -796px;
+ width: 160px;
+ height: 56px;
+}
+
+.features {
+ -webkit-column-count: 3;
+ -moz-column-count: 3;
+ column-count: 3;
+}
+.features ul {
+ padding-left: 1.6em;
+ margin: 0 0 1.8em;
+}
+.features h3 {
+ margin: 0 0 0.8em;
+ padding: 0;
+}
+.features h4 {
+ margin: 0 0 0.3em;
+}
+
+
+/* tutorials */
+
+.example-img {
+ float: left;
+ width: 14em;
+ max-width: 100%;
+ border-radius: 5px;
+ margin: 0 1.5em 1.5em 0;
+ border: thin solid #ccc;
+}
+
+.examples .container h3 {
+ margin-top: 0;
+}
+.post-date {
+ float: left;
+ width: 130px;
+ line-height: 1.6;
+ color: #999;
+ font-size: 18px;
+}
+.post-info {
+ overflow: hidden;
+}
+.post-title {
+ margin-top: 0;
+}
+
+
+/* plugins */
+
+.plugins td:first-child,
+.plugins td:last-child a {
+ white-space: nowrap;
+}
+
+table.plugins td:first-child a {
+ font-weight: bold;
+}
+
+.plugins-page .toc-col {
+ float: left;
+ width: 25%;
+}
+
+
+/* API docs */
+
+.api-page .toc-col {
+ position: relative;
+ float: left;
+ width: 20%;
+ padding-right: 1em;
+ margin: 0;
+ box-sizing: border-box;
+}
+
+.api-page .toc-col.map-col {
+ border-right: thin solid #eee;
+}
+
+.api-page .toc-col.map-col ~ .toc-col {
+ right: -1.5em;
+}
+
+.api-page #toc ~ h2 {
+ font-weight: 700;
+ font-size: 1.75em;
+ color: #333;
+ border-bottom: 3px solid #555;
+ transition: border-color .25s ease;
+}
+.api-page #toc ~ h2:target {
+ border-color: #1EB300;
+}
+.api-page h2:first-child {
+ border: none;
+}
+
+#toc h4 {
+ margin-top: 0;
+}
+
+#toc ul {
+ padding: 0;
+ list-style: none;
+ margin-top: 0;
+ margin-bottom: 25px;
+}
+
+#toc .colborder {
+ padding-right: 14px;
+}
+
+#toc .span-3 {
+ margin: 0;
+ padding-right: 3em;
+ width: 16.825%;
+ box-sizing: border-box;
+}
+
+#toc .span-3.last {
+ padding-right: 0;
+}
+
+#toc-copy {
+ display: none;
+}
+
+#toc-copy div {
+ border: 0;
+ margin: 0;
+ padding: 0;
+ width: auto;
+ float: none;
+}
+
+#toc-copy h4 {
+ margin: 0;
+ padding-bottom: .333em;
+}
+
+#toc-copy hr {
+ background-color: transparent;
+ margin: 0 0 .5em;
+}
+
+#toc-copy ul {
+ display: none;
+ list-style: none;
+}
+
+#toc-copy ul li {
+ white-space: nowrap;
+}
+
+#toc-copy ul li a {
+ position: relative;
+ padding: .25em .5em 0;
+ z-index: 10;
+}
+
+#toc-copy .toc-col {
+ position: static;
+}
+
+@media screen and (max-width: 1350px) {
+ #toc-copy {
+ display: block;
+ position: fixed;
+ top: 0.1em;
+ left: 0.25em;
+ width: 32px;
+ height: 32px;
+ opacity: 0;
+ cursor: pointer;
+ -webkit-transition: opacity .2s ease;
+ transition: opacity .2s ease;
+ }
+
+ #toc-copy > div { display: none; }
+
+ .scrolled #toc-copy {
+ opacity: 1;
+ background: white;
+ }
+
+ #toc-copy.active {
+ background-color: white;
+ background-color: rgba(255, 255, 255, 0.9);
+ padding: 2em;
+ width: 100%;
+ height: 100%;
+ overflow-x: hidden;
+ overflow-y: scroll;
+ cursor: default;
+ box-sizing: border-box;
+ }
+
+ #toc-copy:before,
+ #toc-copy:after {
+ content: '';
+ position: absolute;
+ left: 5px;
+ width: 22px;
+ height: 14px;
+ border-top: 2px solid black;
+ cursor: pointer;
+ box-sizing: border-box;
+ -webkit-transition: -webkit-transform .25s ease;
+ transition: transform .25s ease;
+ }
+
+ #toc-copy:before {
+ top: 9px;
+ border-bottom: 2px solid black;
+ }
+
+ #toc-copy:after {
+ top: 15px;
+ }
+
+ #toc-copy.active:before {
+ top: 5px;
+ left: 9px;
+ border-bottom: 0;
+ -webkit-transform: rotate(-135deg);
+ transform: rotate(-135deg);
+ }
+
+ #toc-copy.active:after {
+ top: 13px;
+ left: 9px;
+ -webkit-transform: rotate(-45deg);
+ transform: rotate(-45deg);
+ }
+
+ #toc-copy.active div { display: block; }
+
+ #toc-copy h4.active, #toc-copy h4:hover {
+ color: black;
+ cursor: pointer;
+ }
+
+ #toc-copy h4.active + ul {
+ display: block;
+ padding: 0;
+ margin: 0 0 .5em;
+ }
+
+ #toc-copy ul li a { padding: .25em 0; }
+}
+
+@media screen and (min-width: 900px) and (max-width: 1350px) {
+ #toc-copy {
+ width: 40px;
+ height: 40px;
+ }
+
+ #toc-copy.active {
+ padding: 2.5em;
+ }
+
+ #toc-copy:before,
+ #toc-copy:after {
+ left: 8px;
+ }
+
+ #toc-copy:before { top: 13px; }
+
+ #toc-copy:after { top: 19px; }
+
+ #toc-copy.active:before {
+ top: 7px;
+ left: 10px;
+ }
+
+ #toc-copy.active:after {
+ top: 15px;
+ left: 10px;
+ }
+}
+
+@media screen and (min-width: 1350px) and (min-height: 600px) {
+ #toc-copy {
+ display: block;
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: auto;
+ height: auto;
+ padding: 2em;
+ opacity: 0;
+ transition: opacity .25s ease;
+ -webkit-transition: opacity .25s ease;
+ }
+
+ #toc-copy:before {
+ content: 'Table of contents';
+ display: block;
+ margin: -.25em 0 1em;
+ font-size: 75%;
+ font-weight: 300;
+ text-transform: uppercase;
+ }
+
+ .scrolled #toc-copy { opacity: 1; }
+
+ #toc-copy h4 { padding-right: 5em; }
+
+ #toc-copy ul {
+ position: absolute;
+ left: 100%;
+ margin: -4.9em 0 0 -4.5em;
+ padding: 3em 6em 3em 0;
+ }
+
+ #toc-copy h4:hover + ul,
+ #toc-copy ul:hover {
+ display: block;
+ }
+
+ #toc-copy h4:hover + ul:before,
+ #toc-copy ul:hover:before {
+ content: '';
+ position: absolute;
+ top: 3.775em;
+ right: 100%;
+ margin-right: .25em;
+ width: 1em;
+ height: 1em;
+ border-top: 2px solid #eee;
+ }
+
+ #toc-copy h4:hover + ul:after,
+ #toc-copy ul:hover:after {
+ content: '';
+ position: absolute;
+ z-index: -1;
+ top: -1000px;
+ bottom: -1000px;
+ left: 0;
+ width: 12.5em;
+ background: white;
+ background: rgba(255,255,255,0.9);
+ }
+
+ .plugins-page #toc-copy h4:hover + ul:after,
+ .plugins-page #toc-copy ul:hover:after {
+ width: 17em;
+ }
+
+ #toc-copy h4:hover, #toc-copy h4.hover {
+ color: black;
+ cursor: pointer;
+ }
+}
+
+/* API docs - tables */
+
+.api-page table td {
+ color: #666;
+}
+.api-page table td:first-child {
+ color: #777;
+}
+.api-page table td:last-child {
+ color: black;
+}
+.api-page table td:last-child code {
+ word-break: break-word;
+ white-space: pre-wrap;
+}
+.api-page table td code i {
+ color: #9a9;
+}
+.api-page table td code b {
+ color: black;
+ font-weight: normal;
+}
+.api-page table td,
+.api-page table th {
+ font-size: 14px;
+}
+
+.api-page p {
+ margin-top: 0;
+}
+
+tr:target {
+ background: yellow;
+ -webkit-animation: highlight 2s ease 0.5s 1 normal forwards;
+ animation: highlight 2s ease 0.5s 1 normal forwards;
+}
+
+@-webkit-keyframes highlight {
+ 0% { background: yellow; }
+ 100% { background: white; }
+}
+@keyframes highlight {
+ 0% { background: yellow; }
+ 100% { background: white; }
+}
+
+.api-page h2[id]:before,
+.api-page tr[id] td:first-child:before {
+ content: 'Permalink';
+ display: inline-block;
+ margin: 0px 5px 0px -35px;
+ width: 30px;
+ height: 0;
+ overflow: hidden;
+ padding-top: 20px;
+ line-height: 20px;
+ vertical-align: baseline;
+ background: url(../images/sprite.png) -0px -0px no-repeat;
+ opacity: 0.2;
+ border-radius: 50%;
+ cursor: pointer;
+ position: absolute;
+ z-index: 1;
+}
+
+.api-page h2[id]:before {
+ margin-left: -32px;
+ margin-top: 14px;
+}
+
+.api-page tr[id] td:first-child:before {
+ opacity: 0;
+}
+
+.api-page tr[id]:hover td:first-child:before {
+ opacity: 1;
+}
+
+.api-page h2[id]:hover:before { opacity: 1; }
+
+@media (-webkit-min-device-pixel-ratio: 1.25),(min-resolution: 120dpi) {
+ .api-page h2[id]:before,
+ .api-page tr[id] td:first-child:before {
+ background-image: url(../images/sprite.svg);
+ }
+}
+
+@media screen and (max-width: 767px) {
+ #toc .colborder {
+ padding: 0;
+ }
+
+ .colborder {
+ margin: 0;
+ border: 0;
+ }
+
+ #toc .toc-col {
+ width: 50%;
+ float: none;
+ position: static;
+ display: inline-block;
+ margin: 0;
+ border: 0;
+ padding-right: .5em;
+ margin-right: -.25em;
+ vertical-align: top;
+ box-sizing: border-box;
+ }
+
+ .toc-col.last-col {
+ clear: both;
+ }
+
+ th,
+ td {
+ border: 0;
+ }
+
+ tr {
+ border-bottom: 1px solid #eee;
+ }
+
+ table.plugins tbody tr {
+ display: block;
+ padding-bottom: 1em;
+ }
+
+ table.plugins tbody tr td {
+ white-space: normal;
+ display: inline-block;
+ padding-bottom: 0;
+ }
+
+ table.plugins tr:first-child {
+ padding-bottom: 0;
+ }
+
+ table.plugins tr:first-child th {
+ display: block;
+ }
+
+ table.plugins tr:first-child th ~ th {
+ display: none;
+ }
+
+ table.plugins td:first-child {
+ display: block;
+ white-space: normal;
+ }
+
+ .api-page table tbody tr {
+ display: block;
+ }
+
+ .api-page table tbody tr th,
+ .api-page table tbody tr td {
+ display: inline-block;
+ background-color: transparent;
+ width: auto;
+ }
+
+ .api-page table tr:first-child th ~ th {
+ display: none;
+ }
+
+ .api-page table tbody tr th:nth-child(2),
+ .api-page table tbody tr th:nth-child(3) {
+ display: inline-block;
+ }
+
+ .api-page table tr th:last-child {
+ display: none !important;
+ }
+
+ .api-page table tbody tr td:last-child {
+ display: block;
+ border-top: thin dashed #ddd;
+ padding: 1em;
+ }
+
+ /*.api-page table tbody tr td:last-child:before {
+ content: 'Description';
+ display: block;
+ text-transform: uppercase;
+ font-size: 90%;
+ margin-bottom: .75em;
+ color: #666;
+ }*/
+
+ td code {
+ word-break: break-word;
+ }
+}
+
+@media screen and (max-width: 56em) {
+ .container {
+ padding: 0 2em 1.5em;
+ }
+
+ .footer, .social-buttons {
+ text-align: center;
+ }
+
+ .footer {
+ margin-top: 2em;
+ }
+
+ .ext-links {
+ position: static;
+ margin: 0 auto 2em;
+ text-align: center;
+ clear: both;
+ }
+
+ .ext-link {
+ display: inline-block;
+ vertical-align: middle;
+ margin: .25em;
+ }
+
+ .features {
+ -webkit-column-count: 2;
+ -moz-column-count: 2;
+ column-count: 2;
+ }
+}
+
+@media screen and (max-width: 500px) {
+ .nav {
+ font-size: 1.25em;
+ padding-bottom: 1em;
+ line-height: 1;
+ }
+
+ h1 {
+ margin: 1em 0;
+ }
+
+ h3.tagline {
+ font-size: 1.05em;
+ margin: 0 1em;
+ }
+
+ .container {
+ padding: 0 1.5em 1.5em;
+ }
+
+ .logo {
+ margin: 0.6em;
+ }
+
+ .usedby-title {
+ padding-top: 1em;
+ padding-bottom: 0.5em;
+ font-size: 1.8em;
+ }
+
+ .usedby {
+ padding-left: 0;
+ padding-right: 0;
+ padding-bottom: 0;
+ }
+
+ .features {
+ -webkit-column-count: 1;
+ -moz-column-count: 1;
+ column-count: 1;
+ }
+
+ .example-img {
+ float: none;
+ display: block;
+ width: auto;
+ margin: 0 0 -.25em;
+ border: 0;
+ }
+
+ .post-date {
+ float: none;
+ width: auto;
+ margin: 0 0 .333em;
+ }
+
+ .api-page h2[id] { text-indent: 24px; }
+ .api-page h2[id]:before { margin-left: -28px; }
+}
+
+.width250 {
+ width: 250px;
+}
+.width200 {
+ width: 200px;
+}
+.width300 {
+ width: 300px;
+}
+.width100 {
+ width: 100px;
+}
+.width140 {
+ width: 140px;
+}
+.minwidth {
+ width: 1px;
+}
+
+.download-page table td a {
+ white-space: nowrap;
+}
+
+.tutorials-back {
+ margin-bottom: -3em;
+}
+
+.post-page h2 {
+ margin-top: 0;
+}
+
+.post-meta {
+ color: #888;
+ margin-top: -1em;
+}
+
+iframe[src*='youtube.com'] {
+ max-width: 100% !important;
+}
+
+.no-break {
+ display: inline-block;
+ width: 100%;
+}
+
+.announcement {
+ background: #eee;
+ padding: 5px 10px;
+ border-radius: 10px;
+}
diff --git a/src/public/Leaflet-1.7.1/docs/docs/css/normalize.css b/src/public/Leaflet-1.7.1/docs/docs/css/normalize.css
new file mode 100644
index 0000000..f4b0e0a
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/docs/css/normalize.css
@@ -0,0 +1,426 @@
+/*! normalize.css v3.0.1 | MIT License | git.io/normalize */
+
+/**
+ * 1. Set default font family to sans-serif.
+ * 2. Prevent iOS text size adjust after orientation change, without disabling
+ * user zoom.
+ */
+
+html {
+ font-family: sans-serif; /* 1 */
+ -ms-text-size-adjust: 100%; /* 2 */
+ -webkit-text-size-adjust: 100%; /* 2 */
+}
+
+/**
+ * Remove default margin.
+ */
+
+body {
+ margin: 0;
+}
+
+/* HTML5 display definitions
+ ========================================================================== */
+
+/**
+ * Correct `block` display not defined for any HTML5 element in IE 8/9.
+ * Correct `block` display not defined for `details` or `summary` in IE 10/11 and Firefox.
+ * Correct `block` display not defined for `main` in IE 11.
+ */
+
+article,
+aside,
+details,
+figcaption,
+figure,
+footer,
+header,
+hgroup,
+main,
+nav,
+section,
+summary {
+ display: block;
+}
+
+/**
+ * 1. Correct `inline-block` display not defined in IE 8/9.
+ * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
+ */
+
+audio,
+canvas,
+progress,
+video {
+ display: inline-block; /* 1 */
+ vertical-align: baseline; /* 2 */
+}
+
+/**
+ * Prevent modern browsers from displaying `audio` without controls.
+ * Remove excess height in iOS 5 devices.
+ */
+
+audio:not([controls]) {
+ display: none;
+ height: 0;
+}
+
+/**
+ * Address `[hidden]` styling not present in IE 8/9/10.
+ * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22.
+ */
+
+[hidden],
+template {
+ display: none;
+}
+
+/* Links
+ ========================================================================== */
+
+/**
+ * Remove the gray background color from active links in IE 10.
+ */
+
+a {
+ background: transparent;
+}
+
+/**
+ * Improve readability when focused and also mouse hovered in all browsers.
+ */
+
+a:active,
+a:hover {
+ outline: 0;
+}
+
+/* Text-level semantics
+ ========================================================================== */
+
+/**
+ * Address styling not present in IE 8/9/10/11, Safari, and Chrome.
+ */
+
+abbr[title] {
+ border-bottom: 1px dotted;
+ text-decoration: none;
+}
+
+/**
+ * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
+ */
+
+b,
+strong {
+ font-weight: bold;
+}
+
+/**
+ * Address styling not present in Safari and Chrome.
+ */
+
+dfn {
+ font-style: italic;
+}
+
+/**
+ * Address variable `h1` font-size and margin within `section` and `article`
+ * contexts in Firefox 4+, Safari, and Chrome.
+ */
+
+h1 {
+ font-size: 2em;
+ margin: 0.67em 0;
+}
+
+/**
+ * Address styling not present in IE 8/9.
+ */
+
+mark {
+ background: #ff0;
+ color: #000;
+}
+
+/**
+ * Address inconsistent and variable font size in all browsers.
+ */
+
+small {
+ font-size: 80%;
+}
+
+/**
+ * Prevent `sub` and `sup` affecting `line-height` in all browsers.
+ */
+
+sub,
+sup {
+ font-size: 75%;
+ line-height: 0;
+ position: relative;
+ vertical-align: baseline;
+}
+
+sup {
+ top: -0.5em;
+}
+
+sub {
+ bottom: -0.25em;
+}
+
+/* Embedded content
+ ========================================================================== */
+
+/**
+ * Remove border when inside `a` element in IE 8/9/10.
+ */
+
+img {
+ border: 0;
+}
+
+/**
+ * Correct overflow not hidden in IE 9/10/11.
+ */
+
+svg:not(:root) {
+ overflow: hidden;
+}
+
+/* Grouping content
+ ========================================================================== */
+
+/**
+ * Address margin not present in IE 8/9 and Safari.
+ */
+
+figure {
+ margin: 1em 40px;
+}
+
+/**
+ * Address differences between Firefox and other browsers.
+ */
+
+hr {
+ -moz-box-sizing: content-box;
+ box-sizing: content-box;
+ height: 0;
+}
+
+/**
+ * Contain overflow in all browsers.
+ */
+
+pre {
+ overflow: auto;
+}
+
+/**
+ * Address odd `em`-unit font size rendering in all browsers.
+ */
+
+code,
+kbd,
+pre,
+samp {
+ font-family: monospace, monospace;
+ font-size: 1em;
+}
+
+/* Forms
+ ========================================================================== */
+
+/**
+ * Known limitation: by default, Chrome and Safari on OS X allow very limited
+ * styling of `select`, unless a `border` property is set.
+ */
+
+/**
+ * 1. Correct color not being inherited.
+ * Known issue: affects color of disabled elements.
+ * 2. Correct font properties not being inherited.
+ * 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
+ */
+
+button,
+input,
+optgroup,
+select,
+textarea {
+ color: inherit; /* 1 */
+ font: inherit; /* 2 */
+ margin: 0; /* 3 */
+}
+
+/**
+ * Address `overflow` set to `hidden` in IE 8/9/10/11.
+ */
+
+button {
+ overflow: visible;
+}
+
+/**
+ * Address inconsistent `text-transform` inheritance for `button` and `select`.
+ * All other form control elements do not inherit `text-transform` values.
+ * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
+ * Correct `select` style inheritance in Firefox.
+ */
+
+button,
+select {
+ text-transform: none;
+}
+
+/**
+ * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
+ * and `video` controls.
+ * 2. Correct inability to style clickable `input` types in iOS.
+ * 3. Improve usability and consistency of cursor style between image-type
+ * `input` and others.
+ */
+
+button,
+html input[type="button"], /* 1 */
+input[type="reset"],
+input[type="submit"] {
+ -webkit-appearance: button; /* 2 */
+ cursor: pointer; /* 3 */
+}
+
+/**
+ * Re-set default cursor for disabled elements.
+ */
+
+button[disabled],
+html input[disabled] {
+ cursor: default;
+}
+
+/**
+ * Remove inner padding and border in Firefox 4+.
+ */
+
+button::-moz-focus-inner,
+input::-moz-focus-inner {
+ border: 0;
+ padding: 0;
+}
+
+/**
+ * Address Firefox 4+ setting `line-height` on `input` using `!important` in
+ * the UA stylesheet.
+ */
+
+input {
+ line-height: normal;
+}
+
+/**
+ * It's recommended that you don't attempt to style these elements.
+ * Firefox's implementation doesn't respect box-sizing, padding, or width.
+ *
+ * 1. Address box sizing set to `content-box` in IE 8/9/10.
+ * 2. Remove excess padding in IE 8/9/10.
+ */
+
+input[type="checkbox"],
+input[type="radio"] {
+ box-sizing: border-box; /* 1 */
+ padding: 0; /* 2 */
+}
+
+/**
+ * Fix the cursor style for Chrome's increment/decrement buttons. For certain
+ * `font-size` values of the `input`, it causes the cursor style of the
+ * decrement button to change from `default` to `text`.
+ */
+
+input[type="number"]::-webkit-inner-spin-button,
+input[type="number"]::-webkit-outer-spin-button {
+ height: auto;
+}
+
+/**
+ * 1. Address `appearance` set to `searchfield` in Safari and Chrome.
+ * 2. Address `box-sizing` set to `border-box` in Safari and Chrome
+ * (include `-moz` to future-proof).
+ */
+
+input[type="search"] {
+ -webkit-appearance: textfield; /* 1 */
+ -moz-box-sizing: content-box;
+ -webkit-box-sizing: content-box; /* 2 */
+ box-sizing: content-box;
+}
+
+/**
+ * Remove inner padding and search cancel button in Safari and Chrome on OS X.
+ * Safari (but not Chrome) clips the cancel button when the search input has
+ * padding (and `textfield` appearance).
+ */
+
+input[type="search"]::-webkit-search-cancel-button,
+input[type="search"]::-webkit-search-decoration {
+ -webkit-appearance: none;
+}
+
+/**
+ * Define consistent border, margin, and padding.
+ */
+
+fieldset {
+ border: 1px solid #c0c0c0;
+ margin: 0 2px;
+ padding: 0.35em 0.625em 0.75em;
+}
+
+/**
+ * 1. Correct `color` not being inherited in IE 8/9/10/11.
+ * 2. Remove padding so people aren't caught out if they zero out fieldsets.
+ */
+
+legend {
+ border: 0; /* 1 */
+ padding: 0; /* 2 */
+}
+
+/**
+ * Remove default vertical scrollbar in IE 8/9/10/11.
+ */
+
+textarea {
+ overflow: auto;
+}
+
+/**
+ * Don't inherit the `font-weight` (applied by a rule above).
+ * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
+ */
+
+optgroup {
+ font-weight: bold;
+}
+
+/* Tables
+ ========================================================================== */
+
+/**
+ * Remove most spacing between table cells.
+ */
+
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+
+td,
+th {
+ padding: 0;
+}
diff --git a/src/public/Leaflet-1.7.1/docs/docs/css/reference.css b/src/public/Leaflet-1.7.1/docs/docs/css/reference.css
new file mode 100644
index 0000000..dbbbb97
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/docs/css/reference.css
@@ -0,0 +1,98 @@
+h2 {
+ margin-top: 2em;
+}
+
+h3 {
+ margin-top: 1em;
+ margin-bottom: .5em;
+}
+
+div.accordion {
+ width: 100%;
+/* overflow: hidden; */
+}
+
+div.accordion-overflow {
+ width: 100%;
+ overflow: hidden;
+}
+
+label,
+section > h4 {
+ display: block;
+ font-weight: 500;
+ margin: 1em 0 0.25em;
+}
+
+label {
+ cursor: pointer;
+}
+
+div.accordion > div.accordion-overflow > div.accordion-content {
+ max-height: 0;
+ display: none;
+}
+
+div.accordion.collapsed > div.accordion-overflow > div.accordion-content {
+ animation-duration: 0.4s;
+ animation-name: collapse;
+/* height: 0; */
+ max-height: 0;
+ display: block;
+ overflow: hidden;
+}
+
+div.accordion.expanded > div.accordion-overflow > div.accordion-content {
+ animation-duration: 0.4s;
+ animation-name: expand;
+/* height: auto; */
+ max-height: none;
+ display: block;
+}
+
+@keyframes collapse {
+ 0% { max-height: 100vh; }
+ 100% { max-height: 0; }
+}
+
+@keyframes expand {
+ 0% { max-height: 0; }
+ 100% { max-height: 100vh; }
+}
+
+/* div.accordion > div.accordion-content {
+ transition: max-height 0.4s ease-out 0s;
+}*/
+
+div.accordion.expanded > label > span.expander {
+ transform: rotate(90deg);
+}
+
+div.accordion > label > span.expander {
+ transition: transform 0.4s ease-out 0s;
+ display: inline-block;
+ font-size: 12px;
+}
+
+
+table {
+ margin-bottom: 0;
+}
+
+/* Markdown renders some spurious s inside the table cells */
+td > p {
+ margin:0;
+}
+
+/* This just looks bad (with the current grey headers for sections which Vlad doesn't really like, so might have to change this) */
+section.collapsable > div.section-comments > p {
+ margin:0;
+}
+
+div.section-comments {
+ margin-bottom: 0.5em;
+}
+
+section.collapsable pre {
+ margin:0;
+}
diff --git a/src/public/Leaflet-1.7.1/docs/docs/highlight/LICENSE b/src/public/Leaflet-1.7.1/docs/docs/highlight/LICENSE
new file mode 100644
index 0000000..422deb7
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/docs/highlight/LICENSE
@@ -0,0 +1,24 @@
+Copyright (c) 2006, Ivan Sagalaev
+All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * 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.
+ * Neither the name of highlight.js nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS AND 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/src/public/Leaflet-1.7.1/docs/docs/highlight/highlight.pack.js b/src/public/Leaflet-1.7.1/docs/docs/highlight/highlight.pack.js
new file mode 100644
index 0000000..12de77f
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/docs/highlight/highlight.pack.js
@@ -0,0 +1 @@
+!function(e){"undefined"!=typeof exports?e(exports):(window.hljs=e({}),"function"==typeof define&&define.amd&&define("hljs",[],function(){return window.hljs}))}(function(e){function n(e){return e.replace(/&/gm,"&").replace(//gm,">")}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0==t.index}function a(e){return/no-?highlight|plain|text/.test(e)}function i(e){var n,t,r,i=e.className+" ";if(i+=e.parentNode?e.parentNode.className:"",t=/\blang(?:uage)?-([\w-]+)\b/.exec(i))return E(t[1])?t[1]:"no-highlight";for(i=i.split(/\s+/),n=0,r=i.length;r>n;n++)if(E(i[n])||a(i[n]))return i[n]}function o(e,n){var t,r={};for(t in e)r[t]=e[t];if(n)for(t in n)r[t]=n[t];return r}function u(e){var n=[];return function r(e,a){for(var i=e.firstChild;i;i=i.nextSibling)3==i.nodeType?a+=i.nodeValue.length:1==i.nodeType&&(n.push({event:"start",offset:a,node:i}),a=r(i,a),t(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:i}));return a}(e,0),n}function c(e,r,a){function i(){return e.length&&r.length?e[0].offset!=r[0].offset?e[0].offset"}function u(e){f+=""+t(e)+">"}function c(e){("start"==e.event?o:u)(e.node)}for(var s=0,f="",l=[];e.length||r.length;){var g=i();if(f+=n(a.substr(s,g[0].offset-s)),s=g[0].offset,g==e){l.reverse().forEach(u);do c(g.splice(0,1)[0]),g=i();while(g==e&&g.length&&g[0].offset==s);l.reverse().forEach(o)}else"start"==g[0].event?l.push(g[0].node):l.pop(),c(g.splice(0,1)[0])}return f+n(a.substr(s))}function s(e){function n(e){return e&&e.source||e}function t(t,r){return new RegExp(n(t),"m"+(e.cI?"i":"")+(r?"g":""))}function r(a,i){if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK,a.k){var u={},c=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(" ").forEach(function(e){var t=e.split("|");u[t[0]]=[n,t[1]?Number(t[1]):1]})};"string"==typeof a.k?c("keyword",a.k):Object.keys(a.k).forEach(function(e){c(e,a.k[e])}),a.k=u}a.lR=t(a.l||/\b\w+\b/,!0),i&&(a.bK&&(a.b="\\b("+a.bK.split(" ").join("|")+")\\b"),a.b||(a.b=/\B|\b/),a.bR=t(a.b),a.e||a.eW||(a.e=/\B|\b/),a.e&&(a.eR=t(a.e)),a.tE=n(a.e)||"",a.eW&&i.tE&&(a.tE+=(a.e?"|":"")+i.tE)),a.i&&(a.iR=t(a.i)),void 0===a.r&&(a.r=1),a.c||(a.c=[]);var s=[];a.c.forEach(function(e){e.v?e.v.forEach(function(n){s.push(o(e,n))}):s.push("self"==e?a:e)}),a.c=s,a.c.forEach(function(e){r(e,a)}),a.starts&&r(a.starts,i);var f=a.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([a.tE,a.i]).map(n).filter(Boolean);a.t=f.length?t(f.join("|"),!0):{exec:function(){return null}}}}r(e)}function f(e,t,a,i){function o(e,n){for(var t=0;t";return i+=e+'">',i+n+o}function p(){if(!L.k)return n(B);var e="",t=0;L.lR.lastIndex=0;for(var r=L.lR.exec(B);r;){e+=n(B.substr(t,r.index-t));var a=g(L,r);a?(y+=a[1],e+=h(a[0],n(r[0]))):e+=n(r[0]),t=L.lR.lastIndex,r=L.lR.exec(B)}return e+n(B.substr(t))}function d(){if(L.sL&&!x[L.sL])return n(B);var e=L.sL?f(L.sL,B,!0,M[L.sL]):l(B);return L.r>0&&(y+=e.r),"continuous"==L.subLanguageMode&&(M[L.sL]=e.top),h(e.language,e.value,!1,!0)}function b(){return void 0!==L.sL?d():p()}function v(e,t){var r=e.cN?h(e.cN,"",!0):"";e.rB?(k+=r,B=""):e.eB?(k+=n(t)+r,B=""):(k+=r,B=t),L=Object.create(e,{parent:{value:L}})}function m(e,t){if(B+=e,void 0===t)return k+=b(),0;var r=o(t,L);if(r)return k+=b(),v(r,t),r.rB?0:t.length;var a=u(L,t);if(a){var i=L;i.rE||i.eE||(B+=t),k+=b();do L.cN&&(k+=""),y+=L.r,L=L.parent;while(L!=a.parent);return i.eE&&(k+=n(t)),B="",a.starts&&v(a.starts,""),i.rE?0:t.length}if(c(t,L))throw new Error('Illegal lexeme "'+t+'" for mode "'+(L.cN||"")+'"');return B+=t,t.length||1}var N=E(e);if(!N)throw new Error('Unknown language: "'+e+'"');s(N);var R,L=i||N,M={},k="";for(R=L;R!=N;R=R.parent)R.cN&&(k=h(R.cN,"",!0)+k);var B="",y=0;try{for(var C,j,I=0;;){if(L.t.lastIndex=I,C=L.t.exec(t),!C)break;j=m(t.substr(I,C.index-I),C[0]),I=C.index+j}for(m(t.substr(I)),R=L;R.parent;R=R.parent)R.cN&&(k+="");return{r:y,value:k,language:e,top:L}}catch(O){if(-1!=O.message.indexOf("Illegal"))return{r:0,value:n(t)};throw O}}function l(e,t){t=t||w.languages||Object.keys(x);var r={r:0,value:n(e)},a=r;return t.forEach(function(n){if(E(n)){var t=f(n,e,!1);t.language=n,t.r>a.r&&(a=t),t.r>r.r&&(a=r,r=t)}}),a.language&&(r.second_best=a),r}function g(e){return w.tabReplace&&(e=e.replace(/^((<[^>]+>|\t)+)/gm,function(e,n){return n.replace(/\t/g,w.tabReplace)})),w.useBR&&(e=e.replace(/\n/g," ")),e}function h(e,n,t){var r=n?R[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),-1===e.indexOf(r)&&a.push(r),a.join(" ").trim()}function p(e){var n=i(e);if(!a(n)){var t;w.useBR?(t=document.createElementNS("http://www.w3.org/1999/xhtml","div"),t.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/ /g,"\n")):t=e;var r=t.textContent,o=n?f(n,r,!0):l(r),s=u(t);if(s.length){var p=document.createElementNS("http://www.w3.org/1999/xhtml","div");p.innerHTML=o.value,o.value=c(s,u(p),r)}o.value=g(o.value),e.innerHTML=o.value,e.className=h(e.className,n,o.language),e.result={language:o.language,re:o.r},o.second_best&&(e.second_best={language:o.second_best.language,re:o.second_best.r})}}function d(e){w=o(w,e)}function b(){if(!b.called){b.called=!0;var e=document.querySelectorAll("pre code");Array.prototype.forEach.call(e,p)}}function v(){addEventListener("DOMContentLoaded",b,!1),addEventListener("load",b,!1)}function m(n,t){var r=x[n]=t(e);r.aliases&&r.aliases.forEach(function(e){R[e]=n})}function N(){return Object.keys(x)}function E(e){return x[e]||x[R[e]]}var w={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0},x={},R={};return e.highlight=f,e.highlightAuto=l,e.fixMarkup=g,e.highlightBlock=p,e.configure=d,e.initHighlighting=b,e.initHighlightingOnLoad=v,e.registerLanguage=m,e.listLanguages=N,e.getLanguage=E,e.inherit=o,e.IR="[a-zA-Z]\\w*",e.UIR="[a-zA-Z_]\\w*",e.NR="\\b\\d+(\\.\\d+)?",e.CNR="\\b(0[xX][a-fA-F0-9]+|(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BNR="\\b(0b[01]+)",e.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BE={b:"\\\\[\\s\\S]",r:0},e.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[e.BE]},e.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[e.BE]},e.PWM={b:/\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such)\b/},e.C=function(n,t,r){var a=e.inherit({cN:"comment",b:n,e:t,c:[]},r||{});return a.c.push(e.PWM),a.c.push({cN:"doctag",bK:"TODO FIXME NOTE BUG XXX",r:0}),a},e.CLCM=e.C("//","$"),e.CBCM=e.C("/\\*","\\*/"),e.HCM=e.C("#","$"),e.NM={cN:"number",b:e.NR,r:0},e.CNM={cN:"number",b:e.CNR,r:0},e.BNM={cN:"number",b:e.BNR,r:0},e.CSSNM={cN:"number",b:e.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},e.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[e.BE,{b:/\[/,e:/\]/,r:0,c:[e.BE]}]},e.TM={cN:"title",b:e.IR,r:0},e.UTM={cN:"title",b:e.UIR,r:0},e});hljs.registerLanguage("javascript",function(e){return{aliases:["js"],k:{keyword:"in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise"},c:[{cN:"pi",r:10,b:/^\s*['"]use (strict|asm)['"]/},e.ASM,e.QSM,{cN:"string",b:"`",e:"`",c:[e.BE,{cN:"subst",b:"\\$\\{",e:"\\}"}]},e.CLCM,e.CBCM,{cN:"number",v:[{b:"\\b(0[bB][01]+)"},{b:"\\b(0[oO][0-7]+)"},{b:e.CNR}],r:0},{b:"("+e.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[e.CLCM,e.CBCM,e.RM,{b:/,e:/>\s*[);\]]/,r:0,sL:"xml"}],r:0},{cN:"function",bK:"function",e:/\{/,eE:!0,c:[e.inherit(e.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,c:[e.CLCM,e.CBCM],i:/["'\(]/}],i:/\[|%/},{b:/\$[(.]/},{b:"\\."+e.IR,r:0},{bK:"import",e:"[;$]",k:"import from as",c:[e.ASM,e.QSM]},{cN:"class",bK:"class",e:/[{;=]/,eE:!0,i:/[:"\[\]]/,c:[{bK:"extends"},e.UTM]}]}});hljs.registerLanguage("css",function(e){var c="[a-zA-Z-][a-zA-Z0-9_-]*",a={cN:"function",b:c+"\\(",rB:!0,eE:!0,e:"\\("},r={cN:"rule",b:/[A-Z\_\.\-]+\s*:/,rB:!0,e:";",eW:!0,c:[{cN:"attribute",b:/\S/,e:":",eE:!0,starts:{cN:"value",eW:!0,eE:!0,c:[a,e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:"hexcolor",b:"#[0-9A-Fa-f]+"},{cN:"important",b:"!important"}]}}]};return{cI:!0,i:/[=\/|'\$]/,c:[e.CBCM,r,{cN:"id",b:/\#[A-Za-z0-9_-]+/},{cN:"class",b:/\.[A-Za-z0-9_-]+/},{cN:"attr_selector",b:/\[/,e:/\]/,i:"$"},{cN:"pseudo",b:/:(:)?[a-zA-Z0-9\_\-\+\(\)"']+/},{cN:"at_rule",b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{cN:"at_rule",b:"@",e:"[{;]",c:[{cN:"keyword",b:/\S+/},{b:/\s/,eW:!0,eE:!0,r:0,c:[a,e.ASM,e.QSM,e.CSSNM]}]},{cN:"tag",b:c,r:0},{cN:"rules",b:"{",e:"}",i:/\S/,c:[e.CBCM,r]}]}});hljs.registerLanguage("json",function(e){var t={literal:"true false null"},i=[e.QSM,e.CNM],l={cN:"value",e:",",eW:!0,eE:!0,c:i,k:t},c={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:!0,eE:!0,c:[e.BE],i:"\\n",starts:l}],i:"\\S"},n={b:"\\[",e:"\\]",c:[e.inherit(l,{cN:null})],i:"\\S"};return i.splice(i.length,0,c,n),{c:i,k:t,i:"\\S"}});hljs.registerLanguage("xml",function(t){var e="[A-Za-z0-9\\._:-]+",s={b:/<\?(php)?(?!\w)/,e:/\?>/,sL:"php",subLanguageMode:"continuous"},c={eW:!0,i:/,r:0,c:[s,{cN:"attribute",b:e,r:0},{b:"=",r:0,c:[{cN:"value",c:[s],v:[{b:/"/,e:/"/},{b:/'/,e:/'/},{b:/[^\s\/>]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xsl","plist"],cI:!0,c:[{cN:"doctype",b:"",r:10,c:[{b:"\\[",e:"\\]"}]},t.C("",{r:10}),{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"",rE:!0,sL:"css"}},{cN:"tag",b:"",rE:!0,sL:""}},s,{cN:"pi",b:/<\?\w+/,e:/\?>/,r:10},{cN:"tag",b:"?",e:"/?>",c:[{cN:"title",b:/[^ \/><\n\t]+/,r:0},c]}]}});hljs.registerLanguage("bash",function(e){var t={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)}/}]},s={cN:"string",b:/"/,e:/"/,c:[e.BE,t,{cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]}]},a={cN:"string",b:/'/,e:/'/};return{aliases:["sh","zsh"],l:/-?[a-z\.]+/,k:{keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",operator:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"shebang",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:!0,c:[e.inherit(e.TM,{b:/\w[\w\d_]*/})],r:0},e.HCM,e.NM,s,a,t]}});
\ No newline at end of file
diff --git a/src/public/Leaflet-1.7.1/docs/docs/highlight/styles/github-gist.css b/src/public/Leaflet-1.7.1/docs/docs/highlight/styles/github-gist.css
new file mode 100644
index 0000000..a5bef16
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/docs/highlight/styles/github-gist.css
@@ -0,0 +1,211 @@
+/**
+ * GitHub Gist Theme
+ * Author : Louis Barranqueiro - https://github.com/LouisBarranqueiro
+ */
+
+.hljs {
+ display: block;
+ background:#f8f8f8;
+ padding: 0.5em;
+ color: #333333;
+ overflow-x: auto;
+ -webkit-text-size-adjust: none;
+}
+
+.hljs-comment,
+.bash .hljs-shebang,
+.java .hljs-javadoc,
+.javascript .hljs-javadoc {
+ color: #969896;
+}
+
+.hljs-string,
+.apache .hljs-sqbracket,
+.coffeescript .hljs-subst,
+.coffeescript .hljs-regexp,
+.cpp .hljs-preprocessor,
+.c .hljs-preprocessor,
+.javascript .hljs-regexp,
+.json .hljs-attribute,
+.makefile .hljs-variable,
+.markdown .hljs-value,
+.markdown .hljs-link_label,
+.markdown .hljs-strong,
+.markdown .hljs-emphasis,
+.markdown .hljs-blockquote,
+.nginx .hljs-regexp,
+.nginx .hljs-number,
+.objectivec .hljs-preprocessor .hljs-title,
+.perl .hljs-regexp,
+.php .hljs-regexp,
+.xml .hljs-value,
+.less .hljs-built_in,
+.scss .hljs-built_in {
+ color: #df5000;
+}
+
+.hljs-keyword,
+.css .hljs-at_rule,
+.css .hljs-important,
+.http .hljs-request,
+.ini .hljs-setting,
+.java .hljs-javadoctag,
+.javascript .hljs-tag,
+.javascript .hljs-javadoctag,
+.nginx .hljs-title,
+.objectivec .hljs-preprocessor,
+.php .hljs-phpdoc,
+.sql .hljs-built_in,
+.less .hljs-tag,
+.less .hljs-at_rule,
+.scss .hljs-tag,
+.scss .hljs-at_rule,
+.scss .hljs-important,
+.stylus .hljs-at_rule,
+.go .hljs-typename,
+.swift .hljs-preprocessor {
+ color: #a71d5d;
+}
+
+.apache .hljs-common,
+.apache .hljs-cbracket,
+.apache .hljs-keyword,
+.bash .hljs-literal,
+.bash .hljs-built_in,
+.coffeescript .hljs-literal,
+.coffeescript .hljs-built_in,
+.coffeescript .hljs-number,
+.cpp .hljs-number,
+.cpp .hljs-built_in,
+.c .hljs-number,
+.c .hljs-built_in,
+.cs .hljs-number,
+.cs .hljs-built_in,
+.css .hljs-attribute,
+.css .hljs-hexcolor,
+.css .hljs-number,
+.css .hljs-function,
+.http .hljs-literal,
+.http .hljs-attribute,
+.java .hljs-number,
+.javascript .hljs-built_in,
+.javascript .hljs-literal,
+.javascript .hljs-number,
+.json .hljs-number,
+.makefile .hljs-keyword,
+.markdown .hljs-link_reference,
+.nginx .hljs-built_in,
+.objectivec .hljs-literal,
+.objectivec .hljs-number,
+.objectivec .hljs-built_in,
+.php .hljs-literal,
+.php .hljs-number,
+.python .hljs-number,
+.ruby .hljs-prompt,
+.ruby .hljs-constant,
+.ruby .hljs-number,
+.ruby .hljs-subst .hljs-keyword,
+.ruby .hljs-symbol,
+.sql .hljs-number,
+.puppet .hljs-function,
+.less .hljs-number,
+.less .hljs-hexcolor,
+.less .hljs-function,
+.less .hljs-attribute,
+.scss .hljs-preprocessor,
+.scss .hljs-number,
+.scss .hljs-hexcolor,
+.scss .hljs-function,
+.scss .hljs-attribute,
+.stylus .hljs-number,
+.stylus .hljs-hexcolor,
+.stylus .hljs-attribute,
+.stylus .hljs-params,
+.go .hljs-built_in,
+.go .hljs-constant,
+.swift .hljs-built_in,
+.swift .hljs-number {
+ color: #0086b3;
+}
+
+.apache .hljs-tag,
+.cs .hljs-xmlDocTag,
+.css .hljs-tag,
+.xml .hljs-title,
+.stylus .hljs-tag {
+ color: #63a35c;
+}
+
+.bash .hljs-variable,
+.cs .hljs-preprocessor,
+.cs .hljs-preprocessor .hljs-keyword,
+.css .hljs-attr_selector,
+.css .hljs-value,
+.ini .hljs-value,
+.ini .hljs-keyword,
+.javascript .hljs-tag .hljs-title,
+.makefile .hljs-constant,
+.nginx .hljs-variable,
+.xml .hljs-tag,
+.scss .hljs-variable {
+ color: #333333;
+}
+
+.bash .hljs-title,
+.coffeescript .hljs-title,
+.cpp .hljs-title,
+.c .hljs-title,
+.cs .hljs-title,
+.css .hljs-id,
+.css .hljs-class,
+.css .hljs-pseudo,
+.ini .hljs-title,
+.java .hljs-title,
+.javascript .hljs-title,
+.makefile .hljs-title,
+.objectivec .hljs-title,
+.perl .hljs-sub,
+.php .hljs-title,
+.python .hljs-decorator,
+.python .hljs-title,
+.ruby .hljs-parent,
+.ruby .hljs-title,
+.xml .hljs-attribute,
+.puppet .hljs-title,
+.less .hljs-id,
+.less .hljs-pseudo,
+.less .hljs-class,
+.scss .hljs-id,
+.scss .hljs-pseudo,
+.scss .hljs-class,
+.stylus .hljs-class,
+.stylus .hljs-id,
+.stylus .hljs-pseudo,
+.stylus .hljs-title,
+.swift .hljs-title,
+.diff .hljs-chunk {
+ color: #795da3;
+}
+
+.coffeescript .hljs-reserved,
+.coffeescript .hljs-attribute {
+ color: #1d3e81;
+}
+
+.diff .hljs-chunk {
+ font-weight: bold;
+}
+
+.diff .hljs-addition {
+ color: #55a532;
+ background-color: #eaffea;
+}
+
+.diff .hljs-deletion {
+ color: #bd2c00;
+ background-color: #ffecec;
+}
+
+.markdown .hljs-link_url {
+ text-decoration: underline;
+}
diff --git a/src/public/Leaflet-1.7.1/docs/docs/images/2016-03-20-prosthetic-hand-zooming.gif b/src/public/Leaflet-1.7.1/docs/docs/images/2016-03-20-prosthetic-hand-zooming.gif
new file mode 100644
index 0000000..638dacc
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/docs/images/2016-03-20-prosthetic-hand-zooming.gif differ
diff --git a/src/public/Leaflet-1.7.1/docs/docs/images/2016-04-18-inheritances.gif b/src/public/Leaflet-1.7.1/docs/docs/images/2016-04-18-inheritances.gif
new file mode 100644
index 0000000..1fc54fa
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/docs/images/2016-04-18-inheritances.gif differ
diff --git a/src/public/Leaflet-1.7.1/docs/docs/images/2016-04-18-leaflet-toilet-paper.jpeg b/src/public/Leaflet-1.7.1/docs/docs/images/2016-04-18-leaflet-toilet-paper.jpeg
new file mode 100644
index 0000000..16d8c2d
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/docs/images/2016-04-18-leaflet-toilet-paper.jpeg differ
diff --git a/src/public/Leaflet-1.7.1/docs/docs/images/2016-04-18-madrid-leaflet-864px.jpg b/src/public/Leaflet-1.7.1/docs/docs/images/2016-04-18-madrid-leaflet-864px.jpg
new file mode 100644
index 0000000..0e41f03
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/docs/images/2016-04-18-madrid-leaflet-864px.jpg differ
diff --git a/src/public/Leaflet-1.7.1/docs/docs/images/2016-07-18-remote-session.png b/src/public/Leaflet-1.7.1/docs/docs/images/2016-07-18-remote-session.png
new file mode 100644
index 0000000..9f55069
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/docs/images/2016-07-18-remote-session.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/docs/images/2016-07-18-tooltip.png b/src/public/Leaflet-1.7.1/docs/docs/images/2016-07-18-tooltip.png
new file mode 100644
index 0000000..57f27f9
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/docs/images/2016-07-18-tooltip.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/docs/images/2016-08-03-iraq-hacking.jpg b/src/public/Leaflet-1.7.1/docs/docs/images/2016-08-03-iraq-hacking.jpg
new file mode 100644
index 0000000..091e022
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/docs/images/2016-08-03-iraq-hacking.jpg differ
diff --git a/src/public/Leaflet-1.7.1/docs/docs/images/favicon.ico b/src/public/Leaflet-1.7.1/docs/docs/images/favicon.ico
new file mode 100644
index 0000000..6081400
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/docs/images/favicon.ico differ
diff --git a/src/public/Leaflet-1.7.1/docs/docs/images/forum-round.png b/src/public/Leaflet-1.7.1/docs/docs/images/forum-round.png
new file mode 100644
index 0000000..937fe14
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/docs/images/forum-round.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/docs/images/github-round.png b/src/public/Leaflet-1.7.1/docs/docs/images/github-round.png
new file mode 100644
index 0000000..d31078b
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/docs/images/github-round.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/docs/images/logo.png b/src/public/Leaflet-1.7.1/docs/docs/images/logo.png
new file mode 100644
index 0000000..27a0f10
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/docs/images/logo.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/docs/images/logos.png b/src/public/Leaflet-1.7.1/docs/docs/images/logos.png
new file mode 100644
index 0000000..bbe01a4
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/docs/images/logos.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/docs/images/sprite.png b/src/public/Leaflet-1.7.1/docs/docs/images/sprite.png
new file mode 100644
index 0000000..9ad7a10
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/docs/images/sprite.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/docs/images/sprite.svg b/src/public/Leaflet-1.7.1/docs/docs/images/sprite.svg
new file mode 100644
index 0000000..522d0a4
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/docs/images/sprite.svg
@@ -0,0 +1 @@
+image/svg+xml
\ No newline at end of file
diff --git a/src/public/Leaflet-1.7.1/docs/docs/images/twitter-round.png b/src/public/Leaflet-1.7.1/docs/docs/images/twitter-round.png
new file mode 100644
index 0000000..0d875de
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/docs/images/twitter-round.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/docs/images/twitter.png b/src/public/Leaflet-1.7.1/docs/docs/images/twitter.png
new file mode 100644
index 0000000..d9f18dc
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/docs/images/twitter.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/docs/js/docs.js b/src/public/Leaflet-1.7.1/docs/docs/js/docs.js
new file mode 100644
index 0000000..72fd397
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/docs/js/docs.js
@@ -0,0 +1,56 @@
+/* global hljs */
+hljs.configure({tabReplace: ' '});
+hljs.initHighlighting();
+
+var tocCopy = document.createElement('div');
+tocCopy.id = 'toc-copy';
+
+var toc = document.querySelector('#toc');
+
+if (toc) {
+ tocCopy.innerHTML = toc.innerHTML;
+ document.getElementsByClassName('container')[0].appendChild(tocCopy);
+
+ var menus = document.querySelectorAll('#toc-copy ul');
+ var i;
+
+ for (i = 0; i < menus.length; i++) {
+ menus[i].addEventListener('mouseover', function () {
+ this.previousElementSibling.classList.add('hover');
+ });
+
+ menus[i].addEventListener('mouseout', function () {
+ this.previousElementSibling.classList.remove('hover');
+ });
+ }
+
+ var labels = document.querySelectorAll('#toc-copy h4');
+
+ for (i = 0; i < labels.length; i++) {
+ labels[i].addEventListener('click', function () {
+ this.classList.toggle('active');
+ });
+ }
+
+ tocCopy.addEventListener('click', function (e) {
+ if (e.target.nodeName !== 'H4') {
+ this.classList.toggle('active');
+ }
+ });
+
+ var scrollPos = function scrollPos() {
+ var scroll = window.scrollY;
+
+ if (scroll >= (toc.offsetHeight + toc.offsetTop)) {
+ document.body.classList.add('scrolled');
+ } else {
+ document.body.classList.remove('scrolled');
+ }
+ };
+
+ scrollPos();
+
+ window.addEventListener('scroll', function () {
+ scrollPos();
+ });
+}
diff --git a/src/public/Leaflet-1.7.1/docs/docs/js/reference.js b/src/public/Leaflet-1.7.1/docs/docs/js/reference.js
new file mode 100644
index 0000000..a1b0524
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/docs/js/reference.js
@@ -0,0 +1,49 @@
+if (document.body.className.indexOf('api-page') !== -1) {
+
+ var elems = document.querySelectorAll('h2, h3, h4, tr');
+
+ for (var i = 0, len = elems.length; i < len; i++) {
+ var el = elems[i];
+
+ if (el.id) {
+ var anchor = document.createElement('a');
+ anchor.setAttribute('anchor', el.id);
+ if (!el.children.length) {
+ // For headers, insert the anchor before.
+ el.parentNode.insertBefore(anchor, el);
+ } else {
+ // For table rows, insert the anchor inside the first
+ el.querySelector('td').appendChild(anchor);
+
+ // Clicking on the row (meaning "the link icon on the ::before)
+ // jumps to the item
+ el.parentNode.onclick = function () {
+ return function (ev) {
+ if (ev.offsetX < 0) {
+ window.location.hash = '#' + ev.target.parentNode.id;
+ }
+ };
+ }(el.id);
+ }
+ }
+ }
+
+ elems = document.querySelectorAll('div.accordion');
+ for (i = 0, len = elems.length; i < len; i++) {
+ el = elems[i];
+
+ el.querySelector('label').addEventListener('click', function (c) {
+ return function () {
+ if (c.className === 'accordion expanded') {
+ c.className = 'accordion collapsed';
+ } else {
+ c.className = 'accordion expanded';
+ }
+ };
+ }(el));
+
+ // el.className = 'accordion collapsed';
+ // el.querySelector('.accordion-content').style.display = 'none';
+ }
+
+}
diff --git a/src/public/Leaflet-1.7.1/docs/download.md b/src/public/Leaflet-1.7.1/docs/download.md
new file mode 100644
index 0000000..bef0b7e
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/download.md
@@ -0,0 +1,100 @@
+---
+layout: v2
+title: Download
+bodyclass: download-page
+---
+
+## Download Leaflet
+
+
+
+ Version
+ Description
+
+
+ Leaflet 1.6.0
+ Stable version, released on November 17, 2019.
+
+
+ Leaflet 1.7-dev
+ In-progress version, developed on the master branch.
+
+
+ Leaflet 0.7.7
+ Legacy version, released on November 18, 2013 and last updated on October 26, 2015.
+
+
+
+[View Changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md)
+
+Note that the master version can contain incompatible changes,
+so please read the changelog carefully when upgrading to it.
+
+[Get notified of new Leaflet releases](https://github.com/Leaflet/Leaflet/issues/6295)
+
+### Using a Hosted Version of Leaflet
+
+The latest stable Leaflet release is available on several CDN's — to start using
+it straight away, place this in the `head` of your HTML code:
+
+
+
+
+To avoid potential security problems, we recommend and encourage enabling
+[subresource integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity)
+when using Leaflet from a CDN:
+
+
+
+
+Leaflet is available on the following free CDN's: [unpkg](https://unpkg.com/leaflet/dist/), [cdnjs](https://cdnjs.com/libraries/leaflet), [jsDelivr](https://www.jsdelivr.com/package/npm/leaflet?path=dist)
+
+_Disclaimer: these services are external to Leaflet; for questions or support, please contact them directly._
+
+### Using a Downloaded Version of Leaflet
+
+Inside the archives downloaded from the above links, you will see four things:
+
+- `leaflet.js` - This is the minified Leaflet JavaScript code.
+- `leaflet-src.js` - This is the readable, unminified Leaflet JavaScript, which is sometimes helpful for debugging. (The integrity hash for this file is {{site.integrity_hash_source}} )
+- `leaflet.css` - This is the stylesheet for Leaflet.
+- `images` - This is a folder that contains images referenced by `leaflet.css`. It must be in the same directory as `leaflet.css`.
+
+Unzip the downloaded archive to your website's directory and add this to the `head` of your HTML code:
+
+
+
+
+### Using a JavaScript package manager
+
+If you use the [`npm` package manager](https://www.npmjs.com/), you can fetch a local copy of Leaflet by running:
+
+ npm install leaflet
+
+You will find a copy of the Leaflet release files in `node_modules/leaflet/dist`.
+
+### Leaflet Source Code
+
+These download packages above only contain the library itself.
+If you want to download the full source code, including unit tests, files for debugging, build scripts, etc.,
+you can download it
+from the GitHub repository .
+
+### Building Leaflet from the Source
+
+Leaflet build system is powered by the [Node.js](http://nodejs.org) platform,
+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 command in the command line:
+
+ npm install
+
+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.
+
diff --git a/src/public/Leaflet-1.7.1/docs/edit.html b/src/public/Leaflet-1.7.1/docs/edit.html
new file mode 100644
index 0000000..17e9118
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/edit.html
@@ -0,0 +1,110 @@
+
+
+
+
+ Leaflet edit
+
+
+
+
+
\ No newline at end of file
diff --git a/src/public/Leaflet-1.7.1/docs/examples.md b/src/public/Leaflet-1.7.1/docs/examples.md
new file mode 100644
index 0000000..7ed8a7e
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples.md
@@ -0,0 +1,125 @@
+---
+layout: v2
+title: Tutorials
+bodyclass: examples
+---
+
+## Leaflet Tutorials
+
+Every tutorial here comes with step-by-step code explanation and is easy enough even for beginner JavaScript developers.
+
+
+{% include tutorial_link.html
+page="quick-start/"
+thumbnail="quick-start/thumbnail.png"
+title="Leaflet Quick Start Guide"
+description="A simple step-by-step guide that will quickly get you started with Leaflet basics, including setting up a Leaflet map (with Mapbox tiles) on your page, working with markers, polylines and popups, and dealing with events."
+%}
+
+
+{% include tutorial_link.html
+page="mobile/"
+thumbnail="mobile/thumbnail.png"
+title="Leaflet on Mobile"
+description="In this tutorial, you'll learn how to create a fullscreen map tuned for mobile devices like iPhone, iPad or Android phones, and how to easily detect and use the current user location."
+%}
+
+
+{% include tutorial_link.html
+page="custom-icons/"
+thumbnail="custom-icons/thumbnail.png"
+title="Markers with Custom Icons"
+description="In this pretty tutorial, you'll learn how to easily define your own icons for use by the markers you put on the map."
+%}
+
+
+{% include tutorial_link.html
+page="geojson/"
+thumbnail="geojson/thumbnail.png"
+title="Using GeoJSON with Leaflet"
+description="In this tutorial, you'll learn how to create and interact with map vectors created from [GeoJSON](http://geojson.org/) objects."
+%}
+
+
+{% include tutorial_link.html
+page="choropleth/"
+thumbnail="choropleth/thumbnail.png"
+title="Interactive Choropleth Map"
+description="A case study of creating a colorful interactive [choropleth map](http://en.wikipedia.org/wiki/Choropleth_map) of US States Population Density with GeoJSON and some custom controls. News websites will love this."
+%}
+
+
+{% include tutorial_link.html
+page="layers-control/"
+thumbnail="layers-control/thumbnail.png"
+title="Layer Groups and Layers Control"
+description="A tutorial on how to manage groups of layers and use the layer switching control."
+%}
+
+
+{% include tutorial_link.html
+page="zoom-levels/"
+thumbnail="zoom-levels/thumbnail.png"
+title="Zoom levels"
+description="A deeper look into what zoom levels are."
+%}
+
+{% include tutorial_link.html
+page="crs-simple/crs-simple.html"
+thumbnail="crs-simple/thumbnail.png"
+title="Non-geographical maps"
+description="A primer on `L.CRS.Simple`, how to make maps with no concept of \"latitude\" or \"longitude\"."
+%}
+
+
+{% include tutorial_link.html
+page="wms/wms.html"
+thumbnail="wms/thumbnail.png"
+title="WMS and TMS"
+description="How to integrate with WMS and TMS services from professional GIS software."
+%}
+
+
+{% include tutorial_link.html
+page="map-panes/"
+thumbnail="map-panes/thumbnail.png"
+title="Working with map panes"
+description="How the default map panes work to display overlays on top of tiles, and how to override that."
+%}
+
+
+{% include tutorial_link.html
+page="video-overlay/"
+thumbnail="video-overlay/thumbnail.gif"
+title="Showing video files"
+description="Leaflet can help you display videos somewhere on the map."
+%}
+
+***
+
+The following tutorials cover how to create plugins for Leaflet, and are intended only for developers experienced in JavaScript:
+
+
+{% include tutorial_link.html
+page="extending/extending-1-classes.html"
+thumbnail="extending/thumbnail-1.png"
+title="Extending Leaflet: Class Theory"
+description="An overview of Leaflet's classes, class inheritance, and conventions."
+%}
+
+
+{% include tutorial_link.html
+page="extending/extending-2-layers.html"
+thumbnail="extending/thumbnail-2.png"
+title="Extending Leaflet: Layers"
+description="How to extend layers or create new ones, using specific entry points for doing so."
+%}
+
+
+{% include tutorial_link.html
+page="extending/extending-3-controls.html"
+thumbnail="extending/thumbnail-3.png"
+title="Extending Leaflet: Handlers and Controls"
+description="How to extend or create non-layers."
+%}
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/choropleth-example.md b/src/public/Leaflet-1.7.1/docs/examples/choropleth-example.md
new file mode 100644
index 0000000..c1be126
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/choropleth-example.md
@@ -0,0 +1,5 @@
+---
+layout: redirected
+sitemap: false
+redirect_to: choropleth/example.html
+---
diff --git a/src/public/Leaflet-1.7.1/docs/examples/choropleth.md b/src/public/Leaflet-1.7.1/docs/examples/choropleth.md
new file mode 100644
index 0000000..090943a
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/choropleth.md
@@ -0,0 +1,5 @@
+---
+layout: redirected
+sitemap: false
+redirect_to: choropleth/
+---
diff --git a/src/public/Leaflet-1.7.1/docs/examples/choropleth/example-basic.md b/src/public/Leaflet-1.7.1/docs/examples/choropleth/example-basic.md
new file mode 100644
index 0000000..6b32fd8
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/choropleth/example-basic.md
@@ -0,0 +1,22 @@
+---
+layout: tutorial_frame
+title: Choropleth Tutorial
+---
+
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/choropleth/example-color.md b/src/public/Leaflet-1.7.1/docs/examples/choropleth/example-color.md
new file mode 100644
index 0000000..67b5778
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/choropleth/example-color.md
@@ -0,0 +1,48 @@
+---
+layout: tutorial_frame
+title: Choropleth Tutorial
+---
+
+
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/choropleth/example.md b/src/public/Leaflet-1.7.1/docs/examples/choropleth/example.md
new file mode 100644
index 0000000..0f07f86
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/choropleth/example.md
@@ -0,0 +1,161 @@
+---
+layout: tutorial_frame
+title: Choropleth Tutorial
+css: "#map {
+ width: 800px;
+ height: 500px;
+ }
+
+ .info {
+ padding: 6px 8px;
+ font: 14px/16px Arial, Helvetica, sans-serif;
+ background: white;
+ background: rgba(255,255,255,0.8);
+ box-shadow: 0 0 15px rgba(0,0,0,0.2);
+ border-radius: 5px;
+ }
+ .info h4 {
+ margin: 0 0 5px;
+ color: #777;
+ }
+
+ .legend {
+ text-align: left;
+ line-height: 18px;
+ color: #555;
+ }
+ .legend i {
+ width: 18px;
+ height: 18px;
+ float: left;
+ margin-right: 8px;
+ opacity: 0.7;
+ }"
+---
+
+
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/choropleth/index.md b/src/public/Leaflet-1.7.1/docs/examples/choropleth/index.md
new file mode 100644
index 0000000..7cec4c8
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/choropleth/index.md
@@ -0,0 +1,232 @@
+---
+layout: tutorial_v2
+title: Interactive Choropleth Map
+---
+
+## Interactive Choropleth Map
+
+This is a case study of creating a colorful interactive [choropleth map](http://en.wikipedia.org/wiki/Choropleth_map) of US States Population Density with the help of [GeoJSON](../geojson/) and some [custom controls](/reference.html#control) (that will hopefully convince all the remaining major news and government websites that do not use Leaflet yet to start doing so).
+
+The tutorial was inspired by the [Texas Tribune US Senate Runoff Results map](http://www.texastribune.org/library/data/us-senate-runoff-results-map/) (also powered by Leaflet), created by [Ryan Murphy](http://www.texastribune.org/about/staff/ryan-murphy/).
+
+{% include frame.html url="example.html" width=816 height=516 %}
+
+### Data Source
+
+We'll be creating a visualization of population density per US state. As the amount of data (state shapes and the density value for each state) is not very big, the most convenient and simple way to store and then display it is [GeoJSON](../geojson/).
+
+Each feature of our GeoJSON data ([us-states.js](us-states.js)) will look like this:
+
+ {
+ "type": "Feature",
+ "properties": {
+ "name": "Alabama",
+ "density": 94.65
+ },
+ "geometry": ...
+ ...
+ }
+
+The GeoJSON with state shapes was kindly shared by [Mike Bostock](http://bost.ocks.org/mike) of [D3](http://d3js.org/) fame, extended with density values from [this Wikipedia article](http://en.wikipedia.org/wiki/List_of_U.S._states_by_population_density) based on July 1st 2011 data from [US Census Bureau](http://www.census.gov/) and assigned to `statesData` JS variable.
+
+### Basic States Map
+
+Let's display our states data on a map with a custom Mapbox style for nice grayscale tiles that look perfect as a background for visualizations:
+
+ var mapboxAccessToken = {your access token here};
+ var map = L.map('map').setView([37.8, -96], 4);
+
+ L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=' + mapboxAccessToken, {
+ id: 'mapbox/light-v9',
+ attribution: ...,
+ tileSize: 512,
+ zoomOffset: -1
+ }).addTo(map);
+
+ L.geoJson(statesData).addTo(map);
+
+{% include frame.html url="example-basic.html" %}
+
+
+### Adding Some Color
+
+Now we need to color the states according to their population density. Choosing nice colors for a map can be tricky, but there's a great tool that can help with it --- [ColorBrewer](http://colorbrewer2.org/). Using the values we got from it, we create a function that returns a color based on population density:
+
+ function getColor(d) {
+ return d > 1000 ? '#800026' :
+ d > 500 ? '#BD0026' :
+ d > 200 ? '#E31A1C' :
+ d > 100 ? '#FC4E2A' :
+ d > 50 ? '#FD8D3C' :
+ d > 20 ? '#FEB24C' :
+ d > 10 ? '#FED976' :
+ '#FFEDA0';
+ }
+
+Next we define a styling function for our GeoJSON layer so that its `fillColor` depends on `feature.properties.density` property, also adjusting the appearance a bit and adding a nice touch with dashed stroke.
+
+ function style(feature) {
+ return {
+ fillColor: getColor(feature.properties.density),
+ weight: 2,
+ opacity: 1,
+ color: 'white',
+ dashArray: '3',
+ fillOpacity: 0.7
+ };
+ }
+
+ L.geoJson(statesData, {style: style}).addTo(map);
+
+Looks much better now!
+
+{% include frame.html url="example-color.html" %}
+
+
+### Adding Interaction
+
+Now let's make the states highlighted visually in some way when they are hovered with a mouse. First we'll define an event listener for layer `mouseover` event:
+
+ function highlightFeature(e) {
+ var layer = e.target;
+
+ layer.setStyle({
+ weight: 5,
+ color: '#666',
+ dashArray: '',
+ fillOpacity: 0.7
+ });
+
+ if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {
+ layer.bringToFront();
+ }
+ }
+
+Here we get access to the layer that was hovered through `e.target`, set a thick grey border on the layer as our highlight effect, also bringing it to the front so that the border doesn't clash with nearby states (but not for IE, Opera or Edge, since they have problems doing `bringToFront` on `mouseover`).
+
+Next we'll define what happens on `mouseout`:
+
+ function resetHighlight(e) {
+ geojson.resetStyle(e.target);
+ }
+
+The handy `geojson.resetStyle` method will reset the layer style to its default state (defined by our `style` function). For this to work, make sure our GeoJSON layer is accessible through the `geojson` variable by defining it before our listeners and assigning the layer to it later:
+
+ var geojson;
+ // ... our listeners
+ geojson = L.geoJson(...);
+
+As an additional touch, let's define a `click` listener that zooms to the state:
+
+ function zoomToFeature(e) {
+ map.fitBounds(e.target.getBounds());
+ }
+
+Now we'll use the `onEachFeature` option to add the listeners on our state layers:
+
+ function onEachFeature(feature, layer) {
+ layer.on({
+ mouseover: highlightFeature,
+ mouseout: resetHighlight,
+ click: zoomToFeature
+ });
+ }
+
+ geojson = L.geoJson(statesData, {
+ style: style,
+ onEachFeature: onEachFeature
+ }).addTo(map);
+
+This makes the states highlight nicely on hover and gives us the ability to add other interactions inside our listeners.
+
+### Custom Info Control
+
+We could use the usual popups on click to show information about different states, but we'll choose a different route --- showing it on state hover inside a [custom control](/reference.html#control).
+
+Here's the code for our control:
+
+ var info = L.control();
+
+ info.onAdd = function (map) {
+ this._div = L.DomUtil.create('div', 'info'); // create a div with a class "info"
+ this.update();
+ return this._div;
+ };
+
+ // method that we will use to update the control based on feature properties passed
+ info.update = function (props) {
+ this._div.innerHTML = 'US Population Density ' + (props ?
+ '' + props.name + ' ' + props.density + ' people / mi2 '
+ : 'Hover over a state');
+ };
+
+ info.addTo(map);
+
+We need to update the control when the user hovers over a state, so we'll also modify our listeners as follows:
+
+ function highlightFeature(e) {
+ ...
+ info.update(layer.feature.properties);
+ }
+
+ function resetHighlight(e) {
+ ...
+ info.update();
+ }
+
+The control also needs some CSS styles to look nice:
+
+{: .css}
+ .info {
+ padding: 6px 8px;
+ font: 14px/16px Arial, Helvetica, sans-serif;
+ background: white;
+ background: rgba(255,255,255,0.8);
+ box-shadow: 0 0 15px rgba(0,0,0,0.2);
+ border-radius: 5px;
+ }
+ .info h4 {
+ margin: 0 0 5px;
+ color: #777;
+ }
+
+### Custom Legend Control
+
+Creating a control with a legend is easier, since it is static and doesn't change on state hover. JavaScript code:
+
+ var legend = L.control({position: 'bottomright'});
+
+ legend.onAdd = function (map) {
+
+ var div = L.DomUtil.create('div', 'info legend'),
+ grades = [0, 10, 20, 50, 100, 200, 500, 1000],
+ labels = [];
+
+ // loop through our density intervals and generate a label with a colored square for each interval
+ for (var i = 0; i < grades.length; i++) {
+ div.innerHTML +=
+ ' ' +
+ grades[i] + (grades[i + 1] ? '–' + grades[i + 1] + ' ' : '+');
+ }
+
+ return div;
+ };
+
+ legend.addTo(map);
+
+CSS styles for the control (we also reuse the `info` class defined earlier):
+
+{: .css}
+ .legend {
+ line-height: 18px;
+ color: #555;
+ }
+ .legend i {
+ width: 18px;
+ height: 18px;
+ float: left;
+ margin-right: 8px;
+ opacity: 0.7;
+ }
+
+Enjoy the result on the top of this page, or on a [separate page](example.html).
diff --git a/src/public/Leaflet-1.7.1/docs/examples/choropleth/thumbnail.png b/src/public/Leaflet-1.7.1/docs/examples/choropleth/thumbnail.png
new file mode 100644
index 0000000..ee53dd2
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/examples/choropleth/thumbnail.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/examples/choropleth/us-states.js b/src/public/Leaflet-1.7.1/docs/examples/choropleth/us-states.js
new file mode 100644
index 0000000..7f6af2f
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/choropleth/us-states.js
@@ -0,0 +1,54 @@
+var statesData = {"type":"FeatureCollection","features":[
+{"type":"Feature","id":"01","properties":{"name":"Alabama","density":94.65},"geometry":{"type":"Polygon","coordinates":[[[-87.359296,35.00118],[-85.606675,34.984749],[-85.431413,34.124869],[-85.184951,32.859696],[-85.069935,32.580372],[-84.960397,32.421541],[-85.004212,32.322956],[-84.889196,32.262709],[-85.058981,32.13674],[-85.053504,32.01077],[-85.141136,31.840985],[-85.042551,31.539753],[-85.113751,31.27686],[-85.004212,31.003013],[-85.497137,30.997536],[-87.600282,30.997536],[-87.633143,30.86609],[-87.408589,30.674397],[-87.446927,30.510088],[-87.37025,30.427934],[-87.518128,30.280057],[-87.655051,30.247195],[-87.90699,30.411504],[-87.934375,30.657966],[-88.011052,30.685351],[-88.10416,30.499135],[-88.137022,30.318396],[-88.394438,30.367688],[-88.471115,31.895754],[-88.241084,33.796253],[-88.098683,34.891641],[-88.202745,34.995703],[-87.359296,35.00118]]]}},
+{"type":"Feature","id":"02","properties":{"name":"Alaska","density":1.264},"geometry":{"type":"MultiPolygon","coordinates":[[[[-131.602021,55.117982],[-131.569159,55.28229],[-131.355558,55.183705],[-131.38842,55.01392],[-131.645836,55.035827],[-131.602021,55.117982]]],[[[-131.832052,55.42469],[-131.645836,55.304197],[-131.749898,55.128935],[-131.832052,55.189182],[-131.832052,55.42469]]],[[[-132.976733,56.437924],[-132.735747,56.459832],[-132.631685,56.421493],[-132.664547,56.273616],[-132.878148,56.240754],[-133.069841,56.333862],[-132.976733,56.437924]]],[[[-133.595627,56.350293],[-133.162949,56.317431],[-133.05341,56.125739],[-132.620732,55.912138],[-132.472854,55.780691],[-132.4619,55.671152],[-132.357838,55.649245],[-132.341408,55.506844],[-132.166146,55.364444],[-132.144238,55.238474],[-132.029222,55.276813],[-131.97993,55.178228],[-131.958022,54.789365],[-132.029222,54.701734],[-132.308546,54.718165],[-132.385223,54.915335],[-132.483808,54.898904],[-132.686455,55.046781],[-132.746701,54.997489],[-132.916486,55.046781],[-132.889102,54.898904],[-132.73027,54.937242],[-132.626209,54.882473],[-132.675501,54.679826],[-132.867194,54.701734],[-133.157472,54.95915],[-133.239626,55.090597],[-133.223195,55.22752],[-133.453227,55.216566],[-133.453227,55.320628],[-133.277964,55.331582],[-133.102702,55.42469],[-133.17938,55.588998],[-133.387503,55.62186],[-133.420365,55.884753],[-133.497042,56.0162],[-133.639442,55.923092],[-133.694212,56.070969],[-133.546335,56.142169],[-133.666827,56.311955],[-133.595627,56.350293]]],[[[-133.738027,55.556137],[-133.546335,55.490413],[-133.414888,55.572568],[-133.283441,55.534229],[-133.420365,55.386352],[-133.633966,55.430167],[-133.738027,55.556137]]],[[[-133.907813,56.930849],[-134.050213,57.029434],[-133.885905,57.095157],[-133.343688,57.002049],[-133.102702,57.007526],[-132.932917,56.82131],[-132.620732,56.667956],[-132.653593,56.55294],[-132.817901,56.492694],[-133.042456,56.520078],[-133.201287,56.448878],[-133.420365,56.492694],[-133.66135,56.448878],[-133.710643,56.684386],[-133.688735,56.837741],[-133.869474,56.843218],[-133.907813,56.930849]]],[[[-134.115936,56.48174],[-134.25286,56.558417],[-134.400737,56.722725],[-134.417168,56.848695],[-134.296675,56.908941],[-134.170706,56.848695],[-134.143321,56.952757],[-133.748981,56.772017],[-133.710643,56.596755],[-133.847566,56.574848],[-133.935197,56.377678],[-133.836612,56.322908],[-133.957105,56.092877],[-134.110459,56.142169],[-134.132367,55.999769],[-134.230952,56.070969],[-134.291198,56.350293],[-134.115936,56.48174]]],[[[-134.636246,56.28457],[-134.669107,56.169554],[-134.806031,56.235277],[-135.178463,56.67891],[-135.413971,56.810356],[-135.331817,56.914418],[-135.424925,57.166357],[-135.687818,57.369004],[-135.419448,57.566174],[-135.298955,57.48402],[-135.063447,57.418296],[-134.849846,57.407343],[-134.844369,57.248511],[-134.636246,56.728202],[-134.636246,56.28457]]],[[[-134.712923,58.223407],[-134.373353,58.14673],[-134.176183,58.157683],[-134.187137,58.081006],[-133.902336,57.807159],[-134.099505,57.850975],[-134.148798,57.757867],[-133.935197,57.615466],[-133.869474,57.363527],[-134.083075,57.297804],[-134.154275,57.210173],[-134.499322,57.029434],[-134.603384,57.034911],[-134.6472,57.226604],[-134.575999,57.341619],[-134.608861,57.511404],[-134.729354,57.719528],[-134.707446,57.829067],[-134.784123,58.097437],[-134.91557,58.212453],[-134.953908,58.409623],[-134.712923,58.223407]]],[[[-135.857603,57.330665],[-135.715203,57.330665],[-135.567326,57.149926],[-135.633049,57.023957],[-135.857603,56.996572],[-135.824742,57.193742],[-135.857603,57.330665]]],[[[-136.279328,58.206976],[-135.978096,58.201499],[-135.780926,58.28913],[-135.496125,58.168637],[-135.64948,58.037191],[-135.59471,57.987898],[-135.45231,58.135776],[-135.107263,58.086483],[-134.91557,57.976944],[-135.025108,57.779775],[-134.937477,57.763344],[-134.822462,57.500451],[-135.085355,57.462112],[-135.572802,57.675713],[-135.556372,57.456635],[-135.709726,57.369004],[-135.890465,57.407343],[-136.000004,57.544266],[-136.208128,57.637374],[-136.366959,57.829067],[-136.569606,57.916698],[-136.558652,58.075529],[-136.421728,58.130299],[-136.377913,58.267222],[-136.279328,58.206976]]],[[[-147.079854,60.200582],[-147.501579,59.948643],[-147.53444,59.850058],[-147.874011,59.784335],[-147.80281,59.937689],[-147.435855,60.09652],[-147.205824,60.271782],[-147.079854,60.200582]]],[[[-147.561825,60.578491],[-147.616594,60.370367],[-147.758995,60.156767],[-147.956165,60.227967],[-147.791856,60.474429],[-147.561825,60.578491]]],[[[-147.786379,70.245291],[-147.682318,70.201475],[-147.162008,70.15766],[-146.888161,70.185044],[-146.510252,70.185044],[-146.099482,70.146706],[-145.858496,70.168614],[-145.622988,70.08646],[-145.195787,69.993352],[-144.620708,69.971444],[-144.461877,70.026213],[-144.078491,70.059075],[-143.914183,70.130275],[-143.497935,70.141229],[-143.503412,70.091936],[-143.25695,70.119321],[-142.747594,70.042644],[-142.402547,69.916674],[-142.079408,69.856428],[-142.008207,69.801659],[-141.712453,69.790705],[-141.433129,69.697597],[-141.378359,69.63735],[-141.208574,69.686643],[-141.00045,69.648304],[-141.00045,60.304644],[-140.53491,60.22249],[-140.474664,60.310121],[-139.987216,60.184151],[-139.696939,60.342983],[-139.088998,60.359413],[-139.198537,60.091043],[-139.045183,59.997935],[-138.700135,59.910304],[-138.623458,59.767904],[-137.604747,59.242118],[-137.445916,58.908024],[-137.265177,59.001132],[-136.827022,59.159963],[-136.580559,59.16544],[-136.465544,59.285933],[-136.476498,59.466672],[-136.301236,59.466672],[-136.25742,59.625503],[-135.945234,59.663842],[-135.479694,59.800766],[-135.025108,59.565257],[-135.068924,59.422857],[-134.959385,59.280456],[-134.701969,59.247595],[-134.378829,59.033994],[-134.400737,58.973748],[-134.25286,58.858732],[-133.842089,58.727285],[-133.173903,58.152206],[-133.075318,57.998852],[-132.867194,57.845498],[-132.560485,57.505928],[-132.253777,57.21565],[-132.368792,57.095157],[-132.05113,57.051341],[-132.127807,56.876079],[-131.870391,56.804879],[-131.837529,56.602232],[-131.580113,56.613186],[-131.087188,56.405062],[-130.78048,56.366724],[-130.621648,56.268139],[-130.468294,56.240754],[-130.424478,56.142169],[-130.101339,56.114785],[-130.002754,55.994292],[-130.150631,55.769737],[-130.128724,55.583521],[-129.986323,55.276813],[-130.095862,55.200136],[-130.336847,54.920812],[-130.687372,54.718165],[-130.785957,54.822227],[-130.917403,54.789365],[-131.010511,54.997489],[-130.983126,55.08512],[-131.092665,55.189182],[-130.862634,55.298721],[-130.928357,55.337059],[-131.158389,55.200136],[-131.284358,55.287767],[-131.426759,55.238474],[-131.843006,55.457552],[-131.700606,55.698537],[-131.963499,55.616383],[-131.974453,55.49589],[-132.182576,55.588998],[-132.226392,55.704014],[-132.083991,55.829984],[-132.127807,55.955953],[-132.324977,55.851892],[-132.522147,56.076446],[-132.642639,56.032631],[-132.719317,56.218847],[-132.527624,56.339339],[-132.341408,56.339339],[-132.396177,56.487217],[-132.297592,56.67891],[-132.450946,56.673433],[-132.768609,56.837741],[-132.993164,57.034911],[-133.51895,57.177311],[-133.507996,57.577128],[-133.677781,57.62642],[-133.639442,57.790728],[-133.814705,57.834544],[-134.072121,58.053622],[-134.143321,58.168637],[-134.586953,58.206976],[-135.074401,58.502731],[-135.282525,59.192825],[-135.38111,59.033994],[-135.337294,58.891593],[-135.140124,58.617746],[-135.189417,58.573931],[-135.05797,58.349376],[-135.085355,58.201499],[-135.277048,58.234361],[-135.430402,58.398669],[-135.633049,58.426053],[-135.91785,58.382238],[-135.912373,58.617746],[-136.087635,58.814916],[-136.246466,58.75467],[-136.876314,58.962794],[-136.931084,58.902547],[-136.586036,58.836824],[-136.317666,58.672516],[-136.213604,58.667039],[-136.180743,58.535592],[-136.043819,58.382238],[-136.388867,58.294607],[-136.591513,58.349376],[-136.59699,58.212453],[-136.859883,58.316515],[-136.947514,58.393192],[-137.111823,58.393192],[-137.566409,58.590362],[-137.900502,58.765624],[-137.933364,58.869686],[-138.11958,59.02304],[-138.634412,59.132579],[-138.919213,59.247595],[-139.417615,59.379041],[-139.746231,59.505011],[-139.718846,59.641934],[-139.625738,59.598119],[-139.5162,59.68575],[-139.625738,59.88292],[-139.488815,59.992458],[-139.554538,60.041751],[-139.801,59.833627],[-140.315833,59.696704],[-140.92925,59.745996],[-141.444083,59.871966],[-141.46599,59.970551],[-141.706976,59.948643],[-141.964392,60.019843],[-142.539471,60.085566],[-142.873564,60.091043],[-143.623905,60.036274],[-143.892275,59.997935],[-144.231845,60.140336],[-144.65357,60.206059],[-144.785016,60.29369],[-144.834309,60.441568],[-145.124586,60.430614],[-145.223171,60.299167],[-145.738004,60.474429],[-145.820158,60.551106],[-146.351421,60.408706],[-146.608837,60.238921],[-146.718376,60.397752],[-146.608837,60.485383],[-146.455483,60.463475],[-145.951604,60.578491],[-146.017328,60.666122],[-146.252836,60.622307],[-146.345944,60.737322],[-146.565022,60.753753],[-146.784099,61.044031],[-146.866253,60.972831],[-147.172962,60.934492],[-147.271547,60.972831],[-147.375609,60.879723],[-147.758995,60.912584],[-147.775426,60.808523],[-148.032842,60.781138],[-148.153334,60.819476],[-148.065703,61.005692],[-148.175242,61.000215],[-148.350504,60.803046],[-148.109519,60.737322],[-148.087611,60.594922],[-147.939734,60.441568],[-148.027365,60.277259],[-148.219058,60.332029],[-148.273827,60.249875],[-148.087611,60.217013],[-147.983549,59.997935],[-148.251919,59.95412],[-148.399797,59.997935],[-148.635305,59.937689],[-148.755798,59.986981],[-149.067984,59.981505],[-149.05703,60.063659],[-149.204907,60.008889],[-149.287061,59.904827],[-149.418508,59.997935],[-149.582816,59.866489],[-149.511616,59.806242],[-149.741647,59.729565],[-149.949771,59.718611],[-150.031925,59.61455],[-150.25648,59.521442],[-150.409834,59.554303],[-150.579619,59.444764],[-150.716543,59.450241],[-151.001343,59.225687],[-151.308052,59.209256],[-151.406637,59.280456],[-151.592853,59.159963],[-151.976239,59.253071],[-151.888608,59.422857],[-151.636669,59.483103],[-151.47236,59.472149],[-151.423068,59.537872],[-151.127313,59.669319],[-151.116359,59.778858],[-151.505222,59.63098],[-151.828361,59.718611],[-151.8667,59.778858],[-151.702392,60.030797],[-151.423068,60.211536],[-151.379252,60.359413],[-151.297098,60.386798],[-151.264237,60.545629],[-151.406637,60.720892],[-151.06159,60.786615],[-150.404357,61.038554],[-150.245526,60.939969],[-150.042879,60.912584],[-149.741647,61.016646],[-150.075741,61.15357],[-150.207187,61.257632],[-150.47008,61.246678],[-150.656296,61.29597],[-150.711066,61.252155],[-151.023251,61.180954],[-151.165652,61.044031],[-151.477837,61.011169],[-151.800977,60.852338],[-151.833838,60.748276],[-152.080301,60.693507],[-152.13507,60.578491],[-152.310332,60.507291],[-152.392486,60.304644],[-152.732057,60.173197],[-152.567748,60.069136],[-152.704672,59.915781],[-153.022334,59.888397],[-153.049719,59.691227],[-153.345474,59.620026],[-153.438582,59.702181],[-153.586459,59.548826],[-153.761721,59.543349],[-153.72886,59.433811],[-154.117723,59.368087],[-154.1944,59.066856],[-153.750768,59.050425],[-153.400243,58.968271],[-153.301658,58.869686],[-153.444059,58.710854],[-153.679567,58.612269],[-153.898645,58.606793],[-153.920553,58.519161],[-154.062953,58.4863],[-153.99723,58.376761],[-154.145107,58.212453],[-154.46277,58.059098],[-154.643509,58.059098],[-154.818771,58.004329],[-154.988556,58.015283],[-155.120003,57.955037],[-155.081664,57.872883],[-155.328126,57.829067],[-155.377419,57.708574],[-155.547204,57.785251],[-155.73342,57.549743],[-156.045606,57.566174],[-156.023698,57.440204],[-156.209914,57.473066],[-156.34136,57.418296],[-156.34136,57.248511],[-156.549484,56.985618],[-156.883577,56.952757],[-157.157424,56.832264],[-157.20124,56.766541],[-157.376502,56.859649],[-157.672257,56.607709],[-157.754411,56.67891],[-157.918719,56.657002],[-157.957058,56.514601],[-158.126843,56.459832],[-158.32949,56.48174],[-158.488321,56.339339],[-158.208997,56.295524],[-158.510229,55.977861],[-159.375585,55.873799],[-159.616571,55.594475],[-159.676817,55.654722],[-159.643955,55.829984],[-159.813741,55.857368],[-160.027341,55.791645],[-160.060203,55.720445],[-160.394296,55.605429],[-160.536697,55.473983],[-160.580512,55.567091],[-160.668143,55.457552],[-160.865313,55.528752],[-161.232268,55.358967],[-161.506115,55.364444],[-161.467776,55.49589],[-161.588269,55.62186],[-161.697808,55.517798],[-161.686854,55.408259],[-162.053809,55.074166],[-162.179779,55.15632],[-162.218117,55.03035],[-162.470057,55.052258],[-162.508395,55.249428],[-162.661749,55.293244],[-162.716519,55.222043],[-162.579595,55.134412],[-162.645319,54.997489],[-162.847965,54.926289],[-163.00132,55.079643],[-163.187536,55.090597],[-163.220397,55.03035],[-163.034181,54.942719],[-163.373752,54.800319],[-163.14372,54.76198],[-163.138243,54.696257],[-163.329936,54.74555],[-163.587352,54.614103],[-164.085754,54.61958],[-164.332216,54.531949],[-164.354124,54.466226],[-164.638925,54.389548],[-164.847049,54.416933],[-164.918249,54.603149],[-164.710125,54.663395],[-164.551294,54.88795],[-164.34317,54.893427],[-163.894061,55.041304],[-163.532583,55.046781],[-163.39566,54.904381],[-163.291598,55.008443],[-163.313505,55.128935],[-163.105382,55.183705],[-162.880827,55.183705],[-162.579595,55.446598],[-162.245502,55.682106],[-161.807347,55.89023],[-161.292514,55.983338],[-161.078914,55.939523],[-160.87079,55.999769],[-160.816021,55.912138],[-160.931036,55.813553],[-160.805067,55.736876],[-160.766728,55.857368],[-160.509312,55.868322],[-160.438112,55.791645],[-160.27928,55.76426],[-160.273803,55.857368],[-160.536697,55.939523],[-160.558604,55.994292],[-160.383342,56.251708],[-160.147834,56.399586],[-159.830171,56.541986],[-159.326293,56.667956],[-158.959338,56.848695],[-158.784076,56.782971],[-158.641675,56.810356],[-158.701922,56.925372],[-158.658106,57.034911],[-158.378782,57.264942],[-157.995396,57.41282],[-157.688688,57.609989],[-157.705118,57.719528],[-157.458656,58.497254],[-157.07527,58.705377],[-157.119086,58.869686],[-158.039212,58.634177],[-158.32949,58.661562],[-158.40069,58.760147],[-158.564998,58.803962],[-158.619768,58.913501],[-158.767645,58.864209],[-158.860753,58.694424],[-158.701922,58.480823],[-158.893615,58.387715],[-159.0634,58.420577],[-159.392016,58.760147],[-159.616571,58.929932],[-159.731586,58.929932],[-159.808264,58.803962],[-159.906848,58.782055],[-160.054726,58.886116],[-160.235465,58.902547],[-160.317619,59.072332],[-160.854359,58.88064],[-161.33633,58.743716],[-161.374669,58.667039],[-161.752577,58.552023],[-161.938793,58.656085],[-161.769008,58.776578],[-161.829255,59.061379],[-161.955224,59.36261],[-161.703285,59.48858],[-161.911409,59.740519],[-162.092148,59.88292],[-162.234548,60.091043],[-162.448149,60.178674],[-162.502918,59.997935],[-162.760334,59.959597],[-163.171105,59.844581],[-163.66403,59.795289],[-163.9324,59.806242],[-164.162431,59.866489],[-164.189816,60.02532],[-164.386986,60.074613],[-164.699171,60.29369],[-164.962064,60.337506],[-165.268773,60.578491],[-165.060649,60.68803],[-165.016834,60.890677],[-165.175665,60.846861],[-165.197573,60.972831],[-165.120896,61.076893],[-165.323543,61.170001],[-165.34545,61.071416],[-165.591913,61.109754],[-165.624774,61.279539],[-165.816467,61.301447],[-165.920529,61.416463],[-165.915052,61.558863],[-166.106745,61.49314],[-166.139607,61.630064],[-165.904098,61.662925],[-166.095791,61.81628],[-165.756221,61.827233],[-165.756221,62.013449],[-165.674067,62.139419],[-165.044219,62.539236],[-164.912772,62.659728],[-164.819664,62.637821],[-164.874433,62.807606],[-164.633448,63.097884],[-164.425324,63.212899],[-164.036462,63.262192],[-163.73523,63.212899],[-163.313505,63.037637],[-163.039658,63.059545],[-162.661749,63.22933],[-162.272887,63.486746],[-162.075717,63.514131],[-162.026424,63.448408],[-161.555408,63.448408],[-161.13916,63.503177],[-160.766728,63.771547],[-160.766728,63.837271],[-160.952944,64.08921],[-160.974852,64.237087],[-161.26513,64.395918],[-161.374669,64.532842],[-161.078914,64.494503],[-160.79959,64.609519],[-160.783159,64.719058],[-161.144637,64.921705],[-161.413007,64.762873],[-161.664946,64.790258],[-161.900455,64.702627],[-162.168825,64.680719],[-162.234548,64.620473],[-162.541257,64.532842],[-162.634365,64.384965],[-162.787719,64.324718],[-162.858919,64.49998],[-163.045135,64.538319],[-163.176582,64.401395],[-163.253259,64.467119],[-163.598306,64.565704],[-164.304832,64.560227],[-164.80871,64.450688],[-165.000403,64.434257],[-165.411174,64.49998],[-166.188899,64.576658],[-166.391546,64.636904],[-166.484654,64.735489],[-166.413454,64.872412],[-166.692778,64.987428],[-166.638008,65.113398],[-166.462746,65.179121],[-166.517516,65.337952],[-166.796839,65.337952],[-167.026871,65.381768],[-167.47598,65.414629],[-167.711489,65.496784],[-168.072967,65.578938],[-168.105828,65.682999],[-167.541703,65.819923],[-166.829701,66.049954],[-166.3313,66.186878],[-166.046499,66.110201],[-165.756221,66.09377],[-165.690498,66.203309],[-165.86576,66.21974],[-165.88219,66.312848],[-165.186619,66.466202],[-164.403417,66.581218],[-163.981692,66.592172],[-163.751661,66.553833],[-163.872153,66.389525],[-163.828338,66.274509],[-163.915969,66.192355],[-163.768091,66.060908],[-163.494244,66.082816],[-163.149197,66.060908],[-162.749381,66.088293],[-162.634365,66.039001],[-162.371472,66.028047],[-162.14144,66.077339],[-161.840208,66.02257],[-161.549931,66.241647],[-161.341807,66.252601],[-161.199406,66.208786],[-161.128206,66.334755],[-161.528023,66.395002],[-161.911409,66.345709],[-161.87307,66.510017],[-162.174302,66.68528],[-162.502918,66.740049],[-162.601503,66.89888],[-162.344087,66.937219],[-162.015471,66.778388],[-162.075717,66.652418],[-161.916886,66.553833],[-161.571838,66.438817],[-161.489684,66.55931],[-161.884024,66.718141],[-161.714239,67.002942],[-161.851162,67.052235],[-162.240025,66.991988],[-162.639842,67.008419],[-162.700088,67.057712],[-162.902735,67.008419],[-163.740707,67.128912],[-163.757138,67.254881],[-164.009077,67.534205],[-164.211724,67.638267],[-164.534863,67.725898],[-165.192096,67.966884],[-165.493328,68.059992],[-165.794559,68.081899],[-166.243668,68.246208],[-166.681824,68.339316],[-166.703731,68.372177],[-166.375115,68.42147],[-166.227238,68.574824],[-166.216284,68.881533],[-165.329019,68.859625],[-164.255539,68.930825],[-163.976215,68.985595],[-163.532583,69.138949],[-163.110859,69.374457],[-163.023228,69.609966],[-162.842489,69.812613],[-162.470057,69.982398],[-162.311225,70.108367],[-161.851162,70.311014],[-161.779962,70.256245],[-161.396576,70.239814],[-160.837928,70.343876],[-160.487404,70.453415],[-159.649432,70.792985],[-159.33177,70.809416],[-159.298908,70.760123],[-158.975769,70.798462],[-158.658106,70.787508],[-158.033735,70.831323],[-157.420318,70.979201],[-156.812377,71.285909],[-156.565915,71.351633],[-156.522099,71.296863],[-155.585543,71.170894],[-155.508865,71.083263],[-155.832005,70.968247],[-155.979882,70.96277],[-155.974405,70.809416],[-155.503388,70.858708],[-155.476004,70.940862],[-155.262403,71.017539],[-155.191203,70.973724],[-155.032372,71.148986],[-154.566832,70.990155],[-154.643509,70.869662],[-154.353231,70.8368],[-154.183446,70.7656],[-153.931507,70.880616],[-153.487874,70.886093],[-153.235935,70.924431],[-152.589656,70.886093],[-152.26104,70.842277],[-152.419871,70.606769],[-151.817408,70.546523],[-151.773592,70.486276],[-151.187559,70.382214],[-151.182082,70.431507],[-150.760358,70.49723],[-150.355064,70.491753],[-150.349588,70.436984],[-150.114079,70.431507],[-149.867617,70.508184],[-149.462323,70.519138],[-149.177522,70.486276],[-148.78866,70.404122],[-148.607921,70.420553],[-148.350504,70.305537],[-148.202627,70.349353],[-147.961642,70.316491],[-147.786379,70.245291]]],[[[-152.94018,58.026237],[-152.945657,57.982421],[-153.290705,58.048145],[-153.044242,58.305561],[-152.819688,58.327469],[-152.666333,58.562977],[-152.496548,58.354853],[-152.354148,58.426053],[-152.080301,58.311038],[-152.080301,58.152206],[-152.480117,58.130299],[-152.655379,58.059098],[-152.94018,58.026237]]],[[[-153.958891,57.538789],[-153.67409,57.670236],[-153.931507,57.69762],[-153.936983,57.812636],[-153.723383,57.889313],[-153.570028,57.834544],[-153.548121,57.719528],[-153.46049,57.796205],[-153.455013,57.96599],[-153.268797,57.889313],[-153.235935,57.998852],[-153.071627,57.933129],[-152.874457,57.933129],[-152.721103,57.993375],[-152.469163,57.889313],[-152.469163,57.599035],[-152.151501,57.620943],[-152.359625,57.42925],[-152.74301,57.505928],[-152.60061,57.379958],[-152.710149,57.275896],[-152.907319,57.325188],[-152.912796,57.128019],[-153.214027,57.073249],[-153.312612,56.991095],[-153.498828,57.067772],[-153.695998,56.859649],[-153.849352,56.837741],[-154.013661,56.744633],[-154.073907,56.969187],[-154.303938,56.848695],[-154.314892,56.919895],[-154.523016,56.991095],[-154.539447,57.193742],[-154.742094,57.275896],[-154.627078,57.511404],[-154.227261,57.659282],[-153.980799,57.648328],[-153.958891,57.538789]]],[[[-154.53397,56.602232],[-154.742094,56.399586],[-154.807817,56.432447],[-154.53397,56.602232]]],[[[-155.634835,55.923092],[-155.476004,55.912138],[-155.530773,55.704014],[-155.793666,55.731399],[-155.837482,55.802599],[-155.634835,55.923092]]],[[[-159.890418,55.28229],[-159.950664,55.068689],[-160.257373,54.893427],[-160.109495,55.161797],[-160.005433,55.134412],[-159.890418,55.28229]]],[[[-160.520266,55.358967],[-160.33405,55.358967],[-160.339527,55.249428],[-160.525743,55.128935],[-160.690051,55.211089],[-160.794113,55.134412],[-160.854359,55.320628],[-160.79959,55.380875],[-160.520266,55.358967]]],[[[-162.256456,54.981058],[-162.234548,54.893427],[-162.349564,54.838658],[-162.437195,54.931766],[-162.256456,54.981058]]],[[[-162.415287,63.634624],[-162.563165,63.536039],[-162.612457,63.62367],[-162.415287,63.634624]]],[[[-162.80415,54.488133],[-162.590549,54.449795],[-162.612457,54.367641],[-162.782242,54.373118],[-162.80415,54.488133]]],[[[-165.548097,54.29644],[-165.476897,54.181425],[-165.630251,54.132132],[-165.685021,54.252625],[-165.548097,54.29644]]],[[[-165.73979,54.15404],[-166.046499,54.044501],[-166.112222,54.121178],[-165.980775,54.219763],[-165.73979,54.15404]]],[[[-166.364161,60.359413],[-166.13413,60.397752],[-166.084837,60.326552],[-165.88219,60.342983],[-165.685021,60.277259],[-165.646682,59.992458],[-165.750744,59.89935],[-166.00816,59.844581],[-166.062929,59.745996],[-166.440838,59.855535],[-166.6161,59.850058],[-166.994009,59.992458],[-167.125456,59.992458],[-167.344534,60.074613],[-167.421211,60.206059],[-167.311672,60.238921],[-166.93924,60.206059],[-166.763978,60.310121],[-166.577762,60.321075],[-166.495608,60.392275],[-166.364161,60.359413]]],[[[-166.375115,54.01164],[-166.210807,53.934962],[-166.5449,53.748746],[-166.539423,53.715885],[-166.117699,53.852808],[-166.112222,53.776131],[-166.282007,53.683023],[-166.555854,53.622777],[-166.583239,53.529669],[-166.878994,53.431084],[-167.13641,53.425607],[-167.306195,53.332499],[-167.623857,53.250345],[-167.793643,53.337976],[-167.459549,53.442038],[-167.355487,53.425607],[-167.103548,53.513238],[-167.163794,53.611823],[-167.021394,53.715885],[-166.807793,53.666592],[-166.785886,53.732316],[-167.015917,53.754223],[-167.141887,53.825424],[-167.032348,53.945916],[-166.643485,54.017116],[-166.561331,53.880193],[-166.375115,54.01164]]],[[[-168.790446,53.157237],[-168.40706,53.34893],[-168.385152,53.431084],[-168.237275,53.524192],[-168.007243,53.568007],[-167.886751,53.518715],[-167.842935,53.387268],[-168.270136,53.244868],[-168.500168,53.036744],[-168.686384,52.965544],[-168.790446,53.157237]]],[[[-169.74891,52.894344],[-169.705095,52.795759],[-169.962511,52.790282],[-169.989896,52.856005],[-169.74891,52.894344]]],[[[-170.148727,57.221127],[-170.28565,57.128019],[-170.313035,57.221127],[-170.148727,57.221127]]],[[[-170.669036,52.697174],[-170.603313,52.604066],[-170.789529,52.538343],[-170.816914,52.636928],[-170.669036,52.697174]]],[[[-171.742517,63.716778],[-170.94836,63.5689],[-170.488297,63.69487],[-170.280174,63.683916],[-170.093958,63.612716],[-170.044665,63.492223],[-169.644848,63.4265],[-169.518879,63.366254],[-168.99857,63.338869],[-168.686384,63.295053],[-168.856169,63.147176],[-169.108108,63.180038],[-169.376478,63.152653],[-169.513402,63.08693],[-169.639372,62.939052],[-169.831064,63.075976],[-170.055619,63.169084],[-170.263743,63.180038],[-170.362328,63.2841],[-170.866206,63.415546],[-171.101715,63.421023],[-171.463193,63.306007],[-171.73704,63.366254],[-171.852055,63.486746],[-171.742517,63.716778]]],[[[-172.432611,52.390465],[-172.41618,52.275449],[-172.607873,52.253542],[-172.569535,52.352127],[-172.432611,52.390465]]],[[[-173.626584,52.14948],[-173.495138,52.105664],[-173.122706,52.111141],[-173.106275,52.07828],[-173.549907,52.028987],[-173.626584,52.14948]]],[[[-174.322156,52.280926],[-174.327632,52.379511],[-174.185232,52.41785],[-173.982585,52.319265],[-174.059262,52.226157],[-174.179755,52.231634],[-174.141417,52.127572],[-174.333109,52.116618],[-174.738403,52.007079],[-174.968435,52.039941],[-174.902711,52.116618],[-174.656249,52.105664],[-174.322156,52.280926]]],[[[-176.469116,51.853725],[-176.288377,51.870156],[-176.288377,51.744186],[-176.518409,51.760617],[-176.80321,51.61274],[-176.912748,51.80991],[-176.792256,51.815386],[-176.775825,51.963264],[-176.627947,51.968741],[-176.627947,51.859202],[-176.469116,51.853725]]],[[[-177.153734,51.946833],[-177.044195,51.897541],[-177.120872,51.727755],[-177.274226,51.678463],[-177.279703,51.782525],[-177.153734,51.946833]]],[[[-178.123152,51.919448],[-177.953367,51.913971],[-177.800013,51.793479],[-177.964321,51.651078],[-178.123152,51.919448]]],[[[-187.107557,52.992929],[-187.293773,52.927205],[-187.304726,52.823143],[-188.90491,52.762897],[-188.642017,52.927205],[-188.642017,53.003883],[-187.107557,52.992929]]]]}},
+{"type":"Feature","id":"04","properties":{"name":"Arizona","density":57.05},"geometry":{"type":"Polygon","coordinates":[[[-109.042503,37.000263],[-109.04798,31.331629],[-111.074448,31.331629],[-112.246513,31.704061],[-114.815198,32.492741],[-114.72209,32.717295],[-114.524921,32.755634],[-114.470151,32.843265],[-114.524921,33.029481],[-114.661844,33.034958],[-114.727567,33.40739],[-114.524921,33.54979],[-114.497536,33.697668],[-114.535874,33.933176],[-114.415382,34.108438],[-114.256551,34.174162],[-114.136058,34.305608],[-114.333228,34.448009],[-114.470151,34.710902],[-114.634459,34.87521],[-114.634459,35.00118],[-114.574213,35.138103],[-114.596121,35.324319],[-114.678275,35.516012],[-114.738521,36.102045],[-114.371566,36.140383],[-114.251074,36.01989],[-114.152489,36.025367],[-114.048427,36.195153],[-114.048427,37.000263],[-110.499369,37.00574],[-109.042503,37.000263]]]}},
+{"type":"Feature","id":"05","properties":{"name":"Arkansas","density":56.43},"geometry":{"type":"Polygon","coordinates":[[[-94.473842,36.501861],[-90.152536,36.496384],[-90.064905,36.304691],[-90.218259,36.184199],[-90.377091,35.997983],[-89.730812,35.997983],[-89.763673,35.811767],[-89.911551,35.756997],[-89.944412,35.603643],[-90.130628,35.439335],[-90.114197,35.198349],[-90.212782,35.023087],[-90.311367,34.995703],[-90.251121,34.908072],[-90.409952,34.831394],[-90.481152,34.661609],[-90.585214,34.617794],[-90.568783,34.420624],[-90.749522,34.365854],[-90.744046,34.300131],[-90.952169,34.135823],[-90.891923,34.026284],[-91.072662,33.867453],[-91.231493,33.560744],[-91.056231,33.429298],[-91.143862,33.347144],[-91.089093,33.13902],[-91.16577,33.002096],[-93.608485,33.018527],[-94.041164,33.018527],[-94.041164,33.54979],[-94.183564,33.593606],[-94.380734,33.544313],[-94.484796,33.637421],[-94.430026,35.395519],[-94.616242,36.501861],[-94.473842,36.501861]]]}},
+{"type":"Feature","id":"06","properties":{"name":"California","density":241.7},"geometry":{"type":"Polygon","coordinates":[[[-123.233256,42.006186],[-122.378853,42.011663],[-121.037003,41.995232],[-120.001861,41.995232],[-119.996384,40.264519],[-120.001861,38.999346],[-118.71478,38.101128],[-117.498899,37.21934],[-116.540435,36.501861],[-115.85034,35.970598],[-114.634459,35.00118],[-114.634459,34.87521],[-114.470151,34.710902],[-114.333228,34.448009],[-114.136058,34.305608],[-114.256551,34.174162],[-114.415382,34.108438],[-114.535874,33.933176],[-114.497536,33.697668],[-114.524921,33.54979],[-114.727567,33.40739],[-114.661844,33.034958],[-114.524921,33.029481],[-114.470151,32.843265],[-114.524921,32.755634],[-114.72209,32.717295],[-116.04751,32.624187],[-117.126467,32.536556],[-117.24696,32.668003],[-117.252437,32.876127],[-117.329114,33.122589],[-117.471515,33.297851],[-117.7837,33.538836],[-118.183517,33.763391],[-118.260194,33.703145],[-118.413548,33.741483],[-118.391641,33.840068],[-118.566903,34.042715],[-118.802411,33.998899],[-119.218659,34.146777],[-119.278905,34.26727],[-119.558229,34.415147],[-119.875891,34.40967],[-120.138784,34.475393],[-120.472878,34.448009],[-120.64814,34.579455],[-120.609801,34.858779],[-120.670048,34.902595],[-120.631709,35.099764],[-120.894602,35.247642],[-120.905556,35.450289],[-121.004141,35.461243],[-121.168449,35.636505],[-121.283465,35.674843],[-121.332757,35.784382],[-121.716143,36.195153],[-121.896882,36.315645],[-121.935221,36.638785],[-121.858544,36.6114],[-121.787344,36.803093],[-121.929744,36.978355],[-122.105006,36.956447],[-122.335038,37.115279],[-122.417192,37.241248],[-122.400761,37.361741],[-122.515777,37.520572],[-122.515777,37.783465],[-122.329561,37.783465],[-122.406238,38.15042],[-122.488392,38.112082],[-122.504823,37.931343],[-122.701993,37.893004],[-122.937501,38.029928],[-122.97584,38.265436],[-123.129194,38.451652],[-123.331841,38.566668],[-123.44138,38.698114],[-123.737134,38.95553],[-123.687842,39.032208],[-123.824765,39.366301],[-123.764519,39.552517],[-123.85215,39.831841],[-124.109566,40.105688],[-124.361506,40.259042],[-124.410798,40.439781],[-124.158859,40.877937],[-124.109566,41.025814],[-124.158859,41.14083],[-124.065751,41.442061],[-124.147905,41.715908],[-124.257444,41.781632],[-124.213628,42.000709],[-123.233256,42.006186]]]}},
+{"type":"Feature","id":"08","properties":{"name":"Colorado","density":49.33},"geometry":{"type":"Polygon","coordinates":[[[-107.919731,41.003906],[-105.728954,40.998429],[-104.053011,41.003906],[-102.053927,41.003906],[-102.053927,40.001626],[-102.042974,36.994786],[-103.001438,37.000263],[-104.337812,36.994786],[-106.868158,36.994786],[-107.421329,37.000263],[-109.042503,37.000263],[-109.042503,38.166851],[-109.058934,38.27639],[-109.053457,39.125316],[-109.04798,40.998429],[-107.919731,41.003906]]]}},
+{"type":"Feature","id":"09","properties":{"name":"Connecticut","density":739.1},"geometry":{"type":"Polygon","coordinates":[[[-73.053528,42.039048],[-71.799309,42.022617],[-71.799309,42.006186],[-71.799309,41.414677],[-71.859555,41.321569],[-71.947186,41.338],[-72.385341,41.261322],[-72.905651,41.28323],[-73.130205,41.146307],[-73.371191,41.102491],[-73.655992,40.987475],[-73.727192,41.102491],[-73.48073,41.21203],[-73.55193,41.294184],[-73.486206,42.050002],[-73.053528,42.039048]]]}},
+{"type":"Feature","id":"10","properties":{"name":"Delaware","density":464.3},"geometry":{"type":"Polygon","coordinates":[[[-75.414089,39.804456],[-75.507197,39.683964],[-75.611259,39.61824],[-75.589352,39.459409],[-75.441474,39.311532],[-75.403136,39.065069],[-75.189535,38.807653],[-75.09095,38.796699],[-75.047134,38.451652],[-75.693413,38.462606],[-75.786521,39.722302],[-75.616736,39.831841],[-75.414089,39.804456]]]}},
+{"type":"Feature","id":"11","properties":{"name":"District of Columbia","density":10065},"geometry":{"type":"Polygon","coordinates":[[[-77.035264,38.993869],[-76.909294,38.895284],[-77.040741,38.791222],[-77.117418,38.933623],[-77.035264,38.993869]]]}},
+{"type":"Feature","id":"12","properties":{"name":"Florida","density":353.4},"geometry":{"type":"Polygon","coordinates":[[[-85.497137,30.997536],[-85.004212,31.003013],[-84.867289,30.712735],[-83.498053,30.647012],[-82.216449,30.570335],[-82.167157,30.356734],[-82.046664,30.362211],[-82.002849,30.564858],[-82.041187,30.751074],[-81.948079,30.827751],[-81.718048,30.745597],[-81.444201,30.707258],[-81.383954,30.27458],[-81.257985,29.787132],[-80.967707,29.14633],[-80.524075,28.461713],[-80.589798,28.41242],[-80.56789,28.094758],[-80.381674,27.738757],[-80.091397,27.021277],[-80.03115,26.796723],[-80.036627,26.566691],[-80.146166,25.739673],[-80.239274,25.723243],[-80.337859,25.465826],[-80.304997,25.383672],[-80.49669,25.197456],[-80.573367,25.241272],[-80.759583,25.164595],[-81.077246,25.120779],[-81.170354,25.224841],[-81.126538,25.378195],[-81.351093,25.821827],[-81.526355,25.903982],[-81.679709,25.843735],[-81.800202,26.090198],[-81.833064,26.292844],[-82.041187,26.517399],[-82.09048,26.665276],[-82.057618,26.878877],[-82.172634,26.917216],[-82.145249,26.791246],[-82.249311,26.758384],[-82.566974,27.300601],[-82.692943,27.437525],[-82.391711,27.837342],[-82.588881,27.815434],[-82.720328,27.689464],[-82.851774,27.886634],[-82.676512,28.434328],[-82.643651,28.888914],[-82.764143,28.998453],[-82.802482,29.14633],[-82.994175,29.179192],[-83.218729,29.420177],[-83.399469,29.518762],[-83.410422,29.66664],[-83.536392,29.721409],[-83.640454,29.885717],[-84.02384,30.104795],[-84.357933,30.055502],[-84.341502,29.902148],[-84.451041,29.929533],[-84.867289,29.743317],[-85.310921,29.699501],[-85.299967,29.80904],[-85.404029,29.940487],[-85.924338,30.236241],[-86.29677,30.362211],[-86.630863,30.395073],[-86.910187,30.373165],[-87.518128,30.280057],[-87.37025,30.427934],[-87.446927,30.510088],[-87.408589,30.674397],[-87.633143,30.86609],[-87.600282,30.997536],[-85.497137,30.997536]]]}},
+{"type":"Feature","id":"13","properties":{"name":"Georgia","density":169.5},"geometry":{"type":"Polygon","coordinates":[[[-83.109191,35.00118],[-83.322791,34.787579],[-83.339222,34.683517],[-83.005129,34.469916],[-82.901067,34.486347],[-82.747713,34.26727],[-82.714851,34.152254],[-82.55602,33.94413],[-82.325988,33.81816],[-82.194542,33.631944],[-81.926172,33.462159],[-81.937125,33.347144],[-81.761863,33.160928],[-81.493493,33.007573],[-81.42777,32.843265],[-81.416816,32.629664],[-81.279893,32.558464],[-81.121061,32.290094],[-81.115584,32.120309],[-80.885553,32.032678],[-81.132015,31.693108],[-81.175831,31.517845],[-81.279893,31.364491],[-81.290846,31.20566],[-81.400385,31.13446],[-81.444201,30.707258],[-81.718048,30.745597],[-81.948079,30.827751],[-82.041187,30.751074],[-82.002849,30.564858],[-82.046664,30.362211],[-82.167157,30.356734],[-82.216449,30.570335],[-83.498053,30.647012],[-84.867289,30.712735],[-85.004212,31.003013],[-85.113751,31.27686],[-85.042551,31.539753],[-85.141136,31.840985],[-85.053504,32.01077],[-85.058981,32.13674],[-84.889196,32.262709],[-85.004212,32.322956],[-84.960397,32.421541],[-85.069935,32.580372],[-85.184951,32.859696],[-85.431413,34.124869],[-85.606675,34.984749],[-84.319594,34.990226],[-83.618546,34.984749],[-83.109191,35.00118]]]}},
+{"type":"Feature","id":"15","properties":{"name":"Hawaii","density":214.1},"geometry":{"type":"MultiPolygon","coordinates":[[[[-155.634835,18.948267],[-155.881297,19.035898],[-155.919636,19.123529],[-155.886774,19.348084],[-156.062036,19.73147],[-155.925113,19.857439],[-155.826528,20.032702],[-155.897728,20.147717],[-155.87582,20.26821],[-155.596496,20.12581],[-155.284311,20.021748],[-155.092618,19.868393],[-155.092618,19.736947],[-154.807817,19.523346],[-154.983079,19.348084],[-155.295265,19.26593],[-155.514342,19.134483],[-155.634835,18.948267]]],[[[-156.587823,21.029505],[-156.472807,20.892581],[-156.324929,20.952827],[-156.00179,20.793996],[-156.051082,20.651596],[-156.379699,20.580396],[-156.445422,20.60778],[-156.461853,20.783042],[-156.631638,20.821381],[-156.697361,20.919966],[-156.587823,21.029505]]],[[[-156.982162,21.210244],[-157.080747,21.106182],[-157.310779,21.106182],[-157.239579,21.221198],[-156.982162,21.210244]]],[[[-157.951581,21.697691],[-157.842042,21.462183],[-157.896811,21.325259],[-158.110412,21.303352],[-158.252813,21.582676],[-158.126843,21.588153],[-157.951581,21.697691]]],[[[-159.468693,22.228955],[-159.353678,22.218001],[-159.298908,22.113939],[-159.33177,21.966061],[-159.446786,21.872953],[-159.764448,21.987969],[-159.726109,22.152277],[-159.468693,22.228955]]]]}},
+{"type":"Feature","id":"16","properties":{"name":"Idaho","density":19.15},"geometry":{"type":"Polygon","coordinates":[[[-116.04751,49.000239],[-116.04751,47.976051],[-115.724371,47.696727],[-115.718894,47.42288],[-115.527201,47.302388],[-115.324554,47.258572],[-115.302646,47.187372],[-114.930214,46.919002],[-114.886399,46.809463],[-114.623506,46.705401],[-114.612552,46.639678],[-114.322274,46.645155],[-114.464674,46.272723],[-114.492059,46.037214],[-114.387997,45.88386],[-114.568736,45.774321],[-114.497536,45.670259],[-114.546828,45.560721],[-114.333228,45.456659],[-114.086765,45.593582],[-113.98818,45.703121],[-113.807441,45.604536],[-113.834826,45.522382],[-113.736241,45.330689],[-113.571933,45.128042],[-113.45144,45.056842],[-113.456917,44.865149],[-113.341901,44.782995],[-113.133778,44.772041],[-113.002331,44.448902],[-112.887315,44.394132],[-112.783254,44.48724],[-112.471068,44.481763],[-112.241036,44.569394],[-112.104113,44.520102],[-111.868605,44.563917],[-111.819312,44.509148],[-111.616665,44.547487],[-111.386634,44.75561],[-111.227803,44.580348],[-111.047063,44.476286],[-111.047063,42.000709],[-112.164359,41.995232],[-114.04295,41.995232],[-117.027882,42.000709],[-117.027882,43.830007],[-116.896436,44.158624],[-116.97859,44.240778],[-117.170283,44.257209],[-117.241483,44.394132],[-117.038836,44.750133],[-116.934774,44.782995],[-116.830713,44.930872],[-116.847143,45.02398],[-116.732128,45.144473],[-116.671881,45.319735],[-116.463758,45.61549],[-116.545912,45.752413],[-116.78142,45.823614],[-116.918344,45.993399],[-116.92382,46.168661],[-117.055267,46.343923],[-117.038836,46.426077],[-117.044313,47.762451],[-117.033359,49.000239],[-116.04751,49.000239]]]}},
+{"type":"Feature","id":"17","properties":{"name":"Illinois","density":231.5},"geometry":{"type":"Polygon","coordinates":[[[-90.639984,42.510065],[-88.788778,42.493634],[-87.802929,42.493634],[-87.83579,42.301941],[-87.682436,42.077386],[-87.523605,41.710431],[-87.529082,39.34987],[-87.63862,39.169131],[-87.512651,38.95553],[-87.49622,38.780268],[-87.62219,38.637868],[-87.655051,38.506421],[-87.83579,38.292821],[-87.950806,38.27639],[-87.923421,38.15042],[-88.000098,38.101128],[-88.060345,37.865619],[-88.027483,37.799896],[-88.15893,37.657496],[-88.065822,37.482234],[-88.476592,37.389126],[-88.514931,37.285064],[-88.421823,37.153617],[-88.547792,37.071463],[-88.914747,37.224817],[-89.029763,37.213863],[-89.183118,37.038601],[-89.133825,36.983832],[-89.292656,36.994786],[-89.517211,37.279587],[-89.435057,37.34531],[-89.517211,37.537003],[-89.517211,37.690357],[-89.84035,37.903958],[-89.949889,37.88205],[-90.059428,38.013497],[-90.355183,38.216144],[-90.349706,38.374975],[-90.179921,38.632391],[-90.207305,38.725499],[-90.10872,38.845992],[-90.251121,38.917192],[-90.470199,38.961007],[-90.585214,38.867899],[-90.661891,38.928146],[-90.727615,39.256762],[-91.061708,39.470363],[-91.368417,39.727779],[-91.494386,40.034488],[-91.50534,40.237135],[-91.417709,40.379535],[-91.401278,40.560274],[-91.121954,40.669813],[-91.09457,40.823167],[-90.963123,40.921752],[-90.946692,41.097014],[-91.111001,41.239415],[-91.045277,41.414677],[-90.656414,41.463969],[-90.344229,41.589939],[-90.311367,41.743293],[-90.179921,41.809016],[-90.141582,42.000709],[-90.168967,42.126679],[-90.393521,42.225264],[-90.420906,42.329326],[-90.639984,42.510065]]]}},
+{"type":"Feature","id":"18","properties":{"name":"Indiana","density":181.7},"geometry":{"type":"Polygon","coordinates":[[[-85.990061,41.759724],[-84.807042,41.759724],[-84.807042,41.694001],[-84.801565,40.500028],[-84.817996,39.103408],[-84.894673,39.059592],[-84.812519,38.785745],[-84.987781,38.780268],[-85.173997,38.68716],[-85.431413,38.730976],[-85.42046,38.533806],[-85.590245,38.451652],[-85.655968,38.325682],[-85.83123,38.27639],[-85.924338,38.024451],[-86.039354,37.958727],[-86.263908,38.051835],[-86.302247,38.166851],[-86.521325,38.040881],[-86.504894,37.931343],[-86.729448,37.893004],[-86.795172,37.991589],[-87.047111,37.893004],[-87.129265,37.788942],[-87.381204,37.93682],[-87.512651,37.903958],[-87.600282,37.975158],[-87.682436,37.903958],[-87.934375,37.893004],[-88.027483,37.799896],[-88.060345,37.865619],[-88.000098,38.101128],[-87.923421,38.15042],[-87.950806,38.27639],[-87.83579,38.292821],[-87.655051,38.506421],[-87.62219,38.637868],[-87.49622,38.780268],[-87.512651,38.95553],[-87.63862,39.169131],[-87.529082,39.34987],[-87.523605,41.710431],[-87.42502,41.644708],[-87.118311,41.644708],[-86.822556,41.759724],[-85.990061,41.759724]]]}},
+{"type":"Feature","id":"19","properties":{"name":"Iowa","density":54.81},"geometry":{"type":"Polygon","coordinates":[[[-91.368417,43.501391],[-91.215062,43.501391],[-91.204109,43.353514],[-91.056231,43.254929],[-91.176724,43.134436],[-91.143862,42.909881],[-91.067185,42.75105],[-90.711184,42.636034],[-90.639984,42.510065],[-90.420906,42.329326],[-90.393521,42.225264],[-90.168967,42.126679],[-90.141582,42.000709],[-90.179921,41.809016],[-90.311367,41.743293],[-90.344229,41.589939],[-90.656414,41.463969],[-91.045277,41.414677],[-91.111001,41.239415],[-90.946692,41.097014],[-90.963123,40.921752],[-91.09457,40.823167],[-91.121954,40.669813],[-91.401278,40.560274],[-91.417709,40.379535],[-91.527248,40.412397],[-91.729895,40.615043],[-91.833957,40.609566],[-93.257961,40.582182],[-94.632673,40.571228],[-95.7664,40.587659],[-95.881416,40.719105],[-95.826646,40.976521],[-95.925231,41.201076],[-95.919754,41.453015],[-96.095016,41.540646],[-96.122401,41.67757],[-96.062155,41.798063],[-96.127878,41.973325],[-96.264801,42.039048],[-96.44554,42.488157],[-96.631756,42.707235],[-96.544125,42.855112],[-96.511264,43.052282],[-96.434587,43.123482],[-96.560556,43.222067],[-96.527695,43.397329],[-96.582464,43.479483],[-96.451017,43.501391],[-91.368417,43.501391]]]}},
+{"type":"Feature","id":"20","properties":{"name":"Kansas","density":35.09},"geometry":{"type":"Polygon","coordinates":[[[-101.90605,40.001626],[-95.306337,40.001626],[-95.207752,39.908518],[-94.884612,39.831841],[-95.109167,39.541563],[-94.983197,39.442978],[-94.824366,39.20747],[-94.610765,39.158177],[-94.616242,37.000263],[-100.087706,37.000263],[-102.042974,36.994786],[-102.053927,40.001626],[-101.90605,40.001626]]]}},
+{"type":"Feature","id":"21","properties":{"name":"Kentucky","density":110},"geometry":{"type":"Polygon","coordinates":[[[-83.903347,38.769315],[-83.678792,38.632391],[-83.519961,38.703591],[-83.142052,38.626914],[-83.032514,38.725499],[-82.890113,38.758361],[-82.846298,38.588575],[-82.731282,38.561191],[-82.594358,38.424267],[-82.621743,38.123036],[-82.50125,37.931343],[-82.342419,37.783465],[-82.293127,37.668449],[-82.101434,37.553434],[-81.969987,37.537003],[-82.353373,37.268633],[-82.720328,37.120755],[-82.720328,37.044078],[-82.868205,36.978355],[-82.879159,36.890724],[-83.070852,36.852385],[-83.136575,36.742847],[-83.673316,36.600446],[-83.689746,36.584015],[-84.544149,36.594969],[-85.289013,36.627831],[-85.486183,36.616877],[-86.592525,36.655216],[-87.852221,36.633308],[-88.071299,36.677123],[-88.054868,36.496384],[-89.298133,36.507338],[-89.418626,36.496384],[-89.363857,36.622354],[-89.215979,36.578538],[-89.133825,36.983832],[-89.183118,37.038601],[-89.029763,37.213863],[-88.914747,37.224817],[-88.547792,37.071463],[-88.421823,37.153617],[-88.514931,37.285064],[-88.476592,37.389126],[-88.065822,37.482234],[-88.15893,37.657496],[-88.027483,37.799896],[-87.934375,37.893004],[-87.682436,37.903958],[-87.600282,37.975158],[-87.512651,37.903958],[-87.381204,37.93682],[-87.129265,37.788942],[-87.047111,37.893004],[-86.795172,37.991589],[-86.729448,37.893004],[-86.504894,37.931343],[-86.521325,38.040881],[-86.302247,38.166851],[-86.263908,38.051835],[-86.039354,37.958727],[-85.924338,38.024451],[-85.83123,38.27639],[-85.655968,38.325682],[-85.590245,38.451652],[-85.42046,38.533806],[-85.431413,38.730976],[-85.173997,38.68716],[-84.987781,38.780268],[-84.812519,38.785745],[-84.894673,39.059592],[-84.817996,39.103408],[-84.43461,39.103408],[-84.231963,38.895284],[-84.215533,38.807653],[-83.903347,38.769315]]]}},
+{"type":"Feature","id":"22","properties":{"name":"Louisiana","density":105},"geometry":{"type":"Polygon","coordinates":[[[-93.608485,33.018527],[-91.16577,33.002096],[-91.072662,32.887081],[-91.143862,32.843265],[-91.154816,32.640618],[-91.006939,32.514649],[-90.985031,32.218894],[-91.105524,31.988862],[-91.341032,31.846462],[-91.401278,31.621907],[-91.499863,31.643815],[-91.516294,31.27686],[-91.636787,31.265906],[-91.565587,31.068736],[-91.636787,30.997536],[-89.747242,30.997536],[-89.845827,30.66892],[-89.681519,30.449842],[-89.643181,30.285534],[-89.522688,30.181472],[-89.818443,30.044549],[-89.84035,29.945964],[-89.599365,29.88024],[-89.495303,30.039072],[-89.287179,29.88024],[-89.30361,29.754271],[-89.424103,29.699501],[-89.648657,29.748794],[-89.621273,29.655686],[-89.69795,29.513285],[-89.506257,29.387316],[-89.199548,29.348977],[-89.09001,29.2011],[-89.002379,29.179192],[-89.16121,29.009407],[-89.336472,29.042268],[-89.484349,29.217531],[-89.851304,29.310638],[-89.851304,29.480424],[-90.032043,29.425654],[-90.021089,29.283254],[-90.103244,29.151807],[-90.23469,29.129899],[-90.333275,29.277777],[-90.563307,29.283254],[-90.645461,29.129899],[-90.798815,29.086084],[-90.963123,29.179192],[-91.09457,29.190146],[-91.220539,29.436608],[-91.445094,29.546147],[-91.532725,29.529716],[-91.620356,29.73784],[-91.883249,29.710455],[-91.888726,29.836425],[-92.146142,29.715932],[-92.113281,29.622824],[-92.31045,29.535193],[-92.617159,29.579009],[-92.97316,29.715932],[-93.2251,29.776178],[-93.767317,29.726886],[-93.838517,29.688547],[-93.926148,29.787132],[-93.690639,30.143133],[-93.767317,30.334826],[-93.696116,30.438888],[-93.728978,30.575812],[-93.630393,30.679874],[-93.526331,30.93729],[-93.542762,31.15089],[-93.816609,31.556184],[-93.822086,31.775262],[-94.041164,31.994339],[-94.041164,33.018527],[-93.608485,33.018527]]]}},
+{"type":"Feature","id":"23","properties":{"name":"Maine","density":43.04},"geometry":{"type":"Polygon","coordinates":[[[-70.703921,43.057759],[-70.824413,43.128959],[-70.807983,43.227544],[-70.966814,43.34256],[-71.032537,44.657025],[-71.08183,45.303304],[-70.649151,45.440228],[-70.720352,45.511428],[-70.556043,45.664782],[-70.386258,45.735983],[-70.41912,45.796229],[-70.260289,45.889337],[-70.309581,46.064599],[-70.210996,46.327492],[-70.057642,46.415123],[-69.997395,46.694447],[-69.225147,47.461219],[-69.044408,47.428357],[-69.033454,47.242141],[-68.902007,47.176418],[-68.578868,47.285957],[-68.376221,47.285957],[-68.233821,47.357157],[-67.954497,47.198326],[-67.790188,47.066879],[-67.779235,45.944106],[-67.801142,45.675736],[-67.456095,45.604536],[-67.505388,45.48952],[-67.417757,45.379982],[-67.488957,45.281397],[-67.346556,45.128042],[-67.16034,45.160904],[-66.979601,44.804903],[-67.187725,44.646072],[-67.308218,44.706318],[-67.406803,44.596779],[-67.549203,44.624164],[-67.565634,44.531056],[-67.75185,44.54201],[-68.047605,44.328409],[-68.118805,44.476286],[-68.222867,44.48724],[-68.173574,44.328409],[-68.403606,44.251732],[-68.458375,44.377701],[-68.567914,44.311978],[-68.82533,44.311978],[-68.830807,44.459856],[-68.984161,44.426994],[-68.956777,44.322932],[-69.099177,44.103854],[-69.071793,44.043608],[-69.258008,43.923115],[-69.444224,43.966931],[-69.553763,43.840961],[-69.707118,43.82453],[-69.833087,43.720469],[-69.986442,43.742376],[-70.030257,43.851915],[-70.254812,43.676653],[-70.194565,43.567114],[-70.358873,43.528776],[-70.369827,43.435668],[-70.556043,43.320652],[-70.703921,43.057759]]]}},
+{"type":"Feature","id":"24","properties":{"name":"Maryland","density":596.3},"geometry":{"type":"MultiPolygon","coordinates":[[[[-75.994645,37.95325],[-76.016553,37.95325],[-76.043938,37.95325],[-75.994645,37.95325]]],[[[-79.477979,39.722302],[-75.786521,39.722302],[-75.693413,38.462606],[-75.047134,38.451652],[-75.244304,38.029928],[-75.397659,38.013497],[-75.671506,37.95325],[-75.885106,37.909435],[-75.879629,38.073743],[-75.961783,38.139466],[-75.846768,38.210667],[-76.000122,38.374975],[-76.049415,38.303775],[-76.257538,38.320205],[-76.328738,38.500944],[-76.263015,38.500944],[-76.257538,38.736453],[-76.191815,38.829561],[-76.279446,39.147223],[-76.169907,39.333439],[-76.000122,39.366301],[-75.972737,39.557994],[-76.098707,39.536086],[-76.104184,39.437501],[-76.367077,39.311532],[-76.443754,39.196516],[-76.460185,38.906238],[-76.55877,38.769315],[-76.514954,38.539283],[-76.383508,38.380452],[-76.399939,38.259959],[-76.317785,38.139466],[-76.3616,38.057312],[-76.591632,38.216144],[-76.920248,38.292821],[-77.018833,38.446175],[-77.205049,38.358544],[-77.276249,38.479037],[-77.128372,38.632391],[-77.040741,38.791222],[-76.909294,38.895284],[-77.035264,38.993869],[-77.117418,38.933623],[-77.248864,39.026731],[-77.456988,39.076023],[-77.456988,39.223901],[-77.566527,39.306055],[-77.719881,39.322485],[-77.834897,39.601809],[-78.004682,39.601809],[-78.174467,39.694917],[-78.267575,39.61824],[-78.431884,39.623717],[-78.470222,39.514178],[-78.765977,39.585379],[-78.963147,39.437501],[-79.094593,39.470363],[-79.291763,39.300578],[-79.488933,39.20747],[-79.477979,39.722302]]]]}},
+{"type":"Feature","id":"25","properties":{"name":"Massachusetts","density":840.2},"geometry":{"type":"Polygon","coordinates":[[[-70.917521,42.887974],[-70.818936,42.871543],[-70.780598,42.696281],[-70.824413,42.55388],[-70.983245,42.422434],[-70.988722,42.269079],[-70.769644,42.247172],[-70.638197,42.08834],[-70.660105,41.962371],[-70.550566,41.929509],[-70.539613,41.814493],[-70.260289,41.715908],[-69.937149,41.809016],[-70.008349,41.672093],[-70.484843,41.5516],[-70.660105,41.546123],[-70.764167,41.639231],[-70.928475,41.611847],[-70.933952,41.540646],[-71.120168,41.496831],[-71.196845,41.67757],[-71.22423,41.710431],[-71.328292,41.781632],[-71.383061,42.01714],[-71.530939,42.01714],[-71.799309,42.006186],[-71.799309,42.022617],[-73.053528,42.039048],[-73.486206,42.050002],[-73.508114,42.08834],[-73.267129,42.745573],[-72.456542,42.729142],[-71.29543,42.696281],[-71.185891,42.789389],[-70.917521,42.887974]]]}},
+{"type":"Feature","id":"26","properties":{"name":"Michigan","density":173.9},"geometry":{"type":"MultiPolygon","coordinates":[[[[-83.454238,41.732339],[-84.807042,41.694001],[-84.807042,41.759724],[-85.990061,41.759724],[-86.822556,41.759724],[-86.619909,41.891171],[-86.482986,42.115725],[-86.357016,42.252649],[-86.263908,42.444341],[-86.209139,42.718189],[-86.231047,43.013943],[-86.526801,43.594499],[-86.433693,43.813577],[-86.499417,44.07647],[-86.269385,44.34484],[-86.220093,44.569394],[-86.252954,44.689887],[-86.088646,44.73918],[-86.066738,44.903488],[-85.809322,44.947303],[-85.612152,45.128042],[-85.628583,44.766564],[-85.524521,44.750133],[-85.393075,44.930872],[-85.387598,45.237581],[-85.305444,45.314258],[-85.031597,45.363551],[-85.119228,45.577151],[-84.938489,45.75789],[-84.713934,45.768844],[-84.461995,45.653829],[-84.215533,45.637398],[-84.09504,45.494997],[-83.908824,45.484043],[-83.596638,45.352597],[-83.4871,45.358074],[-83.317314,45.144473],[-83.454238,45.029457],[-83.322791,44.88158],[-83.273499,44.711795],[-83.333745,44.339363],[-83.536392,44.246255],[-83.585684,44.054562],[-83.82667,43.988839],[-83.958116,43.758807],[-83.908824,43.671176],[-83.667839,43.589022],[-83.481623,43.714992],[-83.262545,43.972408],[-82.917498,44.070993],[-82.747713,43.994316],[-82.643651,43.851915],[-82.539589,43.435668],[-82.523158,43.227544],[-82.413619,42.975605],[-82.517681,42.614127],[-82.681989,42.559357],[-82.687466,42.690804],[-82.797005,42.652465],[-82.922975,42.351234],[-83.125621,42.236218],[-83.185868,42.006186],[-83.437807,41.814493],[-83.454238,41.732339]]],[[[-85.508091,45.730506],[-85.49166,45.610013],[-85.623106,45.588105],[-85.568337,45.75789],[-85.508091,45.730506]]],[[[-87.589328,45.095181],[-87.742682,45.199243],[-87.649574,45.341643],[-87.885083,45.363551],[-87.791975,45.500474],[-87.781021,45.675736],[-87.989145,45.796229],[-88.10416,45.922199],[-88.531362,46.020784],[-88.662808,45.987922],[-89.09001,46.135799],[-90.119674,46.338446],[-90.229213,46.508231],[-90.415429,46.568478],[-90.026566,46.672539],[-89.851304,46.793032],[-89.413149,46.842325],[-89.128348,46.990202],[-88.996902,46.995679],[-88.887363,47.099741],[-88.575177,47.247618],[-88.416346,47.373588],[-88.180837,47.455742],[-87.956283,47.384542],[-88.350623,47.077833],[-88.443731,46.973771],[-88.438254,46.787555],[-88.246561,46.929956],[-87.901513,46.908048],[-87.633143,46.809463],[-87.392158,46.535616],[-87.260711,46.486323],[-87.008772,46.530139],[-86.948526,46.469893],[-86.696587,46.437031],[-86.159846,46.667063],[-85.880522,46.68897],[-85.508091,46.678016],[-85.256151,46.754694],[-85.064458,46.760171],[-85.02612,46.480847],[-84.82895,46.442508],[-84.63178,46.486323],[-84.549626,46.4206],[-84.418179,46.502754],[-84.127902,46.530139],[-84.122425,46.179615],[-83.990978,46.031737],[-83.793808,45.993399],[-83.7719,46.091984],[-83.580208,46.091984],[-83.476146,45.987922],[-83.563777,45.911245],[-84.111471,45.976968],[-84.374364,45.933153],[-84.659165,46.053645],[-84.741319,45.944106],[-84.70298,45.850998],[-84.82895,45.872906],[-85.015166,46.00983],[-85.338305,46.091984],[-85.502614,46.097461],[-85.661445,45.966014],[-85.924338,45.933153],[-86.209139,45.960537],[-86.324155,45.905768],[-86.351539,45.796229],[-86.663725,45.703121],[-86.647294,45.834568],[-86.784218,45.861952],[-86.838987,45.725029],[-87.069019,45.719552],[-87.17308,45.659305],[-87.326435,45.423797],[-87.611236,45.122565],[-87.589328,45.095181]]],[[[-88.805209,47.976051],[-89.057148,47.850082],[-89.188594,47.833651],[-89.177641,47.937713],[-88.547792,48.173221],[-88.668285,48.008913],[-88.805209,47.976051]]]]}},
+{"type":"Feature","id":"27","properties":{"name":"Minnesota","density":67.14},"geometry":{"type":"Polygon","coordinates":[[[-92.014696,46.705401],[-92.091373,46.749217],[-92.29402,46.667063],[-92.29402,46.075553],[-92.354266,46.015307],[-92.639067,45.933153],[-92.869098,45.719552],[-92.885529,45.577151],[-92.770513,45.566198],[-92.644544,45.440228],[-92.75956,45.286874],[-92.737652,45.117088],[-92.808852,44.750133],[-92.545959,44.569394],[-92.337835,44.552964],[-92.233773,44.443425],[-91.927065,44.333886],[-91.877772,44.202439],[-91.592971,44.032654],[-91.43414,43.994316],[-91.242447,43.775238],[-91.269832,43.616407],[-91.215062,43.501391],[-91.368417,43.501391],[-96.451017,43.501391],[-96.451017,45.297827],[-96.681049,45.412843],[-96.856311,45.604536],[-96.582464,45.818137],[-96.560556,45.933153],[-96.598895,46.332969],[-96.719387,46.437031],[-96.801542,46.656109],[-96.785111,46.924479],[-96.823449,46.968294],[-96.856311,47.609096],[-97.053481,47.948667],[-97.130158,48.140359],[-97.16302,48.545653],[-97.097296,48.682577],[-97.228743,49.000239],[-95.152983,49.000239],[-95.152983,49.383625],[-94.955813,49.372671],[-94.824366,49.295994],[-94.69292,48.775685],[-94.588858,48.715438],[-94.260241,48.699007],[-94.221903,48.649715],[-93.838517,48.627807],[-93.794701,48.518268],[-93.466085,48.545653],[-93.466085,48.589469],[-93.208669,48.644238],[-92.984114,48.62233],[-92.726698,48.540176],[-92.655498,48.436114],[-92.50762,48.447068],[-92.370697,48.222514],[-92.304974,48.315622],[-92.053034,48.359437],[-92.009219,48.266329],[-91.713464,48.200606],[-91.713464,48.112975],[-91.565587,48.041775],[-91.264355,48.080113],[-91.083616,48.178698],[-90.837154,48.238944],[-90.749522,48.091067],[-90.579737,48.123929],[-90.377091,48.091067],[-90.141582,48.112975],[-89.873212,47.987005],[-89.615796,48.008913],[-89.637704,47.954144],[-89.971797,47.828174],[-90.437337,47.729589],[-90.738569,47.625527],[-91.171247,47.368111],[-91.357463,47.20928],[-91.642264,47.028541],[-92.091373,46.787555],[-92.014696,46.705401]]]}},
+{"type":"Feature","id":"28","properties":{"name":"Mississippi","density":63.50},"geometry":{"type":"Polygon","coordinates":[[[-88.471115,34.995703],[-88.202745,34.995703],[-88.098683,34.891641],[-88.241084,33.796253],[-88.471115,31.895754],[-88.394438,30.367688],[-88.503977,30.323872],[-88.744962,30.34578],[-88.843547,30.411504],[-89.084533,30.367688],[-89.418626,30.252672],[-89.522688,30.181472],[-89.643181,30.285534],[-89.681519,30.449842],[-89.845827,30.66892],[-89.747242,30.997536],[-91.636787,30.997536],[-91.565587,31.068736],[-91.636787,31.265906],[-91.516294,31.27686],[-91.499863,31.643815],[-91.401278,31.621907],[-91.341032,31.846462],[-91.105524,31.988862],[-90.985031,32.218894],[-91.006939,32.514649],[-91.154816,32.640618],[-91.143862,32.843265],[-91.072662,32.887081],[-91.16577,33.002096],[-91.089093,33.13902],[-91.143862,33.347144],[-91.056231,33.429298],[-91.231493,33.560744],[-91.072662,33.867453],[-90.891923,34.026284],[-90.952169,34.135823],[-90.744046,34.300131],[-90.749522,34.365854],[-90.568783,34.420624],[-90.585214,34.617794],[-90.481152,34.661609],[-90.409952,34.831394],[-90.251121,34.908072],[-90.311367,34.995703],[-88.471115,34.995703]]]}},
+{"type":"Feature","id":"29","properties":{"name":"Missouri","density":87.26},"geometry":{"type":"Polygon","coordinates":[[[-91.833957,40.609566],[-91.729895,40.615043],[-91.527248,40.412397],[-91.417709,40.379535],[-91.50534,40.237135],[-91.494386,40.034488],[-91.368417,39.727779],[-91.061708,39.470363],[-90.727615,39.256762],[-90.661891,38.928146],[-90.585214,38.867899],[-90.470199,38.961007],[-90.251121,38.917192],[-90.10872,38.845992],[-90.207305,38.725499],[-90.179921,38.632391],[-90.349706,38.374975],[-90.355183,38.216144],[-90.059428,38.013497],[-89.949889,37.88205],[-89.84035,37.903958],[-89.517211,37.690357],[-89.517211,37.537003],[-89.435057,37.34531],[-89.517211,37.279587],[-89.292656,36.994786],[-89.133825,36.983832],[-89.215979,36.578538],[-89.363857,36.622354],[-89.418626,36.496384],[-89.484349,36.496384],[-89.539119,36.496384],[-89.533642,36.249922],[-89.730812,35.997983],[-90.377091,35.997983],[-90.218259,36.184199],[-90.064905,36.304691],[-90.152536,36.496384],[-94.473842,36.501861],[-94.616242,36.501861],[-94.616242,37.000263],[-94.610765,39.158177],[-94.824366,39.20747],[-94.983197,39.442978],[-95.109167,39.541563],[-94.884612,39.831841],[-95.207752,39.908518],[-95.306337,40.001626],[-95.552799,40.264519],[-95.7664,40.587659],[-94.632673,40.571228],[-93.257961,40.582182],[-91.833957,40.609566]]]}},
+{"type":"Feature","id":"30","properties":{"name":"Montana","density":6.858},"geometry":{"type":"Polygon","coordinates":[[[-104.047534,49.000239],[-104.042057,47.861036],[-104.047534,45.944106],[-104.042057,44.996596],[-104.058488,44.996596],[-105.91517,45.002073],[-109.080842,45.002073],[-111.05254,45.002073],[-111.047063,44.476286],[-111.227803,44.580348],[-111.386634,44.75561],[-111.616665,44.547487],[-111.819312,44.509148],[-111.868605,44.563917],[-112.104113,44.520102],[-112.241036,44.569394],[-112.471068,44.481763],[-112.783254,44.48724],[-112.887315,44.394132],[-113.002331,44.448902],[-113.133778,44.772041],[-113.341901,44.782995],[-113.456917,44.865149],[-113.45144,45.056842],[-113.571933,45.128042],[-113.736241,45.330689],[-113.834826,45.522382],[-113.807441,45.604536],[-113.98818,45.703121],[-114.086765,45.593582],[-114.333228,45.456659],[-114.546828,45.560721],[-114.497536,45.670259],[-114.568736,45.774321],[-114.387997,45.88386],[-114.492059,46.037214],[-114.464674,46.272723],[-114.322274,46.645155],[-114.612552,46.639678],[-114.623506,46.705401],[-114.886399,46.809463],[-114.930214,46.919002],[-115.302646,47.187372],[-115.324554,47.258572],[-115.527201,47.302388],[-115.718894,47.42288],[-115.724371,47.696727],[-116.04751,47.976051],[-116.04751,49.000239],[-111.50165,48.994762],[-109.453274,49.000239],[-104.047534,49.000239]]]}},
+{"type":"Feature","id":"31","properties":{"name":"Nebraska","density":23.97},"geometry":{"type":"Polygon","coordinates":[[[-103.324578,43.002989],[-101.626726,42.997512],[-98.499393,42.997512],[-98.466531,42.94822],[-97.951699,42.767481],[-97.831206,42.866066],[-97.688806,42.844158],[-97.217789,42.844158],[-96.692003,42.657942],[-96.626279,42.515542],[-96.44554,42.488157],[-96.264801,42.039048],[-96.127878,41.973325],[-96.062155,41.798063],[-96.122401,41.67757],[-96.095016,41.540646],[-95.919754,41.453015],[-95.925231,41.201076],[-95.826646,40.976521],[-95.881416,40.719105],[-95.7664,40.587659],[-95.552799,40.264519],[-95.306337,40.001626],[-101.90605,40.001626],[-102.053927,40.001626],[-102.053927,41.003906],[-104.053011,41.003906],[-104.053011,43.002989],[-103.324578,43.002989]]]}},
+{"type":"Feature","id":"32","properties":{"name":"Nevada","density":24.80},"geometry":{"type":"Polygon","coordinates":[[[-117.027882,42.000709],[-114.04295,41.995232],[-114.048427,37.000263],[-114.048427,36.195153],[-114.152489,36.025367],[-114.251074,36.01989],[-114.371566,36.140383],[-114.738521,36.102045],[-114.678275,35.516012],[-114.596121,35.324319],[-114.574213,35.138103],[-114.634459,35.00118],[-115.85034,35.970598],[-116.540435,36.501861],[-117.498899,37.21934],[-118.71478,38.101128],[-120.001861,38.999346],[-119.996384,40.264519],[-120.001861,41.995232],[-118.698349,41.989755],[-117.027882,42.000709]]]}},
+{"type":"Feature","id":"33","properties":{"name":"New Hampshire","density":147},"geometry":{"type":"Polygon","coordinates":[[[-71.08183,45.303304],[-71.032537,44.657025],[-70.966814,43.34256],[-70.807983,43.227544],[-70.824413,43.128959],[-70.703921,43.057759],[-70.818936,42.871543],[-70.917521,42.887974],[-71.185891,42.789389],[-71.29543,42.696281],[-72.456542,42.729142],[-72.544173,42.80582],[-72.533219,42.953697],[-72.445588,43.008466],[-72.456542,43.150867],[-72.379864,43.572591],[-72.204602,43.769761],[-72.116971,43.994316],[-72.02934,44.07647],[-72.034817,44.322932],[-71.700724,44.41604],[-71.536416,44.585825],[-71.629524,44.750133],[-71.4926,44.914442],[-71.503554,45.013027],[-71.361154,45.270443],[-71.131122,45.243058],[-71.08183,45.303304]]]}},
+{"type":"Feature","id":"34","properties":{"name":"New Jersey","density":1189 },"geometry":{"type":"Polygon","coordinates":[[[-74.236547,41.14083],[-73.902454,40.998429],[-74.022947,40.708151],[-74.187255,40.642428],[-74.274886,40.489074],[-74.001039,40.412397],[-73.979131,40.297381],[-74.099624,39.760641],[-74.411809,39.360824],[-74.614456,39.245808],[-74.795195,38.993869],[-74.888303,39.158177],[-75.178581,39.240331],[-75.534582,39.459409],[-75.55649,39.607286],[-75.561967,39.629194],[-75.507197,39.683964],[-75.414089,39.804456],[-75.145719,39.88661],[-75.129289,39.963288],[-74.82258,40.127596],[-74.773287,40.215227],[-75.058088,40.417874],[-75.069042,40.543843],[-75.195012,40.576705],[-75.205966,40.691721],[-75.052611,40.866983],[-75.134765,40.971045],[-74.882826,41.179168],[-74.828057,41.288707],[-74.69661,41.359907],[-74.236547,41.14083]]]}},
+{"type":"Feature","id":"35","properties":{"name":"New Mexico","density":17.16},"geometry":{"type":"Polygon","coordinates":[[[-107.421329,37.000263],[-106.868158,36.994786],[-104.337812,36.994786],[-103.001438,37.000263],[-103.001438,36.501861],[-103.039777,36.501861],[-103.045254,34.01533],[-103.067161,33.002096],[-103.067161,31.999816],[-106.616219,31.999816],[-106.643603,31.901231],[-106.528588,31.786216],[-108.210008,31.786216],[-108.210008,31.331629],[-109.04798,31.331629],[-109.042503,37.000263],[-107.421329,37.000263]]]}},
+{"type":"Feature","id":"36","properties":{"name":"New York","density":412.3},"geometry":{"type":"Polygon","coordinates":[[[-73.343806,45.013027],[-73.332852,44.804903],[-73.387622,44.618687],[-73.294514,44.437948],[-73.321898,44.246255],[-73.436914,44.043608],[-73.349283,43.769761],[-73.404052,43.687607],[-73.245221,43.523299],[-73.278083,42.833204],[-73.267129,42.745573],[-73.508114,42.08834],[-73.486206,42.050002],[-73.55193,41.294184],[-73.48073,41.21203],[-73.727192,41.102491],[-73.655992,40.987475],[-73.22879,40.905321],[-73.141159,40.965568],[-72.774204,40.965568],[-72.587988,40.998429],[-72.28128,41.157261],[-72.259372,41.042245],[-72.100541,40.992952],[-72.467496,40.845075],[-73.239744,40.625997],[-73.562884,40.582182],[-73.776484,40.593136],[-73.935316,40.543843],[-74.022947,40.708151],[-73.902454,40.998429],[-74.236547,41.14083],[-74.69661,41.359907],[-74.740426,41.431108],[-74.89378,41.436584],[-75.074519,41.60637],[-75.052611,41.754247],[-75.173104,41.869263],[-75.249781,41.863786],[-75.35932,42.000709],[-79.76278,42.000709],[-79.76278,42.252649],[-79.76278,42.269079],[-79.149363,42.55388],[-79.050778,42.690804],[-78.853608,42.783912],[-78.930285,42.953697],[-79.012439,42.986559],[-79.072686,43.260406],[-78.486653,43.375421],[-77.966344,43.369944],[-77.75822,43.34256],[-77.533665,43.233021],[-77.391265,43.276836],[-76.958587,43.271359],[-76.695693,43.34256],[-76.41637,43.523299],[-76.235631,43.528776],[-76.230154,43.802623],[-76.137046,43.961454],[-76.3616,44.070993],[-76.312308,44.196962],[-75.912491,44.366748],[-75.764614,44.514625],[-75.282643,44.848718],[-74.828057,45.018503],[-74.148916,44.991119],[-73.343806,45.013027]]]}},
+{"type":"Feature","id":"37","properties":{"name":"North Carolina","density":198.2},"geometry":{"type":"Polygon","coordinates":[[[-80.978661,36.562108],[-80.294043,36.545677],[-79.510841,36.5402],[-75.868676,36.551154],[-75.75366,36.151337],[-76.032984,36.189676],[-76.071322,36.140383],[-76.410893,36.080137],[-76.460185,36.025367],[-76.68474,36.008937],[-76.673786,35.937736],[-76.399939,35.987029],[-76.3616,35.943213],[-76.060368,35.992506],[-75.961783,35.899398],[-75.781044,35.937736],[-75.715321,35.696751],[-75.775568,35.581735],[-75.89606,35.570781],[-76.147999,35.324319],[-76.482093,35.313365],[-76.536862,35.14358],[-76.394462,34.973795],[-76.279446,34.940933],[-76.493047,34.661609],[-76.673786,34.694471],[-76.991448,34.667086],[-77.210526,34.60684],[-77.555573,34.415147],[-77.82942,34.163208],[-77.971821,33.845545],[-78.179944,33.916745],[-78.541422,33.851022],[-79.675149,34.80401],[-80.797922,34.820441],[-80.781491,34.935456],[-80.934845,35.105241],[-81.038907,35.044995],[-81.044384,35.149057],[-82.276696,35.198349],[-82.550543,35.160011],[-82.764143,35.066903],[-83.109191,35.00118],[-83.618546,34.984749],[-84.319594,34.990226],[-84.29221,35.225734],[-84.09504,35.247642],[-84.018363,35.41195],[-83.7719,35.559827],[-83.498053,35.565304],[-83.251591,35.718659],[-82.994175,35.773428],[-82.775097,35.997983],[-82.638174,36.063706],[-82.610789,35.965121],[-82.216449,36.156814],[-82.03571,36.118475],[-81.909741,36.304691],[-81.723525,36.353984],[-81.679709,36.589492],[-80.978661,36.562108]]]}},
+{"type":"Feature","id":"38","properties":{"name":"North Dakota","density":9.916},"geometry":{"type":"Polygon","coordinates":[[[-97.228743,49.000239],[-97.097296,48.682577],[-97.16302,48.545653],[-97.130158,48.140359],[-97.053481,47.948667],[-96.856311,47.609096],[-96.823449,46.968294],[-96.785111,46.924479],[-96.801542,46.656109],[-96.719387,46.437031],[-96.598895,46.332969],[-96.560556,45.933153],[-104.047534,45.944106],[-104.042057,47.861036],[-104.047534,49.000239],[-97.228743,49.000239]]]}},
+{"type":"Feature","id":"39","properties":{"name":"Ohio","density":281.9},"geometry":{"type":"Polygon","coordinates":[[[-80.518598,41.978802],[-80.518598,40.636951],[-80.666475,40.582182],[-80.595275,40.472643],[-80.600752,40.319289],[-80.737675,40.078303],[-80.830783,39.711348],[-81.219646,39.388209],[-81.345616,39.344393],[-81.455155,39.410117],[-81.57017,39.267716],[-81.685186,39.273193],[-81.811156,39.0815],[-81.783771,38.966484],[-81.887833,38.873376],[-82.03571,39.026731],[-82.221926,38.785745],[-82.172634,38.632391],[-82.293127,38.577622],[-82.331465,38.446175],[-82.594358,38.424267],[-82.731282,38.561191],[-82.846298,38.588575],[-82.890113,38.758361],[-83.032514,38.725499],[-83.142052,38.626914],[-83.519961,38.703591],[-83.678792,38.632391],[-83.903347,38.769315],[-84.215533,38.807653],[-84.231963,38.895284],[-84.43461,39.103408],[-84.817996,39.103408],[-84.801565,40.500028],[-84.807042,41.694001],[-83.454238,41.732339],[-83.065375,41.595416],[-82.933929,41.513262],[-82.835344,41.589939],[-82.616266,41.431108],[-82.479343,41.381815],[-82.013803,41.513262],[-81.739956,41.485877],[-81.444201,41.672093],[-81.011523,41.852832],[-80.518598,41.978802],[-80.518598,41.978802]]]}},
+{"type":"Feature","id":"40","properties":{"name":"Oklahoma","density":55.22},"geometry":{"type":"Polygon","coordinates":[[[-100.087706,37.000263],[-94.616242,37.000263],[-94.616242,36.501861],[-94.430026,35.395519],[-94.484796,33.637421],[-94.868182,33.74696],[-94.966767,33.861976],[-95.224183,33.960561],[-95.289906,33.87293],[-95.547322,33.878407],[-95.602092,33.933176],[-95.8376,33.834591],[-95.936185,33.889361],[-96.149786,33.840068],[-96.346956,33.686714],[-96.423633,33.774345],[-96.631756,33.845545],[-96.850834,33.845545],[-96.922034,33.960561],[-97.173974,33.736006],[-97.256128,33.861976],[-97.371143,33.823637],[-97.458774,33.905791],[-97.694283,33.982469],[-97.869545,33.851022],[-97.946222,33.987946],[-98.088623,34.004376],[-98.170777,34.113915],[-98.36247,34.157731],[-98.488439,34.064623],[-98.570593,34.146777],[-98.767763,34.135823],[-98.986841,34.223454],[-99.189488,34.2125],[-99.260688,34.404193],[-99.57835,34.415147],[-99.698843,34.382285],[-99.923398,34.573978],[-100.000075,34.563024],[-100.000075,36.501861],[-101.812942,36.501861],[-103.001438,36.501861],[-103.001438,37.000263],[-102.042974,36.994786],[-100.087706,37.000263]]]}},
+{"type":"Feature","id":"41","properties":{"name":"Oregon","density":40.33},"geometry":{"type":"Polygon","coordinates":[[[-123.211348,46.174138],[-123.11824,46.185092],[-122.904639,46.08103],[-122.811531,45.960537],[-122.762239,45.659305],[-122.247407,45.549767],[-121.809251,45.708598],[-121.535404,45.725029],[-121.217742,45.670259],[-121.18488,45.604536],[-120.637186,45.746937],[-120.505739,45.697644],[-120.209985,45.725029],[-119.963522,45.823614],[-119.525367,45.911245],[-119.125551,45.933153],[-118.988627,45.998876],[-116.918344,45.993399],[-116.78142,45.823614],[-116.545912,45.752413],[-116.463758,45.61549],[-116.671881,45.319735],[-116.732128,45.144473],[-116.847143,45.02398],[-116.830713,44.930872],[-116.934774,44.782995],[-117.038836,44.750133],[-117.241483,44.394132],[-117.170283,44.257209],[-116.97859,44.240778],[-116.896436,44.158624],[-117.027882,43.830007],[-117.027882,42.000709],[-118.698349,41.989755],[-120.001861,41.995232],[-121.037003,41.995232],[-122.378853,42.011663],[-123.233256,42.006186],[-124.213628,42.000709],[-124.356029,42.115725],[-124.432706,42.438865],[-124.416275,42.663419],[-124.553198,42.838681],[-124.454613,43.002989],[-124.383413,43.271359],[-124.235536,43.55616],[-124.169813,43.8081],[-124.060274,44.657025],[-124.076705,44.772041],[-123.97812,45.144473],[-123.939781,45.659305],[-123.994551,45.944106],[-123.945258,46.113892],[-123.545441,46.261769],[-123.370179,46.146753],[-123.211348,46.174138]]]}},
+{"type":"Feature","id":"42","properties":{"name":"Pennsylvania","density":284.3},"geometry":{"type":"Polygon","coordinates":[[[-79.76278,42.252649],[-79.76278,42.000709],[-75.35932,42.000709],[-75.249781,41.863786],[-75.173104,41.869263],[-75.052611,41.754247],[-75.074519,41.60637],[-74.89378,41.436584],[-74.740426,41.431108],[-74.69661,41.359907],[-74.828057,41.288707],[-74.882826,41.179168],[-75.134765,40.971045],[-75.052611,40.866983],[-75.205966,40.691721],[-75.195012,40.576705],[-75.069042,40.543843],[-75.058088,40.417874],[-74.773287,40.215227],[-74.82258,40.127596],[-75.129289,39.963288],[-75.145719,39.88661],[-75.414089,39.804456],[-75.616736,39.831841],[-75.786521,39.722302],[-79.477979,39.722302],[-80.518598,39.722302],[-80.518598,40.636951],[-80.518598,41.978802],[-80.518598,41.978802],[-80.332382,42.033571],[-79.76278,42.269079],[-79.76278,42.252649]]]}},
+{"type":"Feature","id":"44","properties":{"name":"Rhode Island","density":1006 },"geometry":{"type":"MultiPolygon","coordinates":[[[[-71.196845,41.67757],[-71.120168,41.496831],[-71.317338,41.474923],[-71.196845,41.67757]]],[[[-71.530939,42.01714],[-71.383061,42.01714],[-71.328292,41.781632],[-71.22423,41.710431],[-71.344723,41.726862],[-71.448785,41.578985],[-71.481646,41.370861],[-71.859555,41.321569],[-71.799309,41.414677],[-71.799309,42.006186],[-71.530939,42.01714]]]]}},
+{"type":"Feature","id":"45","properties":{"name":"South Carolina","density":155.4},"geometry":{"type":"Polygon","coordinates":[[[-82.764143,35.066903],[-82.550543,35.160011],[-82.276696,35.198349],[-81.044384,35.149057],[-81.038907,35.044995],[-80.934845,35.105241],[-80.781491,34.935456],[-80.797922,34.820441],[-79.675149,34.80401],[-78.541422,33.851022],[-78.716684,33.80173],[-78.935762,33.637421],[-79.149363,33.380005],[-79.187701,33.171881],[-79.357487,33.007573],[-79.582041,33.007573],[-79.631334,32.887081],[-79.866842,32.755634],[-79.998289,32.613234],[-80.206412,32.552987],[-80.430967,32.399633],[-80.452875,32.328433],[-80.660998,32.246279],[-80.885553,32.032678],[-81.115584,32.120309],[-81.121061,32.290094],[-81.279893,32.558464],[-81.416816,32.629664],[-81.42777,32.843265],[-81.493493,33.007573],[-81.761863,33.160928],[-81.937125,33.347144],[-81.926172,33.462159],[-82.194542,33.631944],[-82.325988,33.81816],[-82.55602,33.94413],[-82.714851,34.152254],[-82.747713,34.26727],[-82.901067,34.486347],[-83.005129,34.469916],[-83.339222,34.683517],[-83.322791,34.787579],[-83.109191,35.00118],[-82.764143,35.066903]]]}},
+{"type":"Feature","id":"46","properties":{"name":"South Dakota","density":98.07},"geometry":{"type":"Polygon","coordinates":[[[-104.047534,45.944106],[-96.560556,45.933153],[-96.582464,45.818137],[-96.856311,45.604536],[-96.681049,45.412843],[-96.451017,45.297827],[-96.451017,43.501391],[-96.582464,43.479483],[-96.527695,43.397329],[-96.560556,43.222067],[-96.434587,43.123482],[-96.511264,43.052282],[-96.544125,42.855112],[-96.631756,42.707235],[-96.44554,42.488157],[-96.626279,42.515542],[-96.692003,42.657942],[-97.217789,42.844158],[-97.688806,42.844158],[-97.831206,42.866066],[-97.951699,42.767481],[-98.466531,42.94822],[-98.499393,42.997512],[-101.626726,42.997512],[-103.324578,43.002989],[-104.053011,43.002989],[-104.058488,44.996596],[-104.042057,44.996596],[-104.047534,45.944106]]]}},
+{"type":"Feature","id":"47","properties":{"name":"Tennessee","density":88.08},"geometry":{"type":"Polygon","coordinates":[[[-88.054868,36.496384],[-88.071299,36.677123],[-87.852221,36.633308],[-86.592525,36.655216],[-85.486183,36.616877],[-85.289013,36.627831],[-84.544149,36.594969],[-83.689746,36.584015],[-83.673316,36.600446],[-81.679709,36.589492],[-81.723525,36.353984],[-81.909741,36.304691],[-82.03571,36.118475],[-82.216449,36.156814],[-82.610789,35.965121],[-82.638174,36.063706],[-82.775097,35.997983],[-82.994175,35.773428],[-83.251591,35.718659],[-83.498053,35.565304],[-83.7719,35.559827],[-84.018363,35.41195],[-84.09504,35.247642],[-84.29221,35.225734],[-84.319594,34.990226],[-85.606675,34.984749],[-87.359296,35.00118],[-88.202745,34.995703],[-88.471115,34.995703],[-90.311367,34.995703],[-90.212782,35.023087],[-90.114197,35.198349],[-90.130628,35.439335],[-89.944412,35.603643],[-89.911551,35.756997],[-89.763673,35.811767],[-89.730812,35.997983],[-89.533642,36.249922],[-89.539119,36.496384],[-89.484349,36.496384],[-89.418626,36.496384],[-89.298133,36.507338],[-88.054868,36.496384]]]}},
+{"type":"Feature","id":"48","properties":{"name":"Texas","density":98.07},"geometry":{"type":"Polygon","coordinates":[[[-101.812942,36.501861],[-100.000075,36.501861],[-100.000075,34.563024],[-99.923398,34.573978],[-99.698843,34.382285],[-99.57835,34.415147],[-99.260688,34.404193],[-99.189488,34.2125],[-98.986841,34.223454],[-98.767763,34.135823],[-98.570593,34.146777],[-98.488439,34.064623],[-98.36247,34.157731],[-98.170777,34.113915],[-98.088623,34.004376],[-97.946222,33.987946],[-97.869545,33.851022],[-97.694283,33.982469],[-97.458774,33.905791],[-97.371143,33.823637],[-97.256128,33.861976],[-97.173974,33.736006],[-96.922034,33.960561],[-96.850834,33.845545],[-96.631756,33.845545],[-96.423633,33.774345],[-96.346956,33.686714],[-96.149786,33.840068],[-95.936185,33.889361],[-95.8376,33.834591],[-95.602092,33.933176],[-95.547322,33.878407],[-95.289906,33.87293],[-95.224183,33.960561],[-94.966767,33.861976],[-94.868182,33.74696],[-94.484796,33.637421],[-94.380734,33.544313],[-94.183564,33.593606],[-94.041164,33.54979],[-94.041164,33.018527],[-94.041164,31.994339],[-93.822086,31.775262],[-93.816609,31.556184],[-93.542762,31.15089],[-93.526331,30.93729],[-93.630393,30.679874],[-93.728978,30.575812],[-93.696116,30.438888],[-93.767317,30.334826],[-93.690639,30.143133],[-93.926148,29.787132],[-93.838517,29.688547],[-94.002825,29.68307],[-94.523134,29.546147],[-94.70935,29.622824],[-94.742212,29.787132],[-94.873659,29.672117],[-94.966767,29.699501],[-95.016059,29.557101],[-94.911997,29.496854],[-94.895566,29.310638],[-95.081782,29.113469],[-95.383014,28.867006],[-95.985477,28.604113],[-96.045724,28.647929],[-96.226463,28.582205],[-96.23194,28.642452],[-96.478402,28.598636],[-96.593418,28.724606],[-96.664618,28.697221],[-96.401725,28.439805],[-96.593418,28.357651],[-96.774157,28.406943],[-96.801542,28.226204],[-97.026096,28.039988],[-97.256128,27.694941],[-97.404005,27.333463],[-97.513544,27.360848],[-97.540929,27.229401],[-97.425913,27.262263],[-97.480682,26.99937],[-97.557359,26.988416],[-97.562836,26.840538],[-97.469728,26.758384],[-97.442344,26.457153],[-97.332805,26.353091],[-97.30542,26.161398],[-97.217789,25.991613],[-97.524498,25.887551],[-97.650467,26.018997],[-97.885976,26.06829],[-98.198161,26.057336],[-98.466531,26.221644],[-98.669178,26.238075],[-98.822533,26.369522],[-99.030656,26.413337],[-99.173057,26.539307],[-99.266165,26.840538],[-99.446904,27.021277],[-99.424996,27.174632],[-99.50715,27.33894],[-99.479765,27.48134],[-99.605735,27.640172],[-99.709797,27.656603],[-99.879582,27.799003],[-99.934351,27.979742],[-100.082229,28.14405],[-100.29583,28.280974],[-100.399891,28.582205],[-100.498476,28.66436],[-100.629923,28.905345],[-100.673738,29.102515],[-100.799708,29.244915],[-101.013309,29.370885],[-101.062601,29.458516],[-101.259771,29.535193],[-101.413125,29.754271],[-101.851281,29.803563],[-102.114174,29.792609],[-102.338728,29.869286],[-102.388021,29.765225],[-102.629006,29.732363],[-102.809745,29.524239],[-102.919284,29.190146],[-102.97953,29.184669],[-103.116454,28.987499],[-103.280762,28.982022],[-103.527224,29.135376],[-104.146119,29.381839],[-104.266611,29.513285],[-104.507597,29.639255],[-104.677382,29.924056],[-104.688336,30.181472],[-104.858121,30.389596],[-104.896459,30.570335],[-105.005998,30.685351],[-105.394861,30.855136],[-105.602985,31.085167],[-105.77277,31.167321],[-105.953509,31.364491],[-106.205448,31.468553],[-106.38071,31.731446],[-106.528588,31.786216],[-106.643603,31.901231],[-106.616219,31.999816],[-103.067161,31.999816],[-103.067161,33.002096],[-103.045254,34.01533],[-103.039777,36.501861],[-103.001438,36.501861],[-101.812942,36.501861]]]}},
+{"type":"Feature","id":"49","properties":{"name":"Utah","density":34.30},"geometry":{"type":"Polygon","coordinates":[[[-112.164359,41.995232],[-111.047063,42.000709],[-111.047063,40.998429],[-109.04798,40.998429],[-109.053457,39.125316],[-109.058934,38.27639],[-109.042503,38.166851],[-109.042503,37.000263],[-110.499369,37.00574],[-114.048427,37.000263],[-114.04295,41.995232],[-112.164359,41.995232]]]}},
+{"type":"Feature","id":"50","properties":{"name":"Vermont","density":67.73},"geometry":{"type":"Polygon","coordinates":[[[-71.503554,45.013027],[-71.4926,44.914442],[-71.629524,44.750133],[-71.536416,44.585825],[-71.700724,44.41604],[-72.034817,44.322932],[-72.02934,44.07647],[-72.116971,43.994316],[-72.204602,43.769761],[-72.379864,43.572591],[-72.456542,43.150867],[-72.445588,43.008466],[-72.533219,42.953697],[-72.544173,42.80582],[-72.456542,42.729142],[-73.267129,42.745573],[-73.278083,42.833204],[-73.245221,43.523299],[-73.404052,43.687607],[-73.349283,43.769761],[-73.436914,44.043608],[-73.321898,44.246255],[-73.294514,44.437948],[-73.387622,44.618687],[-73.332852,44.804903],[-73.343806,45.013027],[-72.308664,45.002073],[-71.503554,45.013027]]]}},
+{"type":"Feature","id":"51","properties":{"name":"Virginia","density":204.5},"geometry":{"type":"MultiPolygon","coordinates":[[[[-75.397659,38.013497],[-75.244304,38.029928],[-75.375751,37.860142],[-75.512674,37.799896],[-75.594828,37.569865],[-75.802952,37.197433],[-75.972737,37.120755],[-76.027507,37.257679],[-75.939876,37.564388],[-75.671506,37.95325],[-75.397659,38.013497]]],[[[-76.016553,37.95325],[-75.994645,37.95325],[-76.043938,37.95325],[-76.016553,37.95325]]],[[[-78.349729,39.464886],[-77.82942,39.130793],[-77.719881,39.322485],[-77.566527,39.306055],[-77.456988,39.223901],[-77.456988,39.076023],[-77.248864,39.026731],[-77.117418,38.933623],[-77.040741,38.791222],[-77.128372,38.632391],[-77.248864,38.588575],[-77.325542,38.446175],[-77.281726,38.342113],[-77.013356,38.374975],[-76.964064,38.216144],[-76.613539,38.15042],[-76.514954,38.024451],[-76.235631,37.887527],[-76.3616,37.608203],[-76.246584,37.389126],[-76.383508,37.285064],[-76.399939,37.159094],[-76.273969,37.082417],[-76.410893,36.961924],[-76.619016,37.120755],[-76.668309,37.065986],[-76.48757,36.95097],[-75.994645,36.923586],[-75.868676,36.551154],[-79.510841,36.5402],[-80.294043,36.545677],[-80.978661,36.562108],[-81.679709,36.589492],[-83.673316,36.600446],[-83.136575,36.742847],[-83.070852,36.852385],[-82.879159,36.890724],[-82.868205,36.978355],[-82.720328,37.044078],[-82.720328,37.120755],[-82.353373,37.268633],[-81.969987,37.537003],[-81.986418,37.454849],[-81.849494,37.285064],[-81.679709,37.20291],[-81.55374,37.208387],[-81.362047,37.339833],[-81.225123,37.235771],[-80.967707,37.290541],[-80.513121,37.482234],[-80.474782,37.421987],[-80.29952,37.509618],[-80.294043,37.690357],[-80.184505,37.849189],[-79.998289,37.997066],[-79.921611,38.177805],[-79.724442,38.364021],[-79.647764,38.594052],[-79.477979,38.457129],[-79.313671,38.413313],[-79.209609,38.495467],[-78.996008,38.851469],[-78.870039,38.763838],[-78.404499,39.169131],[-78.349729,39.464886]]]]}},
+{"type":"Feature","id":"53","properties":{"name":"Washington","density":102.6},"geometry":{"type":"MultiPolygon","coordinates":[[[[-117.033359,49.000239],[-117.044313,47.762451],[-117.038836,46.426077],[-117.055267,46.343923],[-116.92382,46.168661],[-116.918344,45.993399],[-118.988627,45.998876],[-119.125551,45.933153],[-119.525367,45.911245],[-119.963522,45.823614],[-120.209985,45.725029],[-120.505739,45.697644],[-120.637186,45.746937],[-121.18488,45.604536],[-121.217742,45.670259],[-121.535404,45.725029],[-121.809251,45.708598],[-122.247407,45.549767],[-122.762239,45.659305],[-122.811531,45.960537],[-122.904639,46.08103],[-123.11824,46.185092],[-123.211348,46.174138],[-123.370179,46.146753],[-123.545441,46.261769],[-123.72618,46.300108],[-123.874058,46.239861],[-124.065751,46.327492],[-124.027412,46.464416],[-123.895966,46.535616],[-124.098612,46.74374],[-124.235536,47.285957],[-124.31769,47.357157],[-124.427229,47.740543],[-124.624399,47.88842],[-124.706553,48.184175],[-124.597014,48.381345],[-124.394367,48.288237],[-123.983597,48.162267],[-123.704273,48.167744],[-123.424949,48.118452],[-123.162056,48.167744],[-123.036086,48.080113],[-122.800578,48.08559],[-122.636269,47.866512],[-122.515777,47.882943],[-122.493869,47.587189],[-122.422669,47.318818],[-122.324084,47.346203],[-122.422669,47.576235],[-122.395284,47.800789],[-122.230976,48.030821],[-122.362422,48.123929],[-122.373376,48.288237],[-122.471961,48.468976],[-122.422669,48.600422],[-122.488392,48.753777],[-122.647223,48.775685],[-122.795101,48.8907],[-122.756762,49.000239],[-117.033359,49.000239]]],[[[-122.718423,48.310145],[-122.586977,48.35396],[-122.608885,48.151313],[-122.767716,48.227991],[-122.718423,48.310145]]],[[[-123.025132,48.583992],[-122.915593,48.715438],[-122.767716,48.556607],[-122.811531,48.419683],[-123.041563,48.458022],[-123.025132,48.583992]]]]}},
+{"type":"Feature","id":"54","properties":{"name":"West Virginia","density":77.06},"geometry":{"type":"Polygon","coordinates":[[[-80.518598,40.636951],[-80.518598,39.722302],[-79.477979,39.722302],[-79.488933,39.20747],[-79.291763,39.300578],[-79.094593,39.470363],[-78.963147,39.437501],[-78.765977,39.585379],[-78.470222,39.514178],[-78.431884,39.623717],[-78.267575,39.61824],[-78.174467,39.694917],[-78.004682,39.601809],[-77.834897,39.601809],[-77.719881,39.322485],[-77.82942,39.130793],[-78.349729,39.464886],[-78.404499,39.169131],[-78.870039,38.763838],[-78.996008,38.851469],[-79.209609,38.495467],[-79.313671,38.413313],[-79.477979,38.457129],[-79.647764,38.594052],[-79.724442,38.364021],[-79.921611,38.177805],[-79.998289,37.997066],[-80.184505,37.849189],[-80.294043,37.690357],[-80.29952,37.509618],[-80.474782,37.421987],[-80.513121,37.482234],[-80.967707,37.290541],[-81.225123,37.235771],[-81.362047,37.339833],[-81.55374,37.208387],[-81.679709,37.20291],[-81.849494,37.285064],[-81.986418,37.454849],[-81.969987,37.537003],[-82.101434,37.553434],[-82.293127,37.668449],[-82.342419,37.783465],[-82.50125,37.931343],[-82.621743,38.123036],[-82.594358,38.424267],[-82.331465,38.446175],[-82.293127,38.577622],[-82.172634,38.632391],[-82.221926,38.785745],[-82.03571,39.026731],[-81.887833,38.873376],[-81.783771,38.966484],[-81.811156,39.0815],[-81.685186,39.273193],[-81.57017,39.267716],[-81.455155,39.410117],[-81.345616,39.344393],[-81.219646,39.388209],[-80.830783,39.711348],[-80.737675,40.078303],[-80.600752,40.319289],[-80.595275,40.472643],[-80.666475,40.582182],[-80.518598,40.636951]]]}},
+{"type":"Feature","id":"55","properties":{"name":"Wisconsin","density":105.2},"geometry":{"type":"Polygon","coordinates":[[[-90.415429,46.568478],[-90.229213,46.508231],[-90.119674,46.338446],[-89.09001,46.135799],[-88.662808,45.987922],[-88.531362,46.020784],[-88.10416,45.922199],[-87.989145,45.796229],[-87.781021,45.675736],[-87.791975,45.500474],[-87.885083,45.363551],[-87.649574,45.341643],[-87.742682,45.199243],[-87.589328,45.095181],[-87.627666,44.974688],[-87.819359,44.95278],[-87.983668,44.722749],[-88.043914,44.563917],[-87.928898,44.536533],[-87.775544,44.640595],[-87.611236,44.837764],[-87.403112,44.914442],[-87.238804,45.166381],[-87.03068,45.22115],[-87.047111,45.089704],[-87.189511,44.969211],[-87.468835,44.552964],[-87.545512,44.322932],[-87.540035,44.158624],[-87.644097,44.103854],[-87.737205,43.8793],[-87.704344,43.687607],[-87.791975,43.561637],[-87.912467,43.249452],[-87.885083,43.002989],[-87.76459,42.783912],[-87.802929,42.493634],[-88.788778,42.493634],[-90.639984,42.510065],[-90.711184,42.636034],[-91.067185,42.75105],[-91.143862,42.909881],[-91.176724,43.134436],[-91.056231,43.254929],[-91.204109,43.353514],[-91.215062,43.501391],[-91.269832,43.616407],[-91.242447,43.775238],[-91.43414,43.994316],[-91.592971,44.032654],[-91.877772,44.202439],[-91.927065,44.333886],[-92.233773,44.443425],[-92.337835,44.552964],[-92.545959,44.569394],[-92.808852,44.750133],[-92.737652,45.117088],[-92.75956,45.286874],[-92.644544,45.440228],[-92.770513,45.566198],[-92.885529,45.577151],[-92.869098,45.719552],[-92.639067,45.933153],[-92.354266,46.015307],[-92.29402,46.075553],[-92.29402,46.667063],[-92.091373,46.749217],[-92.014696,46.705401],[-91.790141,46.694447],[-91.09457,46.864232],[-90.837154,46.95734],[-90.749522,46.88614],[-90.886446,46.754694],[-90.55783,46.584908],[-90.415429,46.568478]]]}},
+{"type":"Feature","id":"56","properties":{"name":"Wyoming","density":5.851},"geometry":{"type":"Polygon","coordinates":[[[-109.080842,45.002073],[-105.91517,45.002073],[-104.058488,44.996596],[-104.053011,43.002989],[-104.053011,41.003906],[-105.728954,40.998429],[-107.919731,41.003906],[-109.04798,40.998429],[-111.047063,40.998429],[-111.047063,42.000709],[-111.047063,44.476286],[-111.05254,45.002073],[-109.080842,45.002073]]]}},
+{"type":"Feature","id":"72","properties":{"name":"Puerto Rico","density":1082 },"geometry":{"type":"Polygon","coordinates":[[[-66.448338,17.984326],[-66.771478,18.006234],[-66.924832,17.929556],[-66.985078,17.973372],[-67.209633,17.956941],[-67.154863,18.19245],[-67.269879,18.362235],[-67.094617,18.515589],[-66.957694,18.488204],[-66.409999,18.488204],[-65.840398,18.433435],[-65.632274,18.367712],[-65.626797,18.203403],[-65.730859,18.186973],[-65.834921,18.017187],[-66.234737,17.929556],[-66.448338,17.984326]]]}}
+]};
diff --git a/src/public/Leaflet-1.7.1/docs/examples/crs-simple/crs-simple-example1.md b/src/public/Leaflet-1.7.1/docs/examples/crs-simple/crs-simple-example1.md
new file mode 100644
index 0000000..630555b
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/crs-simple/crs-simple-example1.md
@@ -0,0 +1,16 @@
+---
+layout: tutorial_frame
+title: CRS.Simple example
+---
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/crs-simple/crs-simple-example2.md b/src/public/Leaflet-1.7.1/docs/examples/crs-simple/crs-simple-example2.md
new file mode 100644
index 0000000..3344a8c
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/crs-simple/crs-simple-example2.md
@@ -0,0 +1,20 @@
+---
+layout: tutorial_frame
+title: CRS.Simple example
+---
+
\ No newline at end of file
diff --git a/src/public/Leaflet-1.7.1/docs/examples/crs-simple/crs-simple-example3.md b/src/public/Leaflet-1.7.1/docs/examples/crs-simple/crs-simple-example3.md
new file mode 100644
index 0000000..eba513b
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/crs-simple/crs-simple-example3.md
@@ -0,0 +1,38 @@
+---
+layout: tutorial_frame
+title: CRS.Simple example
+---
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/crs-simple/crs-simple.md b/src/public/Leaflet-1.7.1/docs/examples/crs-simple/crs-simple.md
new file mode 100644
index 0000000..3f48b5c
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/crs-simple/crs-simple.md
@@ -0,0 +1,117 @@
+---
+layout: tutorial_v2
+title: Non-geographical maps
+---
+
+
+
+## Not of this earth
+
+Sometimes, maps do not represent things on the surface of the earth and, as such, do not have a concept of geographical latitude and geographical longitude. Most times this refers to big scanned images, such as game maps.
+
+For this tutorial we've picked a starmap from Star Control II, a game that is now available as the [open-source project The Ur-Quan Masters](https://en.wikipedia.org/wiki/Star_Control_II#The_Ur-Quan_Masters). These maps were made with a [tool to read the open-source data files](http://www.highprogrammer.com/alan/games/video/uqm/index.html) of the game (webpage seems to have been taken down, see the [archived version](https://web.archive.org/web/20171112052528/https://www.highprogrammer.com/alan/games/video/uqm/index.html)), and look like this:
+
+
+
+
+
+The game has a built-in square coordinate system, as can be seen in the corners. This will allow us to establish a coordinate system.
+
+
+
+
+
+
+## CRS.Simple
+
+**CRS** stands for [coordinate reference system](https://en.wikipedia.org/wiki/Spatial_reference_system), a term used by geographers to explain what the coordinates mean in a coordinate vector. For example, `[15, 60]` represents a point in the Indian Ocean if using latitude-longitude on the earth, or the solar system Krueger-Z in our starmap.
+
+A Leaflet map has one CRS (and *one* CRS *only*), that can be changed when creating the map. For our game map we'll use `CRS.Simple`, which represents a square grid:
+
+ var map = L.map('map', {
+ crs: L.CRS.Simple
+ });
+
+Then we can just add a `L.ImageOverlay` with the starmap image and its *approximate* bounds:
+
+ var bounds = [[0,0], [1000,1000]];
+ var image = L.imageOverlay('uqm_map_full.png', bounds).addTo(map);
+
+And show the whole map:
+
+ map.fitBounds(bounds);
+
+{% include frame.html url="crs-simple-example1.html" %}
+
+This example doesn't quite work, as we cannot see the whole map after doing a `fitBounds()`.
+
+
+## Common gotchas in CRS.Simple maps
+
+In the default Leaflet CRS, `CRS.Earth`, 360 degrees of longitude are mapped to 256 horizontal pixels (at zoom level 0) and approximately 170 degrees of latitude are mapped to 256 vertical pixels (at zoom level 0).
+
+In a `CRS.Simple`, one horizontal map unit is mapped to one horizontal pixel, and *idem* with vertical. This means that the whole map is about 1000x1000 pixels big and won't fit in our HTML container. Luckily, we can set `minZoom` to values lower than zero:
+
+ var map = L.map('map', {
+ crs: L.CRS.Simple,
+ minZoom: -5
+ });
+
+### Pixels vs. map units
+
+One common mistake when using `CRS.Simple` is assuming that the map units equal image pixels. In this case, the map covers 1000x1000 units, but the image is 2315x2315 pixels big. Different cases will call for one pixel = one map unit, or 64 pixels = one map unit, or anything. **Think in map units** in a grid, and then add your layers (`L.ImageOverlay`s, `L.Marker`s and so on) accordingly.
+
+In fact, the image we're using covers more than 1000 map units - there is a sizable margin. Measuring how many pixels there are between the 0 and 1000 coordinates, and extrapolating, we can have the right coordinate bounds for this image:
+
+ var bounds = [[-26.5,-25], [1021.5,1023]];
+ var image = L.imageOverlay('uqm_map_full.png', bounds).addTo(map);
+
+While we're at it, let's add some markers:
+
+ var sol = L.latLng([ 145, 175.2 ]);
+ L.marker(sol).addTo(map);
+ map.setView( [70, 120], 1);
+
+{% include frame.html url="crs-simple-example2.html" %}
+
+### This is not the `LatLng` you're looking for
+
+You'll notice that Sol is at coordinates `[145,175]` instead of `[175,145]`, and the same happens with the map center. Coordinates in `CRS.Simple` take the form of `[y, x]` instead of `[x, y]`, in the same way Leaflet uses `[lat, lng]` instead of `[lng, lat]`.
+
+(In technical terms, Leaflet prefers to use [`[northing, easting]`](https://en.wikipedia.org/wiki/Easting_and_northing) over `[easting, northing]` - the first coordinate in a coordinate pair points "north" and the second points "east")
+
+The debate about whether `[lng, lat]` or `[lat, lng]` or `[y, x]` or `[x, y]` [is not new, and there is no clear consensus](http://www.macwright.org/lonlat/). This lack of consensus is why Leaflet has a class named `L.LatLng` instead of the more confusion-prone `L.Coordinate`.
+
+If working with `[y, x]` coordinates with something named `L.LatLng` doesn't make much sense to you, you can easily create wrappers for them:
+
+ var yx = L.latLng;
+
+ var xy = function(x, y) {
+ if (L.Util.isArray(x)) { // When doing xy([x, y]);
+ return yx(x[1], x[0]);
+ }
+ return yx(y, x); // When doing xy(x, y);
+ };
+
+Now we can add a few stars and even a navigation line with `[x, y]` coordinates:
+
+ var sol = xy(175.2, 145.0);
+ var mizar = xy( 41.6, 130.1);
+ var kruegerZ = xy( 13.4, 56.5);
+ var deneb = xy(218.7, 8.3);
+
+ L.marker( sol).addTo(map).bindPopup( 'Sol');
+ L.marker( mizar).addTo(map).bindPopup( 'Mizar');
+ L.marker(kruegerZ).addTo(map).bindPopup('Krueger-Z');
+ L.marker( deneb).addTo(map).bindPopup( 'Deneb');
+
+ var travel = L.polyline([sol, deneb]).addTo(map);
+
+The map looks pretty much the same, but the code is a bit more readable:
+
+{% include frame.html url="crs-simple-example3.html" %}
diff --git a/src/public/Leaflet-1.7.1/docs/examples/crs-simple/thumbnail.png b/src/public/Leaflet-1.7.1/docs/examples/crs-simple/thumbnail.png
new file mode 100644
index 0000000..75f83b4
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/examples/crs-simple/thumbnail.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/examples/crs-simple/uqm_map_400px.png b/src/public/Leaflet-1.7.1/docs/examples/crs-simple/uqm_map_400px.png
new file mode 100644
index 0000000..0e66e8b
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/examples/crs-simple/uqm_map_400px.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/examples/crs-simple/uqm_map_detail.png b/src/public/Leaflet-1.7.1/docs/examples/crs-simple/uqm_map_detail.png
new file mode 100644
index 0000000..c2cb259
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/examples/crs-simple/uqm_map_detail.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/examples/crs-simple/uqm_map_full.png b/src/public/Leaflet-1.7.1/docs/examples/crs-simple/uqm_map_full.png
new file mode 100644
index 0000000..21bf606
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/examples/crs-simple/uqm_map_full.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/examples/custom-icons-example.md b/src/public/Leaflet-1.7.1/docs/examples/custom-icons-example.md
new file mode 100644
index 0000000..1490675
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/custom-icons-example.md
@@ -0,0 +1,5 @@
+---
+layout: redirected
+sitemap: false
+redirect_to: custom-icons/example.html
+---
diff --git a/src/public/Leaflet-1.7.1/docs/examples/custom-icons.md b/src/public/Leaflet-1.7.1/docs/examples/custom-icons.md
new file mode 100644
index 0000000..3feb07a
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/custom-icons.md
@@ -0,0 +1,5 @@
+---
+layout: redirected
+sitemap: false
+redirect_to: custom-icons/
+---
diff --git a/src/public/Leaflet-1.7.1/docs/examples/custom-icons/example-one-icon.md b/src/public/Leaflet-1.7.1/docs/examples/custom-icons/example-one-icon.md
new file mode 100644
index 0000000..acd1bed
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/custom-icons/example-one-icon.md
@@ -0,0 +1,27 @@
+---
+layout: tutorial_frame
+title: Custom Icons Tutorial
+---
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/custom-icons/example.md b/src/public/Leaflet-1.7.1/docs/examples/custom-icons/example.md
new file mode 100644
index 0000000..a7b72c0
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/custom-icons/example.md
@@ -0,0 +1,31 @@
+---
+layout: tutorial_frame
+title: Custom Icons Tutorial
+---
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/custom-icons/index.md b/src/public/Leaflet-1.7.1/docs/examples/custom-icons/index.md
new file mode 100644
index 0000000..17dede2
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/custom-icons/index.md
@@ -0,0 +1,79 @@
+---
+layout: tutorial_v2
+title: Markers With Custom Icons
+---
+
+## Markers With Custom Icons
+
+In this tutorial, you'll learn how to easily define your own icons for use by the markers you put on the map.
+
+{% include frame.html url="example.html" %}
+
+### Preparing the images
+
+To make a custom icon, we usually need two images --- the actual icon image and the image of its shadow. For this tutorial, we took the Leaflet logo and created four images out of it --- 3 leaf images of different colors and one shadow image for the three:
+
+
+
+
+
+
+
+
+Note that the white area in the images is actually transparent.
+
+### Creating an icon
+
+Marker icons in Leaflet are defined by [L.Icon](/reference.html#icon) objects, which are passed as an option when creating markers. Let's create a green leaf icon:
+
+ var greenIcon = L.icon({
+ iconUrl: 'leaf-green.png',
+ shadowUrl: 'leaf-shadow.png',
+
+ iconSize: [38, 95], // size of the icon
+ shadowSize: [50, 64], // size of the shadow
+ iconAnchor: [22, 94], // point of the icon which will correspond to marker's location
+ shadowAnchor: [4, 62], // the same for the shadow
+ popupAnchor: [-3, -76] // point from which the popup should open relative to the iconAnchor
+ });
+
+Now putting a marker with this icon on a map is easy:
+
+ L.marker([51.5, -0.09], {icon: greenIcon}).addTo(map);
+
+{% include frame.html url="example-one-icon.html" %}
+
+### Defining an icon class
+
+What if we need to create several icons that have lots in common? Let's define our own icon class containing the shared options, inheriting from `L.Icon`! It's really easy in Leaflet:
+
+ var LeafIcon = L.Icon.extend({
+ options: {
+ shadowUrl: 'leaf-shadow.png',
+ iconSize: [38, 95],
+ shadowSize: [50, 64],
+ iconAnchor: [22, 94],
+ shadowAnchor: [4, 62],
+ popupAnchor: [-3, -76]
+ }
+ });
+
+Now we can create all three of our leaf icons from this class and use them:
+
+ var greenIcon = new LeafIcon({iconUrl: 'leaf-green.png'}),
+ redIcon = new LeafIcon({iconUrl: 'leaf-red.png'}),
+ orangeIcon = new LeafIcon({iconUrl: 'leaf-orange.png'});
+
+You may have noticed that we used the `new` keyword for creating LeafIcon instances. So why do all Leaflet classes get created without it? The answer is simple: the real Leaflet classes are named with a capital letter (e.g. `L.Icon`), and they also need to be created with `new`, but there are also shortcuts with lowercase names (`L.icon`), created for convenience like this:
+
+ L.icon = function (options) {
+ return new L.Icon(options);
+ };
+
+You can do the same with your classes too. OK, let's finally put some markers with these icons on the map:
+
+ L.marker([51.5, -0.09], {icon: greenIcon}).addTo(map).bindPopup("I am a green leaf.");
+ L.marker([51.495, -0.083], {icon: redIcon}).addTo(map).bindPopup("I am a red leaf.");
+ L.marker([51.49, -0.1], {icon: orangeIcon}).addTo(map).bindPopup("I am an orange leaf.");
+
+That's it. Now take a look at the [full example](example.html), the [`L.Icon` docs](/reference.html#icon), or browse [other examples](../../examples.html).
diff --git a/src/public/Leaflet-1.7.1/docs/examples/custom-icons/leaf-green.png b/src/public/Leaflet-1.7.1/docs/examples/custom-icons/leaf-green.png
new file mode 100644
index 0000000..6c24f60
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/examples/custom-icons/leaf-green.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/examples/custom-icons/leaf-orange.png b/src/public/Leaflet-1.7.1/docs/examples/custom-icons/leaf-orange.png
new file mode 100644
index 0000000..a8a8f58
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/examples/custom-icons/leaf-orange.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/examples/custom-icons/leaf-red.png b/src/public/Leaflet-1.7.1/docs/examples/custom-icons/leaf-red.png
new file mode 100644
index 0000000..2763505
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/examples/custom-icons/leaf-red.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/examples/custom-icons/leaf-shadow.png b/src/public/Leaflet-1.7.1/docs/examples/custom-icons/leaf-shadow.png
new file mode 100644
index 0000000..6b979fa
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/examples/custom-icons/leaf-shadow.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/examples/custom-icons/thumbnail.png b/src/public/Leaflet-1.7.1/docs/examples/custom-icons/thumbnail.png
new file mode 100644
index 0000000..22b8446
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/examples/custom-icons/thumbnail.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/examples/extending/canvascircles.md b/src/public/Leaflet-1.7.1/docs/examples/extending/canvascircles.md
new file mode 100644
index 0000000..0758feb
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/extending/canvascircles.md
@@ -0,0 +1,37 @@
+---
+layout: tutorial_frame
+title: CanvasCircles
+---
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/extending/class-diagram.md b/src/public/Leaflet-1.7.1/docs/examples/extending/class-diagram.md
new file mode 100644
index 0000000..8150919
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/extending/class-diagram.md
@@ -0,0 +1,24 @@
+---
+layout: tutorial_frame
+title: Leaflet class diagram
+css: "#map {
+ width: 100vw;
+ height: 100%;
+ }"
+---
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/extending/class-diagram.png b/src/public/Leaflet-1.7.1/docs/examples/extending/class-diagram.png
new file mode 100644
index 0000000..ce8d2a8
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/examples/extending/class-diagram.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/examples/extending/class-diagram.txt b/src/public/Leaflet-1.7.1/docs/examples/extending/class-diagram.txt
new file mode 100644
index 0000000..32dcb81
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/extending/class-diagram.txt
@@ -0,0 +1,100 @@
+
+// Class inheritances in a format that
+// http://www.yuml.me/diagram/class/draw
+// understands and draws things from
+
+
+[L.Util]
+[L.Browser]
+[L.LatLng|lat;lng]
+[L.LatLngBounds] has 2 -.-> [L.LatLng]
+[L.Point|x;y]
+[L.Bounds] has 2 -.-> [L.Point]
+[L.DomUtil]
+[L.DomEvent]
+
+
+
+[L.Class|options|extend();include();initialize()]
+
+[L.Class] ^- [L.Control|onAdd();onRemove()]
+[L.Control] ^- [L.Control.Attribution;L.Control.Layers;L.Control.Scale;L.Control.Zoom]
+
+// L.Control] ^- L.Control.Attribution]
+// L.Control] ^- L.Control.Layers]
+// L.Control] ^- L.Control.Scale]
+// L.Control] ^- L.Control.Zoom]
+
+
+[L.Class] ^- [L.Evented]
+[L.Evented|on();off();fire()]
+
+
+[L.CRS] ^- [L.CRS.Earth]
+[L.CRS] ^- [L.CRS.Simple]
+[L.CRS.Earth] ^- [L.CRS.EPSG3395;L.CRS.EPSG3857;L.CRS.EPSG4326]
+
+// L.CRS] ^- L.CRS.Earth]
+// L.CRS] ^- L.CRS.Simple]
+// L.CRS.Earth] ^- L.CRS.EPSG3395]
+// L.CRS.Earth] ^- L.CRS.EPSG3857]
+// L.CRS.EPSG3857] ^- L.CRS.EPSG900913]
+// L.CRS.Earth] ^- L.CRS.EPSG4326]
+
+[L.Evented] ^- [L.Layer]
+
+[L.Layer|onAdd();onRemove();getEvents();getAttribution();beforeAdd()]
+
+[L.Evented] ^- [L.Map|addHandler();addControl();removeControl();addLayer();removeLayer()]
+[L.Map] contains -.-> [L.Layer]
+[L.Map] contains -.-> [L.Control]
+[L.Map] contains -.-> [L.Handler]
+[L.Map] has one -.-> [L.CRS]
+
+[L.Class] ^- [L.Handler|addHooks();removeHooks()]
+[L.Handler] ^- [L.Map.BoxZoom;L.Map.DoubleClickZoom;L.Map.Drag;L.Map.Keyboard;L.Map.ScrollWheelZoom;L.Map.Tap;L.Map.TouchZoom]
+
+// L.Handler] ^- L.Map.BoxZoom]
+// L.Handler] ^- L.Map.DoubleClickZoom]
+// L.Handler] ^- L.Map.Drag]
+// L.Handler] ^- L.Map.Keyboard]
+// L.Handler] ^- L.Map.ScrollWheelZoom]
+// L.Handler] ^- L.Map.Tap]
+// L.Handler] ^- L.Map.TouchZoom]
+
+[L.Layer] ^- [L.Marker]
+[L.Icon] ^- [L.Icon.Default]
+[L.Icon] ^- [L.DivIcon]
+
+[L.Marker] drawn as a -.-> [L.Icon]
+
+
+[L.Layer] ^- [L.GridLayer|createTile()]
+[L.GridLayer] ^- [L.TileLayer|getTileUrl()]
+[L.TileLayer] ^- [L.TileLayer.WMS]
+
+
+[L.Layer] ^- [L.Renderer]
+[L.Renderer] ^- [L.Canvas]
+[L.Renderer] ^- [L.SVG]
+
+[L.Layer] ^- [L.Path]
+[L.CircleMarker] ^- [L.Circle]
+[L.Path] ^- [L.CircleMarker]
+[L.Path] ^- [L.Polyline]
+[L.Polyline] ^- [L.Polygon]
+[L.Polygon] ^- [L.Rectangle]
+[L.Path] drawn in a -.-> [L.Renderer]
+
+
+[L.Layer] ^- [L.LayerGroup]
+[L.LayerGroup] ^- [L.FeatureGroup]
+[L.FeatureGroup] ^- [L.GeoJSON]
+
+[L.Layer] ^- [L.DivOverlay]
+[L.DivOverlay] ^- [L.Popup]
+[L.DivOverlay] ^- [L.Tooltip]
+
+[L.Layer] ^- [L.ImageOverlay]
+
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/extending/extending-1-classes.md b/src/public/Leaflet-1.7.1/docs/examples/extending/extending-1-classes.md
new file mode 100644
index 0000000..c33fe68
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/extending/extending-1-classes.md
@@ -0,0 +1,196 @@
+---
+layout: tutorial_v2
+title: Extending Leaflet, Class Theory
+---
+
+## Extending Leaflet
+
+Leaflet has literally hundreds of plugins. These expand the capabilities of Leaflet: sometimes in a generic way, sometimes in a very use-case-specific way.
+
+Part of the reason there are so many plugins is that Leaflet is easy to extend. This tutorial will cover the most commonly used ways of doing so.
+
+Please note that this tutorial assumes you have a good grasp of:
+
+* [JavaScript](https://developer.mozilla.org/en-US/Learn/JavaScript)
+* [DOM handling](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Introduction)
+* [Object-oriented programming](https://en.wikipedia.org/wiki/Object-oriented_programming) (understanding concepts like classes, instances, inheritance, methods and properties)
+
+
+## Leaflet architecture
+
+Let's have a look at a simplified UML Class diagram for Leaflet 1.0.0. There are more than 60 JavaScript classes, so the diagram is a bit big. Luckily we can make a zoomable image with a `L.ImageOverlay`:
+
+{% include frame.html url="class-diagram.html" %}
+
+
+From a technical point of view, Leaflet can be extended in different ways:
+
+* The most common: creating a new subclass of `L.Layer`, `L.Handler` or `L.Control`, with `L.Class.extend()`
+ * Layers move when the map is moved/zoomed
+ * Handlers are invisible and interpret browser events
+ * Controls are fixed interface elements
+* Including more functionality in an existing class with `L.Class.include()`
+ * Adding new methods and options
+ * Changing some methods
+ * Using `addInitHook` to run extra constructor code.
+* Changing parts of an existing class (replacing how a class method works) with `L.Class.include()`.
+
+This tutorial covers some classes and methods available only in Leaflet 1.0.0. Use caution if you are developing a plugin for a previous version.
+
+## `L.Class`
+
+JavaScript is a bit of a weird language. It's not really an object-oriented language, but rather a [prototype-oriented language](https://en.wikipedia.org/wiki/Prototype-based_programming). This has made JavaScript historically difficult to use class inheritance in the classic OOP meaning of the term.
+
+Leaflet works around this by having `L.Class`, which eases up class inheritance.
+
+Even though modern JavaScript can use ES6 classes, Leaflet is not designed around them.
+
+### `L.Class.extend()`
+
+In order to create a subclass of anything in Leaflet, use the `.extend()` method. This accepts one parameter: a plain object with key-value pairs, each key being the name of a property or method, and each value being the initial value of a property, or the implementation of a method:
+
+ var MyDemoClass = L.Class.extend({
+
+ // A property with initial value = 42
+ myDemoProperty: 42,
+
+ // A method
+ myDemoMethod: function() { return this.myDemoProperty; }
+
+ });
+
+ var myDemoInstance = new MyDemoClass();
+
+ // This will output "42" to the development console
+ console.log( myDemoInstance.myDemoMethod() );
+
+When naming classes, methods and properties, adhere to the following conventions:
+
+* Function, method, property and factory names should be in [`lowerCamelCase`](https://en.wikipedia.org/wiki/CamelCase).
+* Class names should be in [`UpperCamelCase`](https://en.wikipedia.org/wiki/CamelCase).
+* Private properties and methods start with an underscore (`_`). This doesn't make them private, just recommends developers not to use them directly.
+
+### `L.Class.include()`
+
+If a class is already defined, existing properties/methods can be redefined, or new ones can be added by using `.include()`:
+
+ MyDemoClass.include({
+
+ // Adding a new property to the class
+ _myPrivateProperty: 78,
+
+ // Redefining a method
+ myDemoMethod: function() { return this._myPrivateProperty; }
+
+ });
+
+ var mySecondDemoInstance = new MyDemoClass();
+
+ // This will output "78"
+ console.log( mySecondDemoInstance.myDemoMethod() );
+
+ // However, properties and methods from before still exist
+ // This will output "42"
+ console.log( mySecondDemoInstance.myDemoProperty );
+
+### `L.Class.initialize()`
+
+In OOP, classes have a constructor method. In Leaflet's `L.Class`, the constructor method is always named `initialize`.
+
+If your class has some specific `options`, it's a good idea to initialize them with `L.setOptions()` in the constructor. This utility function will merge the provided options with the default options of the class.
+
+
+ var MyBoxClass = L.Class.extend({
+
+ options: {
+ width: 1,
+ height: 1
+ },
+
+ initialize: function(name, options) {
+ this.name = name;
+ L.setOptions(this, options);
+ }
+
+ });
+
+ var instance = new MyBoxClass('Red', {width: 10});
+
+ console.log(instance.name); // Outputs "Red"
+ console.log(instance.options.width); // Outputs "10"
+ console.log(instance.options.height); // Outputs "1", the default
+
+Leaflet handles the `options` property in a special way: options available for a parent class will be inherited by a children class:.
+
+ var MyCubeClass = MyBoxClass.extend({
+ options: {
+ depth: 1
+ }
+ });
+
+ var instance = new MyCubeClass('Blue');
+
+ console.log(instance.options.width); // Outputs "1", parent class default
+ console.log(instance.options.height); // Outputs "1", parent class default
+ console.log(instance.options.depth); // Outputs "1"
+
+
+It's quite common for child classes to run the parent's constructor, and then their own constructor. In Leaflet this is achieved using `L.Class.addInitHook()`. This method can be used to "hook" initialization functions that run right after the class' `initialize()`, for example:
+
+ MyBoxClass.addInitHook(function(){
+ this._area = this.options.width * this.options.length;
+ });
+
+That will run after `initialize()` is called (which calls `setOptions()`). This means that `this.options` exist and is valid when the init hook runs.
+
+`addInitHook` has an alternate syntax, which uses method names and can fill method arguments in:
+
+ MyCubeClass.include({
+ _calculateVolume: function(arg1, arg2) {
+ this._volume = this.options.width * this.options.length * this.options.depth;
+ }
+ });
+
+ MyCubeClass.addInitHook('_calculateVolume', argValue1, argValue2);
+
+
+### Methods of the parent class
+
+Calling a method of a parent class is achieved by reaching into the prototype of the parent class and using [`Function.call(…)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call). This can be seen, for example, in the code for `L.FeatureGroup`:
+
+ L.FeatureGroup = L.LayerGroup.extend({
+
+ addLayer: function (layer) {
+ …
+ L.LayerGroup.prototype.addLayer.call(this, layer);
+ },
+
+ removeLayer: function (layer) {
+ …
+ L.LayerGroup.prototype.removeLayer.call(this, layer);
+ },
+
+ …
+ });
+
+Calling the parent's constructor is done in a similar way, but using `ParentClass.prototype.initialize.call(this, …)` instead.
+
+
+### Factories
+
+Most Leaflet classes have a corresponding [factory function](https://en.wikipedia.org/wiki/Factory_%28object-oriented_programming%29). A factory function has the same name as the class, but in `lowerCamelCase` instead of `UpperCamelCase`:
+
+ function myBoxClass(name, options) {
+ return new MyBoxClass(name, options);
+ }
+
+
+### Naming conventions
+
+When naming classes for Leaflet plugins, please adhere to the following naming conventions:
+
+* Never expose global variables in your plugin.
+* If you have a new class, put it directly in the `L` namespace (`L.MyPlugin`).
+* If you inherit one of the existing classes, make it a sub-property (`L.TileLayer.Banana`).
+
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/extending/extending-2-layers.md b/src/public/Leaflet-1.7.1/docs/examples/extending/extending-2-layers.md
new file mode 100644
index 0000000..1f01779
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/extending/extending-2-layers.md
@@ -0,0 +1,210 @@
+---
+layout: tutorial_v2
+title: Extending Leaflet, New Layers
+---
+
+
+
+This tutorial assumes you've read the [theory of Leaflet class inheritance](./extending-1-classes.html).
+
+In Leaflet, a "layer" is anything that moves around when the map is moved around. Before seeing how to create them from scratch, it's easier to explain how to do simple extensions.
+
+## "Extension methods"
+
+A few of the Leaflet classes have so-called "extension methods": entry points for writing code for sub-classes.
+
+One of them is `L.TileLayer.getTileUrl()`. This method is called internally by `L.TileLayer` whenever a new tile needs to know which image to load. By making a subclass of `L.TileLayer` and rewriting its `getTileUrl()` function, we can create custom behaviour.
+
+Let's illustrate with a custom `L.TileLayer` that will display random kitten images from [PlaceKitten]():
+
+ L.TileLayer.Kitten = L.TileLayer.extend({
+ getTileUrl: function(coords) {
+ var i = Math.ceil( Math.random() * 4 );
+ return "https://placekitten.com/256/256?image=" + i;
+ },
+ getAttribution: function() {
+ return "PlaceKitten "
+ }
+ });
+
+ L.tileLayer.kitten = function() {
+ return new L.TileLayer.Kitten();
+ }
+
+ L.tileLayer.kitten().addTo(map);
+
+{% include frame.html url="kittenlayer.html" %}
+
+Normally, `getTileUrl()` receives the tile coordinates (as `coords.x`, `coords.y` and `coords.z`) and generates a tile URL from them. In our example, we ignore those and simply use a random number to get a different kitten every time.
+
+### Splitting away the plugin code
+
+In the previous example, `L.TileLayer.Kitten` is defined in the same place as it's used. For plugins, it's better to split the plugin code into its own file, and include that file when it's used.
+
+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 "https://placekitten.com/256/256?image=" + i;
+ },
+ getAttribution: function() {
+ return "PlaceKitten "
+ }
+ });
+
+And then, include that file when showing a map:
+
+
+ …
+
+ …
+
+
+### `L.GridLayer` and DOM elements
+
+Another extension method is `L.GridLayer.createTile()`. Where `L.TileLayer` assumes that there is a grid of images (as ` ` elements), `L.GridLayer` doesn't assume that - it allows creating grids of any kind of [HTML Elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element).
+
+`L.GridLayer` allows creating grids of ` `s, but grids of [``s](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div), [`
`es](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas) or [``s](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture) (or anything) are possible. `createTile()` just has to return an instance of [`HTMLElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) given the tile coordinates. Knowing how to manipulate elements in the [DOM](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Introduction) is important here: Leaflet expects instances of `HTMLElement`, so elements created with libraries like jQuery will be problematic.
+
+An example of a custom `GridLayer` is showing the tile coordinates in a ``. This is particularly useful when debugging the internals of Leaflet, and for understanding how the tile coordinates work:
+
+ L.GridLayer.DebugCoords = L.GridLayer.extend({
+ createTile: function (coords) {
+ var tile = document.createElement('div');
+ tile.innerHTML = [coords.x, coords.y, coords.z].join(', ');
+ tile.style.outline = '1px solid red';
+ return tile;
+ }
+ });
+
+ L.gridLayer.debugCoords = function(opts) {
+ return new L.GridLayer.DebugCoords(opts);
+ };
+
+ map.addLayer( L.gridLayer.debugCoords() );
+
+
+If the element has to do some asynchronous initialization, then use the second function parameter `done` and call it back when the tile is ready (for example, when an image has been fully loaded) or when there is an error. In here, we'll just delay the tiles artificially:
+
+ createTile: function (coords, done) {
+ var tile = document.createElement('div');
+ tile.innerHTML = [coords.x, coords.y, coords.z].join(', ');
+ tile.style.outline = '1px solid red';
+
+ setTimeout(function () {
+ done(null, tile); // Syntax is 'done(error, tile)'
+ }, 500 + Math.random() * 1500);
+
+ return tile;
+ }
+
+{% include frame.html url="gridcoords.html" %}
+
+With these custom `GridLayer`s, a plugin can have full control of the HTML elements that make up the grid. A few plugins already use `
`es in this way to do advanced rendering.
+
+A very basic `` `GridLayer` looks like:
+
+ L.GridLayer.CanvasCircles = L.GridLayer.extend({
+ createTile: function (coords) {
+ var tile = document.createElement('canvas');
+
+ var tileSize = this.getTileSize();
+ tile.setAttribute('width', tileSize.x);
+ tile.setAttribute('height', tileSize.y);
+
+ var ctx = tile.getContext('2d');
+
+ // Draw whatever is needed in the canvas context
+ // For example, circles which get bigger as we zoom in
+ ctx.beginPath();
+ ctx.arc(tileSize.x/2, tileSize.x/2, 4 + coords.z*4, 0, 2*Math.PI, false);
+ ctx.fill();
+
+ return tile;
+ }
+ });
+
+{% include frame.html url="canvascircles.html" %}
+
+
+## The pixel origin
+
+Creating custom `L.Layer`s is possible, but needs a deeper knowledge of how Leaflet positions HTML elements. The abridged version is:
+
+* The `L.Map` container has "map panes", which are ``s.
+* `L.Layer`s are HTML elements inside a map pane
+* The map transforms all `LatLng`s to coordinates in the map's CRS, and from that into absolute "pixel coordinates" (the origin of the CRS is the same as the origin of the pixel coordinates)
+* When the `L.Map` is ready (has a center `LatLng` and a zoom level), the absolute pixel coordinates of the top-left corner become the "pixel origin"
+* Each `L.Layer` is offset from its map pane according to the pixel origin and the absolute pixel coordinates of the layer's `LatLng`s
+* The pixel origin is reset after each `zoomend` or `viewreset` event on the `L.Map`, and every `L.Layer` has to recalculate its position (if needed)
+* The pixel origin is *not* reset when panning the map around; instead, the whole panes are repositioned.
+
+This might be a bit overwhelming, so consider the following explanatory map:
+
+{% include frame.html url="pixelorigin.html" %}
+
+The CRS origin (green) stays in the same `LatLng`. The pixel origin (red) always starts at the top-left corner. The pixel origin moves around when the map is panned (map panes are repositioned relative to the map's container), and stays in the same place in the screen when zooming (map panes are *not* repositioned, but layers might redraw themselves). The absolute pixel coordinate to the pixel origin is updated when zooming, but is not updated when panning. Note how the absolute pixel coordinates (the distance to the green bracket) double every time the map is zoomed in.
+
+To position anything (for example, a blue `L.Marker`), its `LatLng` is converted to an absolute pixel coordinate inside the map's `L.CRS`. Then the absolute pixel coordinate of the pixel origin is subtracted from its absolute pixel coordinate, giving an offset relative to the pixel origin (light blue). As the pixel origin is the top-left corner of all map panes, this offset can be applied to the HTML element of the marker's icon. The marker's `iconAnchor` (dark blue line) is achieved via negative CSS margins.
+
+The `L.Map.project()` and `L.Map.unproject()` methods operate with these absolute pixel coordinates. Likewise, `L.Map.latLngToLayerPoint()` and `L.Map.layerPointToLatLng()` work with the offset relative to the pixel origin.
+
+Different layers apply these calculations in different ways. `L.Marker`s simply reposition their icons; `L.GridLayer`s calculate the bounds of the map (in absolute pixel coordinates) and then calculate the list of tile coordinates to request; vector layers (polylines, polygons, circle markers, etc) transform each `LatLng` to pixels and draw the geometries using SVG or `
`.
+
+
+### `onAdd` and `onRemove`
+
+At their core, all `L.Layer`s are HTML elements inside a map pane, their positions and contents defined by the layer's code. However, HTML elements cannot be created when a layer is instantiated; rather, this is done when the layer is added to the map - the layer doesn't know about the map (or even about the `document`) until then.
+
+In other words: the map calls the `onAdd()` method of the layer, then the layer creates its HTML element(s) (commonly named 'container' element) and adds them to the map pane. Conversely, when the layer is removed from the map, its `onRemove()` method is called. The layer must update its contents when added to the map, and reposition them when the map view is updated. A layer skeleton looks like:
+
+ L.CustomLayer = L.Layer.extend({
+ onAdd: function(map) {
+ var pane = map.getPane(this.options.pane);
+ this._container = L.DomUtil.create(…);
+
+ pane.appendChild(this._container);
+
+ // Calculate initial position of container with `L.Map.latLngToLayerPoint()`, `getPixelOrigin()` and/or `getPixelBounds()`
+
+ L.DomUtil.setPosition(this._container, point);
+
+ // Add and position children elements if needed
+
+ map.on('zoomend viewreset', this._update, this);
+ },
+
+ onRemove: function(map) {
+ L.DomUtil.remove(this._container);
+ map.off('zoomend viewreset', this._update, this);
+ },
+
+ _update: function() {
+ // Recalculate position of container
+
+ L.DomUtil.setPosition(this._container, point);
+
+ // Add/remove/reposition children elements if needed
+ }
+ });
+
+How to exactly position the HTML elements for a layer depends on the specifics of the layer, but this introduction should help you to read Leaflet's layer code, and create new layers.
+
+### Using the parent's `onAdd`
+
+Some use cases don't need the whole `onAdd` code to be recreated, but instead the code for the parent can be reused, then some specifics can be added before _or_ after that initialization (as needed).
+
+To give an example, we can have a subclass of `L.Polyline` that will always be red (ignoring the options), like:
+
+ L.Polyline.Red = L.Polyline.extend({
+ onAdd: function(map) {
+ this.options.color = 'red';
+ L.Polyline.prototype.onAdd.call(this, map);
+ }
+ });
diff --git a/src/public/Leaflet-1.7.1/docs/examples/extending/extending-3-controls.md b/src/public/Leaflet-1.7.1/docs/examples/extending/extending-3-controls.md
new file mode 100644
index 0000000..166d5bf
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/extending/extending-3-controls.md
@@ -0,0 +1,100 @@
+---
+layout: tutorial_v2
+title: Extending Leaflet, New Handlers and Controls
+---
+
+
+
+This tutorial assumes you've read the [theory of Leaflet class inheritance](./extending-1-classes.html).
+
+In Leaflet, a "layer" is anything that moves with the map. In contraposition to that, a "control" is a HTML element that remains static relative to the map container, and a "handler" is a piece of invisible code that changes the map's behaviour.
+
+## Handlers
+
+Map handlers are a new concept in Leaflet 1.0, and their function is to process DOM events from the browser (like `click`, `dblclick` or `mousewheel`) and change the state of the map.
+
+Handlers are relatively simple: they just need an `addHooks()` method (which runs when the handler is enabled in a map) and a `removeHooks()`, which runs when the handler is disabled. A skeleton for handlers is:
+
+ L.CustomHandler = L.Handler.extend({
+ addHooks: function() {
+ L.DomEvent.on(document, 'eventname', this._doSomething, this);
+ },
+
+ removeHooks: function() {
+ L.DomEvent.off(document, 'eventname', this._doSomething, this);
+ },
+
+ _doSomething: function(event) { … }
+ });
+
+This can be illustrated with a simple handler to pan the map when a mobile device is tilted, through [`deviceorientation` events](https://developer.mozilla.org/en-US/docs/Web/API/Detecting_device_orientation):
+
+ L.TiltHandler = L.Handler.extend({
+ addHooks: function() {
+ L.DomEvent.on(window, 'deviceorientation', this._tilt, this);
+ },
+
+ removeHooks: function() {
+ L.DomEvent.off(window, 'deviceorientation', this._tilt, this);
+ },
+
+ _tilt: function(ev) {
+ // Treat Gamma angle as horizontal pan (1 degree = 1 pixel) and Beta angle as vertical pan
+ this._map.panBy( L.point( ev.gamma, ev.beta ) );
+ }
+ });
+
+The handler can be attached to the map using `map.addHandler('tilt', L.TiltHandler)` - this will store an instance of `L.TiltHandler` as `map.tilt`. However, it's more usual to attach handlers to all maps with the `addInitHook` syntax:
+
+ L.Map.addInitHook('addHandler', 'tilt', L.TiltHandler);
+
+Our handler can now be enabled by running `map.tilt.enable()` and disabled by `map.tilt.disable()`
+
+Moreover, if the map has a property named the same as the handler, then that handler will be enabled by default if that options is `true`, so this will enable our handler by default:
+
+ var map = L.map('mapDiv', { tilt: true });
+
+To see this example, you'll need a mobile browser which [supports the `deviceorientation` event](http://caniuse.com/#search=deviceorientation) - and even so, this event is particularly flaky and ill-specified, so beware.
+
+{% include frame.html url="tilt.html" %}
+
+Depending on the type of event, a map handler can attach event listeners to the `document`, the `window`, or the container of the `L.Map` it's attached to.
+
+## Controls
+
+You already know controls - the zoom control in the top left corner, the scale at the bottom left, the layer switcher at the top right. At their core, an `L.Control` is an HTML Element that is at a static position in the map container.
+
+To make a control, simply inherit from `L.Control` and implement `onAdd()` and `onRemove()`. These methods work in a similar way to their `L.Layer` counterparts (they run whenever the control is added to or removed from the map), except that `onAdd()` must return an instance of `HTMLElement` representing the control. Adding the element to the map is done automatically, and so is removing it.
+
+The simplest example of a custom control would be a watermark, which is just an image:
+
+ L.Control.Watermark = L.Control.extend({
+ onAdd: function(map) {
+ var img = L.DomUtil.create('img');
+
+ img.src = '../../docs/images/logo.png';
+ img.style.width = '200px';
+
+ return img;
+ },
+
+ onRemove: function(map) {
+ // Nothing to do here
+ }
+ });
+
+ L.control.watermark = function(opts) {
+ return new L.Control.Watermark(opts);
+ }
+
+ L.control.watermark({ position: 'bottomleft' }).addTo(map);
+
+{% include frame.html url="watermark.html" %}
+
+If your custom control has interactive elements such as clickable buttons, remember to use `L.DomEvent.on()` inside `onAdd()` and `L.DomEvent.off()` inside `onRemove()`.
+
+If your custom control consists of more than one HTML element (like `L.Control.Zoom`, which has two buttons), you'll have to create the whole hierarchy of elements and return the topmost container.
+
+## Publishing your plugin
+
+If you have understood everything so far, you're ready to make some Leaflet plugins! But make sure to read the [`PLUGIN-GUIDE.md` file](https://github.com/Leaflet/Leaflet/blob/master/PLUGIN-GUIDE.md), as it contains some tips and good practices about naming and publishing your plugin.
diff --git a/src/public/Leaflet-1.7.1/docs/examples/extending/gridcoords.md b/src/public/Leaflet-1.7.1/docs/examples/extending/gridcoords.md
new file mode 100644
index 0000000..9f4783e
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/extending/gridcoords.md
@@ -0,0 +1,32 @@
+---
+layout: tutorial_frame
+title: Grid coordinates
+---
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/extending/kittenlayer.md b/src/public/Leaflet-1.7.1/docs/examples/extending/kittenlayer.md
new file mode 100644
index 0000000..b28e169
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/extending/kittenlayer.md
@@ -0,0 +1,29 @@
+---
+layout: tutorial_frame
+title: KittenLayer
+---
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/extending/pixelorigin.md b/src/public/Leaflet-1.7.1/docs/examples/extending/pixelorigin.md
new file mode 100644
index 0000000..9679672
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/extending/pixelorigin.md
@@ -0,0 +1,90 @@
+---
+layout: tutorial_frame
+title: Grid coordinates
+---
+
+
+
+
+
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/extending/thumbnail-1.png b/src/public/Leaflet-1.7.1/docs/examples/extending/thumbnail-1.png
new file mode 100644
index 0000000..40d4dc1
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/examples/extending/thumbnail-1.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/examples/extending/thumbnail-2.png b/src/public/Leaflet-1.7.1/docs/examples/extending/thumbnail-2.png
new file mode 100644
index 0000000..6130f2e
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/examples/extending/thumbnail-2.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/examples/extending/thumbnail-3.png b/src/public/Leaflet-1.7.1/docs/examples/extending/thumbnail-3.png
new file mode 100644
index 0000000..6981b9a
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/examples/extending/thumbnail-3.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/examples/extending/tilt.md b/src/public/Leaflet-1.7.1/docs/examples/extending/tilt.md
new file mode 100644
index 0000000..38286f5
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/extending/tilt.md
@@ -0,0 +1,66 @@
+---
+layout: tutorial_frame
+title: Tilt handler
+---
+
+
+
+
+
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/extending/watermark.md b/src/public/Leaflet-1.7.1/docs/examples/extending/watermark.md
new file mode 100644
index 0000000..7c4b3fd
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/extending/watermark.md
@@ -0,0 +1,36 @@
+---
+layout: tutorial_frame
+title: Watermark control
+---
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/geojson-example.md b/src/public/Leaflet-1.7.1/docs/examples/geojson-example.md
new file mode 100644
index 0000000..99ed60d
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/geojson-example.md
@@ -0,0 +1,5 @@
+---
+layout: redirected
+sitemap: false
+redirect_to: geojson/example.html
+---
diff --git a/src/public/Leaflet-1.7.1/docs/examples/geojson.md b/src/public/Leaflet-1.7.1/docs/examples/geojson.md
new file mode 100644
index 0000000..ff22a2a
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/geojson.md
@@ -0,0 +1,5 @@
+---
+layout: redirected
+sitemap: false
+redirect_to: geojson/
+---
diff --git a/src/public/Leaflet-1.7.1/docs/examples/geojson/baseball-marker.png b/src/public/Leaflet-1.7.1/docs/examples/geojson/baseball-marker.png
new file mode 100644
index 0000000..8524de9
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/examples/geojson/baseball-marker.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/examples/geojson/example.md b/src/public/Leaflet-1.7.1/docs/examples/geojson/example.md
new file mode 100644
index 0000000..5b70e56
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/geojson/example.md
@@ -0,0 +1,80 @@
+---
+layout: tutorial_frame
+title: GeoJSON tutorial
+---
+
+
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/geojson/geojson-example.html b/src/public/Leaflet-1.7.1/docs/examples/geojson/geojson-example.html
new file mode 100644
index 0000000..95abfa5
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/geojson/geojson-example.html
@@ -0,0 +1,91 @@
+
+
+
+ Leaflet GeoJSON Example
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/geojson/geojson.html b/src/public/Leaflet-1.7.1/docs/examples/geojson/geojson.html
new file mode 100644
index 0000000..142a6a9
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/geojson/geojson.html
@@ -0,0 +1,285 @@
+---
+layout: tutorial
+title: Using GeoJSON with Leaflet
+---
+
+Using GeoJSON with Leaflet
+
+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 GeoJSON objects.
+
+
+
+
+
+
+View example on a separate page →
+
+About GeoJSON
+
+According to http://geojson.org :
+
+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.
+
+Leaflet supports all of the GeoJSON types above, but Features and FeatureCollections 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:
+
+var geojsonFeature = {
+ "type": "Feature",
+ "properties": {
+ "name": "Coors Field",
+ "amenity": "Baseball Stadium",
+ "popupContent": "This is where the Rockies play!"
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [-104.99404, 39.75621]
+ }
+};
+
+
+Beware of the switched order of latitude and longitude in GeoJSON; as per definition in [RFC 7946](https://tools.ietf.org/html/rfc7946) GeoJSON uses coordinates in (lon,lat) order instead of (lat,lon) that Leaflet uses.
+
+The GeoJSON layer
+
+GeoJSON objects are added to the map through a GeoJSON layer . To create it and add it to a map, we can use the following code:
+
+L.geoJson(geojsonFeature).addTo(map);
+
+GeoJSON objects may also be passed as an array of valid GeoJSON objects.
+
+var myLines = [{
+ "type": "LineString",
+ "coordinates": [[-100, 40], [-105, 45], [-110, 55]]
+}, {
+ "type": "LineString",
+ "coordinates": [[-105, 40], [-110, 45], [-115, 55]]
+}];
+
+
+Alternatively, we could create an empty GeoJSON layer and assign it to a variable so that we can add more features to it later.
+
+var myLayer = L.geoJson().addTo(map);
+myLayer.addData(geojsonFeature);
+
+
+Options
+
+style
+
+The style option can be used to style features two different ways. First, we can pass a simple object that styles all paths (polylines and polygons) the same way:
+
+var myLines = [{
+ "type": "LineString",
+ "coordinates": [[-100, 40], [-105, 45], [-110, 55]]
+}, {
+ "type": "LineString",
+ "coordinates": [[-105, 40], [-110, 45], [-115, 55]]
+}];
+
+var myStyle = {
+ "color": "#ff7800",
+ "weight": 5,
+ "opacity": 0.65
+};
+
+L.geoJson(myLines, {
+ style: myStyle
+}).addTo(map);
+
+Alternatively, we can pass a function that styles individual features based on their properties. In the example below we check the "party" property and style our polygons accordingly:
+
+var states = [{
+ "type": "Feature",
+ "properties": {"party": "Republican"},
+ "geometry": {
+ "type": "Polygon",
+ "coordinates": [[
+ [-104.05, 48.99],
+ [-97.22, 48.98],
+ [-96.58, 45.94],
+ [-104.03, 45.94],
+ [-104.05, 48.99]
+ ]]
+ }
+}, {
+ "type": "Feature",
+ "properties": {"party": "Democrat"},
+ "geometry": {
+ "type": "Polygon",
+ "coordinates": [[
+ [-109.05, 41.00],
+ [-102.06, 40.99],
+ [-102.03, 36.99],
+ [-109.04, 36.99],
+ [-109.05, 41.00]
+ ]]
+ }
+}];
+
+L.geoJson(states, {
+ style: function(feature) {
+ switch (feature.properties.party) {
+ case 'Republican': return {color: "#ff0000"};
+ case 'Democrat': return {color: "#0000ff"};
+ }
+ }
+}).addTo(map);
+
+pointToLayer
+
+Points are handled differently than polylines and polygons. By default simple markers are drawn for GeoJSON Points. We can alter this by passing a pointToLayer function in a GeoJSON options object when creating the GeoJSON layer. This function is passed a LatLng and should return an instance of ILayer, in this case likely a Marker or CircleMarker .
+
+Here we're using the pointToLayer option to create a CircleMarker:
+
+var geojsonMarkerOptions = {
+ radius: 8,
+ fillColor: "#ff7800",
+ color: "#000",
+ weight: 1,
+ opacity: 1,
+ fillOpacity: 0.8
+};
+
+L.geoJson(someGeojsonFeature, {
+ pointToLayer: function (feature, latlng) {
+ return L.circleMarker(latlng, geojsonMarkerOptions);
+ }
+}).addTo(map);
+
+We could also set the style property in this example — Leaflet is smart enough to apply styles to GeoJSON points if you create a vector layer like circle inside the pointToLayer function.
+
+onEachFeature
+
+The onEachFeature option is a function that gets called on each feature before adding it to a GeoJSON layer. A common reason to use this option is to attach a popup to features when they are clicked.
+
+function onEachFeature(feature, layer) {
+ // does this feature have a property named popupContent?
+ if (feature.properties && feature.properties.popupContent) {
+ layer.bindPopup(feature.properties.popupContent);
+ }
+}
+
+var geojsonFeature = {
+ "type": "Feature",
+ "properties": {
+ "name": "Coors Field",
+ "amenity": "Baseball Stadium",
+ "popupContent": "This is where the Rockies play!"
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [-104.99404, 39.75621]
+ }
+};
+
+L.geoJson(geojsonFeature, {
+ onEachFeature: onEachFeature
+}).addTo(map);
+
+filter
+
+The filter option can be used to control the visibility of GeoJSON features. To accomplish this we pass a function as the filter option. This function gets called for each feature in your GeoJSON layer, and gets passed the feature and the layer. You can then utilise the values in the feature's properties to control the visibility by returning true or false.
+
+In the example below "Busch Field" will not be shown on the map.
+
+var someFeatures = [{
+ "type": "Feature",
+ "properties": {
+ "name": "Coors Field",
+ "show_on_map": true
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [-104.99404, 39.75621]
+ }
+}, {
+ "type": "Feature",
+ "properties": {
+ "name": "Busch Field",
+ "show_on_map": false
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [-104.98404, 39.74621]
+ }
+}];
+
+L.geoJson(someFeatures, {
+ filter: function(feature, layer) {
+ return feature.properties.show_on_map;
+ }
+}).addTo(map);
+
+View the example page to see in detail what is possible with the GeoJSON layer.
diff --git a/src/public/Leaflet-1.7.1/docs/examples/geojson/index.md b/src/public/Leaflet-1.7.1/docs/examples/geojson/index.md
new file mode 100644
index 0000000..52c3db9
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/geojson/index.md
@@ -0,0 +1,205 @@
+---
+layout: tutorial_v2
+title: Using GeoJSON with Leaflet
+---
+
+Using GeoJSON with Leaflet
+
+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 GeoJSON objects.
+
+{% include frame.html url="example.html" %}
+
+About GeoJSON
+
+According to GeoJSON Specification (RFC 7946) :
+
+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.
+
+Leaflet supports all of the GeoJSON types above, but Features and FeatureCollections 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:
+
+var geojsonFeature = {
+ "type": "Feature",
+ "properties": {
+ "name": "Coors Field",
+ "amenity": "Baseball Stadium",
+ "popupContent": "This is where the Rockies play!"
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [-104.99404, 39.75621]
+ }
+};
+
+
+The GeoJSON layer
+
+GeoJSON objects are added to the map through a GeoJSON layer . To create it and add it to a map, we can use the following code:
+
+L.geoJSON(geojsonFeature).addTo(map);
+
+GeoJSON objects may also be passed as an array of valid GeoJSON objects.
+
+var myLines = [{
+ "type": "LineString",
+ "coordinates": [[-100, 40], [-105, 45], [-110, 55]]
+}, {
+ "type": "LineString",
+ "coordinates": [[-105, 40], [-110, 45], [-115, 55]]
+}];
+
+
+Alternatively, we could create an empty GeoJSON layer and assign it to a variable so that we can add more features to it later.
+
+var myLayer = L.geoJSON().addTo(map);
+myLayer.addData(geojsonFeature);
+
+
+Options
+
+style
+
+The style option can be used to style features two different ways. First, we can pass a simple object that styles all paths (polylines and polygons) the same way:
+
+var myLines = [{
+ "type": "LineString",
+ "coordinates": [[-100, 40], [-105, 45], [-110, 55]]
+}, {
+ "type": "LineString",
+ "coordinates": [[-105, 40], [-110, 45], [-115, 55]]
+}];
+
+var myStyle = {
+ "color": "#ff7800",
+ "weight": 5,
+ "opacity": 0.65
+};
+
+L.geoJSON(myLines, {
+ style: myStyle
+}).addTo(map);
+
+Alternatively, we can pass a function that styles individual features based on their properties. In the example below we check the "party" property and style our polygons accordingly:
+
+var states = [{
+ "type": "Feature",
+ "properties": {"party": "Republican"},
+ "geometry": {
+ "type": "Polygon",
+ "coordinates": [[
+ [-104.05, 48.99],
+ [-97.22, 48.98],
+ [-96.58, 45.94],
+ [-104.03, 45.94],
+ [-104.05, 48.99]
+ ]]
+ }
+}, {
+ "type": "Feature",
+ "properties": {"party": "Democrat"},
+ "geometry": {
+ "type": "Polygon",
+ "coordinates": [[
+ [-109.05, 41.00],
+ [-102.06, 40.99],
+ [-102.03, 36.99],
+ [-109.04, 36.99],
+ [-109.05, 41.00]
+ ]]
+ }
+}];
+
+L.geoJSON(states, {
+ style: function(feature) {
+ switch (feature.properties.party) {
+ case 'Republican': return {color: "#ff0000"};
+ case 'Democrat': return {color: "#0000ff"};
+ }
+ }
+}).addTo(map);
+
+pointToLayer
+
+Points are handled differently than polylines and polygons. By default simple markers are drawn for GeoJSON Points. We can alter this by passing a pointToLayer function in a GeoJSON options object when creating the GeoJSON layer. This function is passed a LatLng and should return an instance of ILayer, in this case likely a Marker or CircleMarker .
+
+Here we're using the pointToLayer option to create a CircleMarker:
+
+var geojsonMarkerOptions = {
+ radius: 8,
+ fillColor: "#ff7800",
+ color: "#000",
+ weight: 1,
+ opacity: 1,
+ fillOpacity: 0.8
+};
+
+L.geoJSON(someGeojsonFeature, {
+ pointToLayer: function (feature, latlng) {
+ return L.circleMarker(latlng, geojsonMarkerOptions);
+ }
+}).addTo(map);
+
+We could also set the style property in this example — Leaflet is smart enough to apply styles to GeoJSON points if you create a vector layer like circle inside the pointToLayer function.
+
+onEachFeature
+
+The onEachFeature option is a function that gets called on each feature before adding it to a GeoJSON layer. A common reason to use this option is to attach a popup to features when they are clicked.
+
+function onEachFeature(feature, layer) {
+ // does this feature have a property named popupContent?
+ if (feature.properties && feature.properties.popupContent) {
+ layer.bindPopup(feature.properties.popupContent);
+ }
+}
+
+var geojsonFeature = {
+ "type": "Feature",
+ "properties": {
+ "name": "Coors Field",
+ "amenity": "Baseball Stadium",
+ "popupContent": "This is where the Rockies play!"
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [-104.99404, 39.75621]
+ }
+};
+
+L.geoJSON(geojsonFeature, {
+ onEachFeature: onEachFeature
+}).addTo(map);
+
+filter
+
+The filter option can be used to control the visibility of GeoJSON features. To accomplish this we pass a function as the filter option. This function gets called for each feature in your GeoJSON layer, and gets passed the feature and the layer. You can then utilise the values in the feature's properties to control the visibility by returning true or false.
+
+In the example below "Busch Field" will not be shown on the map.
+
+var someFeatures = [{
+ "type": "Feature",
+ "properties": {
+ "name": "Coors Field",
+ "show_on_map": true
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [-104.99404, 39.75621]
+ }
+}, {
+ "type": "Feature",
+ "properties": {
+ "name": "Busch Field",
+ "show_on_map": false
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [-104.98404, 39.74621]
+ }
+}];
+
+L.geoJSON(someFeatures, {
+ filter: function(feature, layer) {
+ return feature.properties.show_on_map;
+ }
+}).addTo(map);
+
+View the example page to see in detail what is possible with the GeoJSON layer.
diff --git a/src/public/Leaflet-1.7.1/docs/examples/geojson/sample-geojson.js b/src/public/Leaflet-1.7.1/docs/examples/geojson/sample-geojson.js
new file mode 100644
index 0000000..ff6e25e
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/geojson/sample-geojson.js
@@ -0,0 +1,248 @@
+var freeBus = {
+ "type": "FeatureCollection",
+ "features": [
+ {
+ "type": "Feature",
+ "geometry": {
+ "type": "LineString",
+ "coordinates": [
+ [-105.00341892242432, 39.75383843460583],
+ [-105.0008225440979, 39.751891803969535]
+ ]
+ },
+ "properties": {
+ "popupContent": "This is a free bus line that will take you across downtown.",
+ "underConstruction": false
+ },
+ "id": 1
+ },
+ {
+ "type": "Feature",
+ "geometry": {
+ "type": "LineString",
+ "coordinates": [
+ [-105.0008225440979, 39.751891803969535],
+ [-104.99820470809937, 39.74979664004068]
+ ]
+ },
+ "properties": {
+ "popupContent": "This is a free bus line that will take you across downtown.",
+ "underConstruction": true
+ },
+ "id": 2
+ },
+ {
+ "type": "Feature",
+ "geometry": {
+ "type": "LineString",
+ "coordinates": [
+ [-104.99820470809937, 39.74979664004068],
+ [-104.98689651489258, 39.741052354709055]
+ ]
+ },
+ "properties": {
+ "popupContent": "This is a free bus line that will take you across downtown.",
+ "underConstruction": false
+ },
+ "id": 3
+ }
+ ]
+};
+
+var lightRailStop = {
+ "type": "FeatureCollection",
+ "features": [
+ {
+ "type": "Feature",
+ "properties": {
+ "popupContent": "18th & California Light Rail Stop"
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [-104.98999178409576, 39.74683938093904]
+ }
+ },{
+ "type": "Feature",
+ "properties": {
+ "popupContent": "20th & Welton Light Rail Stop"
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [-104.98689115047453, 39.747924136466565]
+ }
+ }
+ ]
+};
+
+var bicycleRental = {
+ "type": "FeatureCollection",
+ "features": [
+ {
+ "geometry": {
+ "type": "Point",
+ "coordinates": [
+ -104.9998241,
+ 39.7471494
+ ]
+ },
+ "type": "Feature",
+ "properties": {
+ "popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!"
+ },
+ "id": 51
+ },
+ {
+ "geometry": {
+ "type": "Point",
+ "coordinates": [
+ -104.9983545,
+ 39.7502833
+ ]
+ },
+ "type": "Feature",
+ "properties": {
+ "popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!"
+ },
+ "id": 52
+ },
+ {
+ "geometry": {
+ "type": "Point",
+ "coordinates": [
+ -104.9963919,
+ 39.7444271
+ ]
+ },
+ "type": "Feature",
+ "properties": {
+ "popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!"
+ },
+ "id": 54
+ },
+ {
+ "geometry": {
+ "type": "Point",
+ "coordinates": [
+ -104.9960754,
+ 39.7498956
+ ]
+ },
+ "type": "Feature",
+ "properties": {
+ "popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!"
+ },
+ "id": 55
+ },
+ {
+ "geometry": {
+ "type": "Point",
+ "coordinates": [
+ -104.9933717,
+ 39.7477264
+ ]
+ },
+ "type": "Feature",
+ "properties": {
+ "popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!"
+ },
+ "id": 57
+ },
+ {
+ "geometry": {
+ "type": "Point",
+ "coordinates": [
+ -104.9913392,
+ 39.7432392
+ ]
+ },
+ "type": "Feature",
+ "properties": {
+ "popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!"
+ },
+ "id": 58
+ },
+ {
+ "geometry": {
+ "type": "Point",
+ "coordinates": [
+ -104.9788452,
+ 39.6933755
+ ]
+ },
+ "type": "Feature",
+ "properties": {
+ "popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!"
+ },
+ "id": 74
+ }
+ ]
+};
+
+var campus = {
+ "type": "Feature",
+ "properties": {
+ "popupContent": "This is the Auraria West Campus",
+ "style": {
+ weight: 2,
+ color: "#999",
+ opacity: 1,
+ fillColor: "#B0DE5C",
+ fillOpacity: 0.8
+ }
+ },
+ "geometry": {
+ "type": "MultiPolygon",
+ "coordinates": [
+ [
+ [
+ [-105.00432014465332, 39.74732195489861],
+ [-105.00715255737305, 39.74620006835170],
+ [-105.00921249389647, 39.74468219277038],
+ [-105.01067161560059, 39.74362625960105],
+ [-105.01195907592773, 39.74290029616054],
+ [-105.00989913940431, 39.74078835902781],
+ [-105.00758171081543, 39.74059036160317],
+ [-105.00346183776855, 39.74059036160317],
+ [-105.00097274780272, 39.74059036160317],
+ [-105.00062942504881, 39.74072235994946],
+ [-105.00020027160645, 39.74191033368865],
+ [-105.00071525573731, 39.74276830198601],
+ [-105.00097274780272, 39.74369225589818],
+ [-105.00097274780272, 39.74461619742136],
+ [-105.00123023986816, 39.74534214278395],
+ [-105.00183105468751, 39.74613407445653],
+ [-105.00432014465332, 39.74732195489861]
+ ],[
+ [-105.00361204147337, 39.74354376414072],
+ [-105.00301122665405, 39.74278480127163],
+ [-105.00221729278564, 39.74316428375108],
+ [-105.00283956527711, 39.74390674342741],
+ [-105.00361204147337, 39.74354376414072]
+ ]
+ ],[
+ [
+ [-105.00942707061768, 39.73989736613708],
+ [-105.00942707061768, 39.73910536278566],
+ [-105.00685214996338, 39.73923736397631],
+ [-105.00384807586671, 39.73910536278566],
+ [-105.00174522399902, 39.73903936209552],
+ [-105.00041484832764, 39.73910536278566],
+ [-105.00041484832764, 39.73979836621592],
+ [-105.00535011291504, 39.73986436617916],
+ [-105.00942707061768, 39.73989736613708]
+ ]
+ ]
+ ]
+ }
+};
+
+var coorsField = {
+ "type": "Feature",
+ "properties": {
+ "popupContent": "Coors Field"
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [-104.99404191970824, 39.756213909328125]
+ }
+};
diff --git a/src/public/Leaflet-1.7.1/docs/examples/geojson/thumbnail.png b/src/public/Leaflet-1.7.1/docs/examples/geojson/thumbnail.png
new file mode 100644
index 0000000..5ec7058
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/examples/geojson/thumbnail.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/examples/layers-control-example.md b/src/public/Leaflet-1.7.1/docs/examples/layers-control-example.md
new file mode 100644
index 0000000..5fcb0fb
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/layers-control-example.md
@@ -0,0 +1,5 @@
+---
+layout: redirected
+sitemap: false
+redirect_to: layers-control/example.html
+---
diff --git a/src/public/Leaflet-1.7.1/docs/examples/layers-control.md b/src/public/Leaflet-1.7.1/docs/examples/layers-control.md
new file mode 100644
index 0000000..f2ca23d
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/layers-control.md
@@ -0,0 +1,5 @@
+---
+layout: redirected
+sitemap: false
+redirect_to: layers-control/
+---
diff --git a/src/public/Leaflet-1.7.1/docs/examples/layers-control/example.md b/src/public/Leaflet-1.7.1/docs/examples/layers-control/example.md
new file mode 100644
index 0000000..d9952b6
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/layers-control/example.md
@@ -0,0 +1,38 @@
+---
+layout: tutorial_frame
+title: Layers Control Tutorial
+---
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/layers-control/index.md b/src/public/Leaflet-1.7.1/docs/examples/layers-control/index.md
new file mode 100644
index 0000000..5aa394e
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/layers-control/index.md
@@ -0,0 +1,72 @@
+---
+layout: tutorial_v2
+title: Layer Groups and Layers Control
+---
+
+## Layer Groups and Layers Control
+
+This tutorial will show you how to group several layers into one, and how to use the layers control to allow users to easily switch different layers on your map.
+
+{% include frame.html url="example.html" %}
+
+### Layer Groups
+
+Let's suppose you have a bunch of layers you want to combine into a group to handle them as one in your code:
+
+ var littleton = L.marker([39.61, -105.02]).bindPopup('This is Littleton, CO.'),
+ denver = L.marker([39.74, -104.99]).bindPopup('This is Denver, CO.'),
+ aurora = L.marker([39.73, -104.8]).bindPopup('This is Aurora, CO.'),
+ golden = L.marker([39.77, -105.23]).bindPopup('This is Golden, CO.');
+
+Instead of adding them directly to the map, you can do the following, using the LayerGroup class:
+
+ var cities = L.layerGroup([littleton, denver, aurora, golden]);
+
+Easy enough! Now you have a `cities` layer that combines your city markers into one layer you can add or remove from the map at once.
+
+### Layers Control
+
+Leaflet has a nice little control that allows your users to control which layers they see on your map. In addition to showing you how to use it, we'll also show you another handy use for layer groups.
+
+There are two types of layers: (1) base layers that are mutually exclusive (only one can be visible on your map at a time), e.g. tile layers, and (2) overlays, which are all the other stuff you put over the base layers. In this example, we want to have two base layers (a grayscale and a colored base map) to switch between, and an overlay to switch on and off: the city markers we created earlier.
+
+Now let's create those base layers and add the default ones to the map:
+
+var grayscale = L.tileLayer(mapboxUrl, {id: 'MapID ', tileSize: 512, zoomOffset: -1, attribution: mapboxAttribution}),
+ streets = L.tileLayer(mapboxUrl, {id: 'MapID ', tileSize: 512, zoomOffset: -1, attribution: mapboxAttribution});
+
+var map = L.map('map', {
+ center: [39.73, -104.99],
+ zoom: 10,
+ layers: [grayscale, cities]
+});
+
+Next, we'll create two objects. One will contain our base layers and one will contain our overlays. These are just simple objects with key/value pairs. The key sets the text for the layer in the control (e.g. "Streets"), while the corresponding value is a reference to the layer (e.g. `streets`).
+
+var baseMaps = {
+ "Grayscale": grayscale,
+ "Streets": streets
+};
+
+var overlayMaps = {
+ "Cities": cities
+};
+
+Now, all that's left to do is to create a [Layers Control](/reference.html#control-layers) and add it to the map. The first argument passed when creating the layers control is the base layers object. The second argument is the overlays object. Both arguments are optional: you can pass just a base layers object by omitting the second argument, or just an overlays objects by passing `null` as the first argument. In each case, the omitted layer type will not appear for the user to select.
+
+L.control.layers(baseMaps, overlayMaps).addTo(map);
+
+Note that we added `grayscale` and `cities` layers to the map but didn't add `streets`. The layers control is smart enough to detect what layers we've already added and have corresponding checkboxes and radioboxes set.
+
+Also note that when using multiple base layers, only one of them should be added to the map at instantiation, but all of them should be present in the base layers object when creating the layers control.
+
+Finally, you can style the keys when you define the objects for the layers. For example, this code will make the label for the grayscale map gray:
+
+var baseMaps = {
+ "<span style='color: gray'>Grayscale</span>": grayscale,
+ "Streets": streets
+};
+
+
+Now let's [view the result on a separate page →](example.html)
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/layers-control/thumbnail.png b/src/public/Leaflet-1.7.1/docs/examples/layers-control/thumbnail.png
new file mode 100644
index 0000000..8ccc8a3
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/examples/layers-control/thumbnail.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/examples/map-panes-example.md b/src/public/Leaflet-1.7.1/docs/examples/map-panes-example.md
new file mode 100644
index 0000000..2fd6c9b
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/map-panes-example.md
@@ -0,0 +1,5 @@
+---
+layout: redirected
+sitemap: false
+redirect_to: map-panes/example.html
+---
diff --git a/src/public/Leaflet-1.7.1/docs/examples/map-panes.md b/src/public/Leaflet-1.7.1/docs/examples/map-panes.md
new file mode 100644
index 0000000..b44ec9e
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/map-panes.md
@@ -0,0 +1,5 @@
+---
+layout: redirected
+sitemap: false
+redirect_to: map-panes/
+---
diff --git a/src/public/Leaflet-1.7.1/docs/examples/map-panes/eu-countries.js b/src/public/Leaflet-1.7.1/docs/examples/map-panes/eu-countries.js
new file mode 100644
index 0000000..f400a72
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/map-panes/eu-countries.js
@@ -0,0 +1,79 @@
+var euCountries = {"type":"FeatureCollection","features":[
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":6,"sovereignt":"Albania","sov_a3":"ALB","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Albania","adm0_a3":"ALB","geou_dif":0,"geounit":"Albania","gu_a3":"ALB","su_dif":0,"subunit":"Albania","su_a3":"ALB","brk_diff":0,"name":"Albania","name_long":"Albania","brk_a3":"ALB","brk_name":"Albania","brk_group":null,"abbrev":"Alb.","postal":"AL","formal_en":"Republic of Albania","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Albania","name_alt":null,"mapcolor7":1,"mapcolor8":4,"mapcolor9":1,"mapcolor13":6,"pop_est":3639453,"gdp_md_est":21810,"pop_year":-99,"lastcensus":2001,"gdp_year":-99,"economy":"6. Developing region","income_grp":"4. Lower middle income","wikipedia":-99,"fips_10":null,"iso_a2":"AL","iso_a3":"ALB","iso_n3":"008","un_a3":"008","wb_a2":"AL","wb_a3":"ALB","woe_id":-99,"adm0_a3_is":"ALB","adm0_a3_us":"ALB","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Southern Europe","region_wb":"Europe & Central Asia","name_len":7,"long_len":7,"abbrev_len":4,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[20.59024743010491,41.855404161133606],[20.463175083099202,41.51508901627534],[20.605181919037364,41.086226304685226],[21.0200403174764,40.84272695572588],[20.999989861747224,40.58000397395398],[20.674996779063633,40.43499990494303],[20.615000441172754,40.11000682225938],[20.15001590341052,39.62499766698397],[19.980000441170148,39.69499339452341],[19.960001661873207,39.91500580500605],[19.406081984136733,40.250773423822466],[19.319058872157143,40.72723012955356],[19.40354983895429,41.40956574153546],[19.540027296637106,41.71998607031276],[19.37176883309496,41.877547512370654],[19.304486118250793,42.19574514420782],[19.73805138517963,42.68824738216557],[19.801613396898688,42.50009349219084],[20.0707,42.58863],[20.283754510181893,42.32025950781508],[20.52295,42.21787],[20.59024743010491,41.855404161133606]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":4,"sovereignt":"Austria","sov_a3":"AUT","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Austria","adm0_a3":"AUT","geou_dif":0,"geounit":"Austria","gu_a3":"AUT","su_dif":0,"subunit":"Austria","su_a3":"AUT","brk_diff":0,"name":"Austria","name_long":"Austria","brk_a3":"AUT","brk_name":"Austria","brk_group":null,"abbrev":"Aust.","postal":"A","formal_en":"Republic of Austria","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Austria","name_alt":null,"mapcolor7":3,"mapcolor8":1,"mapcolor9":3,"mapcolor13":4,"pop_est":8210281,"gdp_md_est":329500,"pop_year":-99,"lastcensus":2011,"gdp_year":-99,"economy":"2. Developed region: nonG7","income_grp":"1. High income: OECD","wikipedia":-99,"fips_10":null,"iso_a2":"AT","iso_a3":"AUT","iso_n3":"040","un_a3":"040","wb_a2":"AT","wb_a3":"AUT","woe_id":-99,"adm0_a3_is":"AUT","adm0_a3_us":"AUT","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Western Europe","region_wb":"Europe & Central Asia","name_len":7,"long_len":7,"abbrev_len":5,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[16.979666782304037,48.123497015976305],[16.90375410326726,47.71486562762833],[16.340584344150415,47.71290192320123],[16.534267612380376,47.49617096616912],[16.202298211337364,46.85238597267696],[16.011663852612656,46.6836107448117],[15.137091912504985,46.65870270444703],[14.63247155117483,46.43181732846955],[13.806475457421527,46.509306138691215],[12.376485223040817,46.76755910906985],[12.153088006243054,47.11539317482645],[11.16482791509327,46.94157949481273],[11.048555942436536,46.75135854754634],[10.44270145024663,46.89354625099743],[9.932448357796659,46.92072805438296],[9.479969516649021,47.102809963563374],[9.632931756232978,47.34760122332999],[9.59422610844635,47.52505809182027],[9.89606814946319,47.580196845075704],[10.402083774465211,47.30248769793916],[10.544504021861627,47.56639923765377],[11.426414015354737,47.523766181012974],[12.141357456112788,47.703083401065776],[12.620759718484493,47.67238760028441],[12.932626987365948,47.467645575544],[13.02585127122049,47.63758352313583],[12.884102817443903,48.28914581968792],[13.243357374737,48.416114813829054],[13.595945672264437,48.87717194273715],[14.338897739324722,48.55530528420721],[14.901447381254057,48.964401760445824],[15.253415561593982,49.03907420510758],[16.02964725105022,48.73389903420793],[16.499282667718774,48.78580801044511],[16.960288120194576,48.5969823268506],[16.879982944413,48.47001333270947],[16.979666782304037,48.123497015976305]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":2,"sovereignt":"Belgium","sov_a3":"BEL","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Belgium","adm0_a3":"BEL","geou_dif":0,"geounit":"Belgium","gu_a3":"BEL","su_dif":0,"subunit":"Belgium","su_a3":"BEL","brk_diff":0,"name":"Belgium","name_long":"Belgium","brk_a3":"BEL","brk_name":"Belgium","brk_group":null,"abbrev":"Belg.","postal":"B","formal_en":"Kingdom of Belgium","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Belgium","name_alt":null,"mapcolor7":3,"mapcolor8":2,"mapcolor9":1,"mapcolor13":8,"pop_est":10414336,"gdp_md_est":389300,"pop_year":-99,"lastcensus":2011,"gdp_year":-99,"economy":"2. Developed region: nonG7","income_grp":"1. High income: OECD","wikipedia":-99,"fips_10":null,"iso_a2":"BE","iso_a3":"BEL","iso_n3":"056","un_a3":"056","wb_a2":"BE","wb_a3":"BEL","woe_id":-99,"adm0_a3_is":"BEL","adm0_a3_us":"BEL","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Western Europe","region_wb":"Europe & Central Asia","name_len":7,"long_len":7,"abbrev_len":5,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[3.314971144228537,51.345780951536085],[4.047071160507528,51.26725861266857],[4.973991326526914,51.47502370869813],[5.606975945670001,51.03729848896978],[6.15665815595878,50.80372101501058],[6.043073357781111,50.128051662794235],[5.782417433300907,50.09032786722122],[5.674051954784829,49.529483547557504],[4.79922163251581,49.985373033236385],[4.286022983425084,49.907496649772554],[3.588184441755686,50.37899241800358],[3.123251580425801,50.780363267614575],[2.658422071960274,50.796848049515745],[2.513573032246143,51.14850617126183],[3.314971144228537,51.345780951536085]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":4,"sovereignt":"Bulgaria","sov_a3":"BGR","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Bulgaria","adm0_a3":"BGR","geou_dif":0,"geounit":"Bulgaria","gu_a3":"BGR","su_dif":0,"subunit":"Bulgaria","su_a3":"BGR","brk_diff":0,"name":"Bulgaria","name_long":"Bulgaria","brk_a3":"BGR","brk_name":"Bulgaria","brk_group":null,"abbrev":"Bulg.","postal":"BG","formal_en":"Republic of Bulgaria","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Bulgaria","name_alt":null,"mapcolor7":4,"mapcolor8":5,"mapcolor9":1,"mapcolor13":8,"pop_est":7204687,"gdp_md_est":93750,"pop_year":-99,"lastcensus":2011,"gdp_year":-99,"economy":"2. Developed region: nonG7","income_grp":"3. Upper middle income","wikipedia":-99,"fips_10":null,"iso_a2":"BG","iso_a3":"BGR","iso_n3":"100","un_a3":"100","wb_a2":"BG","wb_a3":"BGR","woe_id":-99,"adm0_a3_is":"BGR","adm0_a3_us":"BGR","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Eastern Europe","region_wb":"Europe & Central Asia","name_len":8,"long_len":8,"abbrev_len":5,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[22.65714969248299,44.23492300066128],[22.944832391051847,43.82378530534713],[23.332302280376325,43.897010809904714],[24.100679152124172,43.74105133724785],[25.569271681426926,43.68844472917472],[26.065158725699746,43.94349376075127],[27.242399529740908,44.175986029632405],[27.970107049275075,43.81246816667522],[28.558081495891997,43.70746165625813],[28.03909508638472,43.293171698574184],[27.67389773937805,42.57789236100622],[27.99672041190539,42.00735871028779],[27.13573937349048,42.14148489030134],[26.1170418637208,41.82690460872456],[26.106138136507212,41.32889883072778],[25.197201368925448,41.23448598893053],[24.492644891058035,41.583896185872035],[23.692073601992348,41.309080918943856],[22.952377150166452,41.33799388281115],[22.88137373219743,41.99929718685026],[22.380525750424592,42.32025950781509],[22.54501183440962,42.46136200618804],[22.43659467946128,42.580321153323936],[22.60480146657133,42.898518785161144],[22.986018507588483,43.211161200526966],[22.50015669118028,43.64281443946099],[22.410446404721597,44.008063462899955],[22.65714969248299,44.23492300066128]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":5,"sovereignt":"Bosnia and Herzegovina","sov_a3":"BIH","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Bosnia and Herzegovina","adm0_a3":"BIH","geou_dif":0,"geounit":"Bosnia and Herzegovina","gu_a3":"BIH","su_dif":0,"subunit":"Bosnia and Herzegovina","su_a3":"BIH","brk_diff":0,"name":"Bosnia and Herz.","name_long":"Bosnia and Herzegovina","brk_a3":"BIH","brk_name":"Bosnia and Herz.","brk_group":null,"abbrev":"B.H.","postal":"BiH","formal_en":"Bosnia and Herzegovina","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Bosnia and Herzegovina","name_alt":null,"mapcolor7":1,"mapcolor8":1,"mapcolor9":1,"mapcolor13":2,"pop_est":4613414,"gdp_md_est":29700,"pop_year":-99,"lastcensus":1991,"gdp_year":-99,"economy":"6. Developing region","income_grp":"3. Upper middle income","wikipedia":-99,"fips_10":null,"iso_a2":"BA","iso_a3":"BIH","iso_n3":"070","un_a3":"070","wb_a2":"BA","wb_a3":"BIH","woe_id":-99,"adm0_a3_is":"BIH","adm0_a3_us":"BIH","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Southern Europe","region_wb":"Europe & Central Asia","name_len":16,"long_len":22,"abbrev_len":4,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[19.00548628101012,44.86023366960916],[19.36803,44.863],[19.11761,44.42307000000011],[19.59976,44.03847],[19.454,43.56810000000013],[19.21852,43.52384],[19.03165,43.43253],[18.70648,43.20011],[18.56,42.65],[17.674921502358984,43.02856252702361],[17.297373488034452,43.44634064388737],[16.91615644701733,43.66772247982567],[16.456442905348865,44.04123973243128],[16.23966027188453,44.35114329688571],[15.750026075918981,44.818711656262565],[15.959367303133376,45.23377676043094],[16.318156772535872,45.00412669532591],[16.534939406000206,45.21160757097772],[17.002146030351014,45.23377676043094],[17.861783481526402,45.067740383477144],[18.553214145591653,45.08158966733146],[19.00548628101012,44.86023366960916]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":4,"sovereignt":"Belarus","sov_a3":"BLR","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Belarus","adm0_a3":"BLR","geou_dif":0,"geounit":"Belarus","gu_a3":"BLR","su_dif":0,"subunit":"Belarus","su_a3":"BLR","brk_diff":0,"name":"Belarus","name_long":"Belarus","brk_a3":"BLR","brk_name":"Belarus","brk_group":null,"abbrev":"Bela.","postal":"BY","formal_en":"Republic of Belarus","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Belarus","name_alt":null,"mapcolor7":1,"mapcolor8":1,"mapcolor9":5,"mapcolor13":11,"pop_est":9648533,"gdp_md_est":114100,"pop_year":-99,"lastcensus":2009,"gdp_year":-99,"economy":"6. Developing region","income_grp":"3. Upper middle income","wikipedia":-99,"fips_10":null,"iso_a2":"BY","iso_a3":"BLR","iso_n3":"112","un_a3":"112","wb_a2":"BY","wb_a3":"BLR","woe_id":-99,"adm0_a3_is":"BLR","adm0_a3_us":"BLR","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Eastern Europe","region_wb":"Europe & Central Asia","name_len":7,"long_len":7,"abbrev_len":5,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[23.48412763844985,53.91249766704114],[24.450683628037037,53.905702216194754],[25.536353794056993,54.28242340760253],[25.7684326514798,54.84696259217509],[26.58827924979039,55.16717560487167],[26.494331495883756,55.615106919977634],[27.10245975109453,55.783313707087686],[28.176709425577997,56.169129950578814],[29.229513380660308,55.91834422466636],[29.371571893030673,55.670090643936184],[29.896294386522356,55.78946320253041],[30.87390913262001,55.55097646750341],[30.971835971813135,55.08154775656404],[30.75753380709872,54.81177094178432],[31.38447228366374,54.157056382862436],[31.79142418796224,53.974638576872124],[31.731272820774507,53.79402944601202],[32.405598585751164,53.61804535584204],[32.69364301934604,53.35142080343212],[32.30451948418823,53.13272614197291],[31.49764367038293,53.1674268662569],[31.305200636528014,53.07399587667321],[31.54001834486226,52.74205231384636],[31.785998162571587,52.101677964885454],[30.927549269338982,52.04235342061439],[30.619454380014844,51.822806098022376],[30.555117221811457,51.31950348571566],[30.157363722460897,51.41613841410147],[29.254938185347925,51.368234361366895],[28.992835320763533,51.602044379271476],[28.61761274589225,51.42771393493484],[28.24161502453657,51.57222707783907],[27.454066196408434,51.59230337178447],[26.337958611768556,51.83228872334793],[25.32778771332701,51.91065603291855],[24.553106316839518,51.888461005249184],[24.00507775238421,51.61744395609446],[23.527070753684374,51.57845408793024],[23.508002150168693,52.02364655212473],[23.199493849386187,52.48697744405367],[23.79919884613338,52.69109935160657],[23.80493493011778,53.089731350306074],[23.527535841575002,53.470121568406555],[23.48412763844985,53.91249766704114]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":4,"sovereignt":"Switzerland","sov_a3":"CHE","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Switzerland","adm0_a3":"CHE","geou_dif":0,"geounit":"Switzerland","gu_a3":"CHE","su_dif":0,"subunit":"Switzerland","su_a3":"CHE","brk_diff":0,"name":"Switzerland","name_long":"Switzerland","brk_a3":"CHE","brk_name":"Switzerland","brk_group":null,"abbrev":"Switz.","postal":"CH","formal_en":"Swiss Confederation","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Switzerland","name_alt":null,"mapcolor7":5,"mapcolor8":2,"mapcolor9":7,"mapcolor13":3,"pop_est":7604467,"gdp_md_est":316700,"pop_year":-99,"lastcensus":2010,"gdp_year":-99,"economy":"2. Developed region: nonG7","income_grp":"1. High income: OECD","wikipedia":-99,"fips_10":null,"iso_a2":"CH","iso_a3":"CHE","iso_n3":"756","un_a3":"756","wb_a2":"CH","wb_a3":"CHE","woe_id":-99,"adm0_a3_is":"CHE","adm0_a3_us":"CHE","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Western Europe","region_wb":"Europe & Central Asia","name_len":11,"long_len":11,"abbrev_len":6,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[9.59422610844635,47.52505809182027],[9.632931756232978,47.34760122332999],[9.479969516649021,47.102809963563374],[9.932448357796659,46.92072805438296],[10.44270145024663,46.89354625099743],[10.363378126678612,46.48357127540986],[9.922836541390382,46.31489940040919],[9.182881707403055,46.44021474871698],[8.966305779667806,46.03693187111119],[8.489952426801324,46.005150865251686],[8.31662967289438,46.16364248309086],[7.755992058959833,45.82449005795931],[7.273850945676656,45.776947740250776],[6.843592970414505,45.99114655210061],[6.500099724970426,46.42967275652944],[6.022609490593538,46.27298981382047],[6.037388950229001,46.725778713561866],[6.768713820023606,47.2877082383037],[6.736571079138059,47.541801255882845],[7.192202182655507,47.44976552997102],[7.466759067422231,47.62058197691181],[8.317301466514152,47.61357982033626],[8.522611932009767,47.83082754169129],[9.59422610844635,47.52505809182027]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":5,"sovereignt":"Czech Republic","sov_a3":"CZE","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Czech Republic","adm0_a3":"CZE","geou_dif":0,"geounit":"Czech Republic","gu_a3":"CZE","su_dif":0,"subunit":"Czech Republic","su_a3":"CZE","brk_diff":0,"name":"Czech Rep.","name_long":"Czech Republic","brk_a3":"CZE","brk_name":"Czech Rep.","brk_group":null,"abbrev":"Cz. Rep.","postal":"CZ","formal_en":"Czech Republic","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Czech Republic","name_alt":null,"mapcolor7":1,"mapcolor8":1,"mapcolor9":2,"mapcolor13":6,"pop_est":10211904,"gdp_md_est":265200,"pop_year":-99,"lastcensus":2011,"gdp_year":-99,"economy":"2. Developed region: nonG7","income_grp":"1. High income: OECD","wikipedia":-99,"fips_10":null,"iso_a2":"CZ","iso_a3":"CZE","iso_n3":"203","un_a3":"203","wb_a2":"CZ","wb_a3":"CZE","woe_id":-99,"adm0_a3_is":"CZE","adm0_a3_us":"CZE","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Eastern Europe","region_wb":"Europe & Central Asia","name_len":10,"long_len":14,"abbrev_len":8,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[16.960288120194576,48.5969823268506],[16.499282667718774,48.78580801044511],[16.02964725105022,48.73389903420793],[15.253415561593982,49.03907420510758],[14.901447381254057,48.964401760445824],[14.338897739324722,48.55530528420721],[13.595945672264437,48.87717194273715],[13.031328973043431,49.30706818297324],[12.521024204161193,49.547415269562734],[12.415190870827445,49.96912079528057],[12.240111118222558,50.266337795607285],[12.966836785543194,50.484076443069085],[13.338131951560285,50.73323436136435],[14.056227654688172,50.9269176295943],[14.307013380600637,51.117267767941414],[14.570718214586066,51.002339382524276],[15.01699588385867,51.10667409932158],[15.490972120839729,50.78472992614321],[16.23862674323857,50.69773265237984],[16.176253289462267,50.42260732685791],[16.719475945714436,50.21574656839354],[16.86876915860566,50.47397370055603],[17.55456709155112,50.36214590107642],[17.64944502123899,50.049038397819956],[18.392913852622172,49.98862864847075],[18.853144158613617,49.49622976337764],[18.554971144289482,49.495015367218784],[18.399993523846177,49.31500051533004],[18.170498488037964,49.271514797556435],[18.104972771891852,49.04398346617531],[17.913511590250465,48.996492824899086],[17.88648481616181,48.90347524677371],[17.545006951577108,48.80001902932537],[17.101984897538898,48.816968899117114],[16.960288120194576,48.5969823268506]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":4,"sovereignt":"Denmark","sov_a3":"DN1","adm0_dif":1,"level":2,"type":"Country","admin":"Denmark","adm0_a3":"DNK","geou_dif":0,"geounit":"Denmark","gu_a3":"DNK","su_dif":0,"subunit":"Denmark","su_a3":"DNK","brk_diff":0,"name":"Denmark","name_long":"Denmark","brk_a3":"DNK","brk_name":"Denmark","brk_group":null,"abbrev":"Den.","postal":"DK","formal_en":"Kingdom of Denmark","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Denmark","name_alt":null,"mapcolor7":4,"mapcolor8":1,"mapcolor9":3,"mapcolor13":12,"pop_est":5500510,"gdp_md_est":203600,"pop_year":-99,"lastcensus":2011,"gdp_year":-99,"economy":"2. Developed region: nonG7","income_grp":"1. High income: OECD","wikipedia":-99,"fips_10":null,"iso_a2":"DK","iso_a3":"DNK","iso_n3":"208","un_a3":"208","wb_a2":"DK","wb_a3":"DNK","woe_id":-99,"adm0_a3_is":"DNK","adm0_a3_us":"DNK","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Northern Europe","region_wb":"Europe & Central Asia","name_len":7,"long_len":7,"abbrev_len":4,"tiny":-99,"homepart":1},"geometry":
+{"type":"MultiPolygon","coordinates":[[[[12.690006137755631,55.609990953180784],[12.089991082414741,54.80001455343793],[11.043543328504228,55.364863796604254],[10.903913608451631,55.77995473898875],[12.370904168353292,56.111407375708836],[12.690006137755631,55.609990953180784]]],[[[10.912181837618363,56.458621324277914],[10.667803989309988,56.08138336854722],[10.369992710011985,56.19000722922473],[9.649984978889307,55.469999498102055],[9.921906365609175,54.98310415304806],[9.282048780971138,54.83086538351617],[8.526229282270236,54.96274363872499],[8.12031090661759,55.517722683323626],[8.08997684086225,56.5400117051376],[8.256581658571264,56.8099693874303],[8.543437534223386,57.110002753316905],[9.42446902836761,57.17206614849948],[9.775558709358563,57.44794078228966],[10.580005730846153,57.73001658795485],[10.546105991262692,57.215732733786155],[10.250000034230226,56.89001618105047],[10.369992710011985,56.609981594460834],[10.912181837618363,56.458621324277914]]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":2,"sovereignt":"Germany","sov_a3":"DEU","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Germany","adm0_a3":"DEU","geou_dif":0,"geounit":"Germany","gu_a3":"DEU","su_dif":0,"subunit":"Germany","su_a3":"DEU","brk_diff":0,"name":"Germany","name_long":"Germany","brk_a3":"DEU","brk_name":"Germany","brk_group":null,"abbrev":"Ger.","postal":"D","formal_en":"Federal Republic of Germany","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Germany","name_alt":null,"mapcolor7":2,"mapcolor8":5,"mapcolor9":5,"mapcolor13":1,"pop_est":82329758,"gdp_md_est":2918000,"pop_year":-99,"lastcensus":2011,"gdp_year":-99,"economy":"1. Developed region: G7","income_grp":"1. High income: OECD","wikipedia":-99,"fips_10":null,"iso_a2":"DE","iso_a3":"DEU","iso_n3":"276","un_a3":"276","wb_a2":"DE","wb_a3":"DEU","woe_id":-99,"adm0_a3_is":"DEU","adm0_a3_us":"DEU","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Western Europe","region_wb":"Europe & Central Asia","name_len":7,"long_len":7,"abbrev_len":4,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[9.921906365609232,54.98310415304803],[9.9395797054529,54.596641954153256],[10.950112338920519,54.363607082733154],[10.93946699386845,54.00869334575259],[11.956252475643282,54.19648550070116],[12.518440382546714,54.470370591847995],[13.647467075259499,54.0755109727059],[14.119686313542559,53.75702912049104],[14.353315463934166,53.248171291713106],[14.074521111719434,52.98126251892535],[14.437599725002201,52.624850165408304],[14.685026482815715,52.089947414755216],[14.607098422919648,51.74518809671997],[15.016995883858783,51.10667409932171],[14.570718214586122,51.00233938252438],[14.307013380600665,51.11726776794137],[14.056227654688314,50.92691762959436],[13.338131951560399,50.73323436136428],[12.96683678554325,50.48407644306917],[12.240111118222671,50.26633779560723],[12.415190870827473,49.96912079528062],[12.521024204161336,49.54741526956275],[13.031328973043514,49.30706818297324],[13.595945672264577,48.877171942737164],[13.243357374737116,48.41611481382904],[12.884102817443875,48.28914581968786],[13.025851271220517,47.63758352313596],[12.932626987366064,47.467645575544],[12.620759718484521,47.672387600284424],[12.141357456112871,47.70308340106578],[11.426414015354851,47.52376618101306],[10.544504021861599,47.5663992376538],[10.402083774465325,47.30248769793917],[9.89606814946319,47.580196845075704],[9.594226108446378,47.5250580918202],[8.522611932009795,47.83082754169135],[8.317301466514095,47.61357982033627],[7.466759067422288,47.62058197691192],[7.593676385131062,48.33301911070373],[8.099278598674857,49.01778351500343],[6.65822960778371,49.20195831969164],[6.186320428094177,49.463802802114515],[6.242751092156993,49.90222565367873],[6.043073357781111,50.128051662794235],[6.15665815595878,50.80372101501058],[5.988658074577813,51.851615709025054],[6.589396599970826,51.852029120483394],[6.842869500362383,52.22844025329755],[7.092053256873896,53.144043280644894],[6.905139601274129,53.48216217713065],[7.100424838905269,53.69393219666267],[7.936239454793963,53.74829580343379],[8.121706170289485,53.52779246684429],[8.800734490604668,54.020785630908904],[8.57211795414537,54.39564647075406],[8.526229282270208,54.96274363872516],[9.282048780971138,54.83086538351631],[9.921906365609232,54.98310415304803]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":2,"sovereignt":"Spain","sov_a3":"ESP","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Spain","adm0_a3":"ESP","geou_dif":0,"geounit":"Spain","gu_a3":"ESP","su_dif":0,"subunit":"Spain","su_a3":"ESP","brk_diff":0,"name":"Spain","name_long":"Spain","brk_a3":"ESP","brk_name":"Spain","brk_group":null,"abbrev":"Sp.","postal":"E","formal_en":"Kingdom of Spain","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Spain","name_alt":null,"mapcolor7":4,"mapcolor8":5,"mapcolor9":5,"mapcolor13":5,"pop_est":40525002,"gdp_md_est":1403000,"pop_year":-99,"lastcensus":2001,"gdp_year":-99,"economy":"2. Developed region: nonG7","income_grp":"1. High income: OECD","wikipedia":-99,"fips_10":null,"iso_a2":"ES","iso_a3":"ESP","iso_n3":"724","un_a3":"724","wb_a2":"ES","wb_a3":"ESP","woe_id":-99,"adm0_a3_is":"ESP","adm0_a3_us":"ESP","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Southern Europe","region_wb":"Europe & Central Asia","name_len":5,"long_len":5,"abbrev_len":3,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[-9.034817674180246,41.880570583659676],[-8.984433152695672,42.59277517350627],[-9.392883673530648,43.0266246608127],[-7.97818966310831,43.74833771420099],[-6.754491746436756,43.567909450853925],[-5.411886359061597,43.57423981380968],[-4.347842779955783,43.40344920508504],[-3.517531704106091,43.4559007838613],[-1.901351284177764,43.42280202897834],[-1.502770961910528,43.03401439063043],[0.338046909190581,42.57954600683955],[0.701590610363894,42.795734361332606],[1.826793247087153,42.34338471126569],[2.985998976258458,42.47301504166986],[3.039484083680549,41.892120266276905],[2.091841668312185,41.226088568683096],[0.810524529635188,41.01473196060934],[0.721331007499401,40.678318386389236],[0.106691521819869,40.12393362076202],[-0.278711310212941,39.30997813573272],[0.111290724293838,38.73851430923304],[-0.467123582349103,38.29236583104115],[-0.683389451490598,37.642353827457825],[-1.438382127274849,37.44306366632422],[-2.146452602538119,36.67414419203729],[-3.415780808923387,36.65889964451118],[-4.368900926114719,36.677839056946155],[-4.995219285492212,36.32470815687964],[-5.377159796561457,35.946850083961465],[-5.866432257500904,36.02981659600606],[-6.236693894872175,36.367677110330334],[-6.520190802425404,36.94291331638732],[-7.453725551778092,37.09778758396607],[-7.537105475281024,37.42890432387624],[-7.166507941099865,37.803894354802225],[-7.029281175148796,38.07576406508977],[-7.374092169616318,38.37305858006492],[-7.098036668313128,39.03007274022379],[-7.498632371439726,39.62957103124181],[-7.066591559263529,39.711891587882775],[-7.026413133156595,40.184524237624245],[-6.864019944679385,40.33087189387483],[-6.851126674822552,41.11108266861753],[-6.389087693700915,41.381815497394655],[-6.668605515967656,41.883386949219584],[-7.251308966490824,41.91834605566505],[-7.422512986673795,41.79207469335984],[-8.013174607769912,41.790886135417125],[-8.263856980817792,42.28046865495034],[-8.67194576662672,42.13468943945496],[-9.034817674180246,41.880570583659676]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":6,"sovereignt":"Estonia","sov_a3":"EST","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Estonia","adm0_a3":"EST","geou_dif":0,"geounit":"Estonia","gu_a3":"EST","su_dif":0,"subunit":"Estonia","su_a3":"EST","brk_diff":0,"name":"Estonia","name_long":"Estonia","brk_a3":"EST","brk_name":"Estonia","brk_group":null,"abbrev":"Est.","postal":"EST","formal_en":"Republic of Estonia","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Estonia","name_alt":null,"mapcolor7":3,"mapcolor8":2,"mapcolor9":1,"mapcolor13":10,"pop_est":1299371,"gdp_md_est":27410,"pop_year":-99,"lastcensus":2000,"gdp_year":-99,"economy":"2. Developed region: nonG7","income_grp":"1. High income: OECD","wikipedia":-99,"fips_10":null,"iso_a2":"EE","iso_a3":"EST","iso_n3":"233","un_a3":"233","wb_a2":"EE","wb_a3":"EST","woe_id":-99,"adm0_a3_is":"EST","adm0_a3_us":"EST","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Northern Europe","region_wb":"Europe & Central Asia","name_len":7,"long_len":7,"abbrev_len":4,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[24.312862583114622,57.79342357037697],[24.42892785004216,58.38341339785329],[24.061198357853186,58.25737457949341],[23.426560092876684,58.612753404364625],[23.339795363058645,59.187240302153384],[24.604214308376186,59.46585378685502],[25.86418908051664,59.61109039981133],[26.949135776484525,59.445803331125774],[27.981114129353244,59.475388088612874],[28.13169925305175,59.300825100330925],[27.420166456824944,58.72458120384424],[27.71668582531572,57.79189911562436],[27.288184848751513,57.47452830670383],[26.463532342237787,57.47638865826633],[25.60280968598437,57.84752879498657],[25.16459354014927,57.97015696881519],[24.312862583114622,57.79342357037697]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":3,"sovereignt":"Finland","sov_a3":"FI1","adm0_dif":1,"level":2,"type":"Country","admin":"Finland","adm0_a3":"FIN","geou_dif":0,"geounit":"Finland","gu_a3":"FIN","su_dif":0,"subunit":"Finland","su_a3":"FIN","brk_diff":0,"name":"Finland","name_long":"Finland","brk_a3":"FIN","brk_name":"Finland","brk_group":null,"abbrev":"Fin.","postal":"FIN","formal_en":"Republic of Finland","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Finland","name_alt":null,"mapcolor7":4,"mapcolor8":1,"mapcolor9":4,"mapcolor13":6,"pop_est":5250275,"gdp_md_est":193500,"pop_year":-99,"lastcensus":2010,"gdp_year":-99,"economy":"2. Developed region: nonG7","income_grp":"1. High income: OECD","wikipedia":-99,"fips_10":null,"iso_a2":"FI","iso_a3":"FIN","iso_n3":"246","un_a3":"246","wb_a2":"FI","wb_a3":"FIN","woe_id":-99,"adm0_a3_is":"FIN","adm0_a3_us":"FIN","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Northern Europe","region_wb":"Europe & Central Asia","name_len":7,"long_len":7,"abbrev_len":4,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[28.591929559043194,69.06477692328666],[28.445943637818658,68.36461294216404],[29.97742638522061,67.69829702419266],[29.054588657352326,66.94428620062193],[30.21765,65.80598],[29.54442955904699,64.94867157659048],[30.44468468600371,64.20445343693909],[30.035872430142717,63.55281362573855],[31.516092156711125,62.86768748641289],[31.139991082490894,62.35769277612441],[30.21110721204445,61.780027777749694],[28.069997592895277,60.50351654727584],[26.255172967236973,60.4239606797625],[24.496623976344523,60.05731639265166],[22.869694858499457,59.846373196036225],[22.290763787533592,60.39192129174154],[21.322244093519316,60.720169989659524],[21.544866163832694,61.70532949487179],[21.05921105315369,62.60739329695874],[21.536029493910803,63.18973501245587],[22.442744174903993,63.81781037053129],[24.730511508897536,64.90234365504084],[25.398067661243942,65.11142650009374],[25.294043003040404,65.53434642197045],[23.903378533633802,66.00692739527962],[23.565879754335583,66.39605093043743],[23.53947309743444,67.93600861273525],[21.978534783626117,68.6168456081807],[20.645592889089528,69.10624726020087],[21.244936150810673,69.37044302029308],[22.356237827247412,68.84174144151491],[23.66204959483076,68.89124746365054],[24.735679152126725,68.64955678982146],[25.689212680776365,69.09211375596904],[26.179622023226244,69.82529897732614],[27.732292107867863,70.16419302029625],[29.015572950971972,69.76649119737799],[28.591929559043194,69.06477692328666]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":2,"sovereignt":"France","sov_a3":"FR1","adm0_dif":1,"level":2,"type":"Country","admin":"France","adm0_a3":"FRA","geou_dif":0,"geounit":"France","gu_a3":"FRA","su_dif":0,"subunit":"France","su_a3":"FRA","brk_diff":0,"name":"France","name_long":"France","brk_a3":"FRA","brk_name":"France","brk_group":null,"abbrev":"Fr.","postal":"F","formal_en":"French Republic","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"France","name_alt":null,"mapcolor7":7,"mapcolor8":5,"mapcolor9":9,"mapcolor13":11,"pop_est":64057792,"gdp_md_est":2128000,"pop_year":-99,"lastcensus":-99,"gdp_year":-99,"economy":"1. Developed region: G7","income_grp":"1. High income: OECD","wikipedia":-99,"fips_10":null,"iso_a2":"FR","iso_a3":"FRA","iso_n3":"250","un_a3":"250","wb_a2":"FR","wb_a3":"FRA","woe_id":-99,"adm0_a3_is":"FRA","adm0_a3_us":"FRA","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Western Europe","region_wb":"Europe & Central Asia","name_len":6,"long_len":6,"abbrev_len":3,"tiny":-99,"homepart":1},"geometry":
+{"type":"MultiPolygon","coordinates":[[[[-52.55642473001839,2.504705308437053],[-52.93965715189498,2.124857692875622],[-53.418465135295264,2.053389187016037],[-53.554839240113495,2.334896551925965],[-53.778520677288896,2.376702785650053],[-54.08806250671728,2.105556545414629],[-54.52475419779975,2.311848863123785],[-54.27122962097579,2.738747870286943],[-54.18428402364475,3.194172268075235],[-54.01150387227682,3.622569891774859],[-54.399542202356514,4.212611395683481],[-54.47863298197922,4.896755682795643],[-53.95804460307093,5.756548163267809],[-53.618452928264844,5.646529038918402],[-52.88214128275408,5.409850979021599],[-51.82334286152593,4.565768133966145],[-51.65779741067888,4.156232408053029],[-52.249337531123984,3.241094468596287],[-52.55642473001839,2.504705308437053]]],[[[9.560016310269134,42.15249197037957],[9.229752231491773,41.38000682226445],[8.775723097375362,41.58361196549444],[8.54421268070783,42.256516628583086],[8.746009148807588,42.62812185319396],[9.390000848028905,43.00998484961474],[9.560016310269134,42.15249197037957]]],[[[3.588184441755715,50.37899241800358],[4.286022983425141,49.907496649772554],[4.799221632515753,49.98537303323633],[5.674051954784886,49.52948354755745],[5.897759230176376,49.44266714130717],[6.186320428094206,49.46380280211446],[6.658229607783539,49.201958319691556],[8.099278598674772,49.01778351500337],[7.593676385131062,48.33301911070373],[7.466759067422231,47.620581976911865],[7.192202182655535,47.44976552997099],[6.736571079138088,47.54180125588289],[6.768713820023635,47.28770823830368],[6.037388950228973,46.72577871356191],[6.022609490593567,46.272989813820516],[6.500099724970454,46.42967275652944],[6.843592970414562,45.99114655210067],[6.802355177445662,45.70857982032868],[7.096652459347837,45.333098863295874],[6.749955275101712,45.02851797136759],[7.007562290076663,44.25476675066139],[7.549596388386163,44.12790110938482],[7.435184767291844,43.69384491634918],[6.529245232783069,43.12889232031836],[4.556962517931396,43.39965098731159],[3.10041059735272,43.075200507167125],[2.985998976258486,42.473015041669896],[1.826793247087181,42.34338471126566],[0.701590610363922,42.79573436133265],[0.338046909190581,42.579546006839564],[-1.502770961910471,43.03401439063049],[-1.901351284177736,43.42280202897834],[-1.384225226232957,44.02261037859017],[-1.193797573237362,46.014917710954876],[-2.225724249673789,47.06436269793821],[-2.963276129559574,47.570326646507965],[-4.491554938159481,47.95495433205642],[-4.592349819344747,48.68416046812695],[-3.295813971357745,48.901692409859635],[-1.616510789384932,48.644421291694584],[-1.933494025063254,49.77634186461577],[-0.98946895995536,49.347375800160876],[1.338761020522753,50.12717316344526],[1.6390010921385,50.946606350297515],[2.513573032246171,51.14850617126186],[2.658422071960331,50.79684804951566],[3.123251580425716,50.78036326761452],[3.588184441755715,50.37899241800358]]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":2,"sovereignt":"United Kingdom","sov_a3":"GB1","adm0_dif":1,"level":2,"type":"Country","admin":"United Kingdom","adm0_a3":"GBR","geou_dif":0,"geounit":"United Kingdom","gu_a3":"GBR","su_dif":0,"subunit":"United Kingdom","su_a3":"GBR","brk_diff":0,"name":"United Kingdom","name_long":"United Kingdom","brk_a3":"GBR","brk_name":"United Kingdom","brk_group":null,"abbrev":"U.K.","postal":"GB","formal_en":"United Kingdom of Great Britain and Northern Ireland","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"United Kingdom","name_alt":null,"mapcolor7":6,"mapcolor8":6,"mapcolor9":6,"mapcolor13":3,"pop_est":62262000,"gdp_md_est":1977704,"pop_year":0,"lastcensus":2011,"gdp_year":2009,"economy":"1. Developed region: G7","income_grp":"1. High income: OECD","wikipedia":-99,"fips_10":null,"iso_a2":"GB","iso_a3":"GBR","iso_n3":"826","un_a3":"826","wb_a2":"GB","wb_a3":"GBR","woe_id":-99,"adm0_a3_is":"GBR","adm0_a3_us":"GBR","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Northern Europe","region_wb":"Europe & Central Asia","name_len":14,"long_len":14,"abbrev_len":4,"tiny":-99,"homepart":1},"geometry":
+{"type":"MultiPolygon","coordinates":[[[[-5.661948614921897,54.55460317648385],[-6.197884894220977,53.86756500916334],[-6.953730231137996,54.073702297575636],[-7.572167934591079,54.05995636658599],[-7.366030646178785,54.595840969452695],[-7.572167934591079,55.1316222194549],[-6.733847011736145,55.1728600124238],[-5.661948614921897,54.55460317648385]]],[[[-3.005004848635281,58.63500010846633],[-4.073828497728016,57.55302480735526],[-3.055001796877661,57.69001902936094],[-1.959280564776918,57.68479970969952],[-2.219988165689301,56.87001740175353],[-3.119003058271119,55.973793036515474],[-2.085009324543023,55.90999848085127],[-2.005675679673857,55.80490285035023],[-1.11499101399221,54.624986477265395],[-0.4304849918542,54.46437612570216],[0.184981316742039,53.32501414653103],[0.469976840831777,52.92999949809197],[1.681530795914739,52.739520168664],[1.559987827164377,52.09999848083601],[1.050561557630914,51.806760565795685],[1.449865349950301,51.28942780212196],[0.550333693045502,50.765738837275876],[-0.78751746255864,50.77498891865622],[-2.489997524414377,50.50001862243124],[-2.956273972984036,50.696879991247016],[-3.617448085942328,50.22835561787272],[-4.542507900399244,50.341837063185665],[-5.245023159191135,49.95999990498109],[-5.776566941745301,50.15967763935683],[-4.309989793301838,51.21000112568916],[-3.414850633142123,51.42600861266925],[-3.422719467108323,51.42684816740609],[-4.984367234710874,51.593466091510976],[-5.267295701508885,51.991400458374585],[-4.222346564134853,52.301355699261364],[-4.770013393564113,52.840004991255626],[-4.579999152026915,53.49500377055517],[-3.093830673788659,53.404547400669685],[-3.092079637047107,53.40444082296355],[-2.945008510744344,53.984999701546684],[-3.614700825433033,54.600936773292574],[-3.630005458989331,54.615012925833014],[-4.844169073903004,54.790971177786844],[-5.082526617849226,55.06160065369937],[-4.719112107756644,55.50847260194348],[-5.047980922862109,55.78398550070753],[-5.58639767091114,55.31114614523682],[-5.644998745130181,56.275014960344805],[-6.149980841486354,56.78500967063354],[-5.786824713555291,57.81884837506465],[-5.009998745127575,58.63001333275005],[-4.211494513353557,58.55084503847917],[-3.005004848635281,58.63500010846633]]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":3,"sovereignt":"Greece","sov_a3":"GRC","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Greece","adm0_a3":"GRC","geou_dif":0,"geounit":"Greece","gu_a3":"GRC","su_dif":0,"subunit":"Greece","su_a3":"GRC","brk_diff":0,"name":"Greece","name_long":"Greece","brk_a3":"GRC","brk_name":"Greece","brk_group":null,"abbrev":"Greece","postal":"GR","formal_en":"Hellenic Republic","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Greece","name_alt":null,"mapcolor7":2,"mapcolor8":2,"mapcolor9":2,"mapcolor13":9,"pop_est":10737428,"gdp_md_est":343000,"pop_year":-99,"lastcensus":2011,"gdp_year":-99,"economy":"2. Developed region: nonG7","income_grp":"1. High income: OECD","wikipedia":-99,"fips_10":null,"iso_a2":"GR","iso_a3":"GRC","iso_n3":"300","un_a3":"300","wb_a2":"GR","wb_a3":"GRC","woe_id":-99,"adm0_a3_is":"GRC","adm0_a3_us":"GRC","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Southern Europe","region_wb":"Europe & Central Asia","name_len":6,"long_len":6,"abbrev_len":6,"tiny":-99,"homepart":1},"geometry":
+{"type":"MultiPolygon","coordinates":[[[[23.699980096133004,35.70500438083553],[24.24666507334868,35.368022365860156],[25.02501549652888,35.424995632461986],[25.769207797964185,35.35401805270908],[25.745023227651586,35.179997666966216],[26.290002882601726,35.29999034274792],[26.16499759288766,35.004995429009796],[24.724982130642303,34.91998769788961],[24.735007358506948,35.08499054619759],[23.514978468528113,35.27999156345098],[23.699980096133004,35.70500438083553]]],[[[26.604195590936285,41.562114569661105],[26.29460208507578,40.93626129817426],[26.056942172965506,40.824123440100834],[25.447677036244187,40.85254547786147],[24.92584842296094,40.94706167252323],[23.714811232200816,40.68712921809512],[24.407998894964066,40.1249929876241],[23.899967889102584,39.96200552017558],[23.3429993018608,39.96099782974579],[22.813987664488963,40.476005153966554],[22.62629886240478,40.25656118423919],[22.84974775563481,39.65931081802577],[23.3500272966526,39.19001129816726],[22.973099399515547,38.97090322524966],[23.530016310324953,38.51000112563847],[24.025024855248944,38.21999298761645],[24.040011020613605,37.655014553369426],[23.115002882589152,37.92001129816222],[23.409971958111072,37.409990749657396],[22.774971958108637,37.30501007745656],[23.15422529469862,36.422505804992056],[22.490028110451107,36.41000010837746],[21.670026482843696,36.8449864771942],[21.295010613701578,37.644989325504696],[21.120034213961333,38.31032339126273],[20.730032179454582,38.769985256498785],[20.217712029712857,39.340234686839636],[20.15001590341052,39.62499766698403],[20.615000441172782,40.110006822259436],[20.674996779063633,40.434999904943055],[20.99998986174728,40.58000397395398],[21.02004031747643,40.84272695572588],[21.674160597426976,40.93127452245798],[22.05537763844427,41.14986583105269],[22.597308383889015,41.130487168943205],[22.76177,41.3048],[22.95237715016657,41.33799388281122],[23.692073601992462,41.30908091894386],[24.492644891058035,41.58389618587205],[25.197201368925533,41.23448598893066],[26.106138136507184,41.32889883072784],[26.117041863720914,41.82690460872473],[26.604195590936285,41.562114569661105]]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":6,"sovereignt":"Croatia","sov_a3":"HRV","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Croatia","adm0_a3":"HRV","geou_dif":0,"geounit":"Croatia","gu_a3":"HRV","su_dif":0,"subunit":"Croatia","su_a3":"HRV","brk_diff":0,"name":"Croatia","name_long":"Croatia","brk_a3":"HRV","brk_name":"Croatia","brk_group":null,"abbrev":"Cro.","postal":"HR","formal_en":"Republic of Croatia","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Croatia","name_alt":null,"mapcolor7":5,"mapcolor8":4,"mapcolor9":5,"mapcolor13":1,"pop_est":4489409,"gdp_md_est":82390,"pop_year":-99,"lastcensus":2011,"gdp_year":-99,"economy":"2. Developed region: nonG7","income_grp":"2. High income: nonOECD","wikipedia":-99,"fips_10":null,"iso_a2":"HR","iso_a3":"HRV","iso_n3":"191","un_a3":"191","wb_a2":"HR","wb_a3":"HRV","woe_id":-99,"adm0_a3_is":"HRV","adm0_a3_us":"HRV","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Southern Europe","region_wb":"Europe & Central Asia","name_len":7,"long_len":7,"abbrev_len":4,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[18.829838087650046,45.908877671891844],[19.072768995854176,45.52151113543209],[19.39047570158459,45.236515611342384],[19.00548628101012,44.86023366960916],[18.553214145591653,45.08158966733146],[17.861783481526402,45.067740383477144],[17.002146030351014,45.23377676043094],[16.534939406000206,45.21160757097772],[16.318156772535872,45.00412669532591],[15.959367303133376,45.23377676043094],[15.750026075918981,44.818711656262565],[16.23966027188453,44.35114329688571],[16.456442905348865,44.04123973243128],[16.91615644701733,43.66772247982567],[17.297373488034452,43.44634064388737],[17.674921502358984,43.02856252702361],[18.56,42.65],[18.450016310304818,42.47999136002932],[17.509970330483327,42.849994615239154],[16.930005730871642,43.20999848080038],[16.015384555737683,43.50721548112722],[15.174453973052096,44.243191229827914],[15.376250441151797,44.31791535092208],[14.92030927904051,44.73848399512946],[14.901602410550879,45.07606028907611],[14.258747592839995,45.23377676043094],[13.952254672917036,44.80212352149687],[13.656975538801191,45.13693512631596],[13.67940311041582,45.48414907488501],[13.715059848697251,45.500323798192426],[14.4119682145855,45.46616567644742],[14.59510949062792,45.63494090431283],[14.935243767972963,45.471695054702764],[15.327674594797429,45.45231639259333],[15.323953891672431,45.731782538427694],[15.671529575267641,45.83415355079791],[15.768732944408612,46.23810822202353],[16.564808383864943,46.50375092221981],[16.882515089595415,46.38063182228444],[17.630066359129557,45.9517691106941],[18.45606245288286,45.75948110613615],[18.829838087650046,45.908877671891844]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":5,"sovereignt":"Hungary","sov_a3":"HUN","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Hungary","adm0_a3":"HUN","geou_dif":0,"geounit":"Hungary","gu_a3":"HUN","su_dif":0,"subunit":"Hungary","su_a3":"HUN","brk_diff":0,"name":"Hungary","name_long":"Hungary","brk_a3":"HUN","brk_name":"Hungary","brk_group":null,"abbrev":"Hun.","postal":"HU","formal_en":"Republic of Hungary","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Hungary","name_alt":null,"mapcolor7":4,"mapcolor8":6,"mapcolor9":1,"mapcolor13":5,"pop_est":9905596,"gdp_md_est":196600,"pop_year":-99,"lastcensus":2001,"gdp_year":-99,"economy":"2. Developed region: nonG7","income_grp":"1. High income: OECD","wikipedia":-99,"fips_10":null,"iso_a2":"HU","iso_a3":"HUN","iso_n3":"348","un_a3":"348","wb_a2":"HU","wb_a3":"HUN","woe_id":-99,"adm0_a3_is":"HUN","adm0_a3_us":"HUN","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Eastern Europe","region_wb":"Europe & Central Asia","name_len":7,"long_len":7,"abbrev_len":4,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[16.202298211337364,46.85238597267696],[16.534267612380376,47.49617096616912],[16.340584344150415,47.71290192320123],[16.90375410326726,47.71486562762833],[16.979666782304037,48.123497015976305],[17.48847293464982,47.867466132186216],[17.857132602620027,47.75842886005037],[18.696512892336926,47.880953681014404],[18.77702477384767,48.081768296900634],[19.17436486173989,48.11137889260387],[19.661363559658497,48.26661489520866],[19.769470656013112,48.202691148463614],[20.239054396249347,48.32756724709692],[20.473562045989866,48.562850043321816],[20.801293979584926,48.623854071642384],[21.872236362401736,48.31997081155002],[22.085608351334855,48.42226430927179],[22.640819939878753,48.15023956968736],[22.710531447040495,47.88219391538941],[22.099767693782837,47.6724392767167],[21.626514926853872,46.99423777931816],[21.02195234547125,46.3160879583519],[20.220192498462836,46.127468980486555],[19.596044549241583,46.17172984474454],[18.82983808764996,45.90887767189193],[18.45606245288286,45.759481106136136],[17.630066359129557,45.95176911069419],[16.8825150895953,46.38063182228444],[16.564808383864857,46.50375092221983],[16.370504998447416,46.841327216166505],[16.202298211337364,46.85238597267696]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":3,"sovereignt":"Ireland","sov_a3":"IRL","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Ireland","adm0_a3":"IRL","geou_dif":0,"geounit":"Ireland","gu_a3":"IRL","su_dif":0,"subunit":"Ireland","su_a3":"IRL","brk_diff":0,"name":"Ireland","name_long":"Ireland","brk_a3":"IRL","brk_name":"Ireland","brk_group":null,"abbrev":"Ire.","postal":"IRL","formal_en":"Ireland","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Ireland","name_alt":null,"mapcolor7":2,"mapcolor8":3,"mapcolor9":2,"mapcolor13":2,"pop_est":4203200,"gdp_md_est":188400,"pop_year":-99,"lastcensus":2011,"gdp_year":-99,"economy":"2. Developed region: nonG7","income_grp":"1. High income: OECD","wikipedia":-99,"fips_10":null,"iso_a2":"IE","iso_a3":"IRL","iso_n3":"372","un_a3":"372","wb_a2":"IE","wb_a3":"IRL","woe_id":-99,"adm0_a3_is":"IRL","adm0_a3_us":"IRL","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Northern Europe","region_wb":"Europe & Central Asia","name_len":7,"long_len":7,"abbrev_len":4,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[-6.197884894220991,53.867565009163364],[-6.032985398777611,53.15316417094435],[-6.788856573910849,52.260117906292336],[-8.56161658368356,51.669301255899356],[-9.977085740590269,51.82045482035308],[-9.166282517930782,52.86462881124268],[-9.688524542672454,53.8813626165853],[-8.327987433292009,54.66451894796863],[-7.572167934591064,55.13162221945487],[-7.366030646178785,54.59584096945272],[-7.572167934591064,54.059956366586],[-6.953730231138067,54.073702297575636],[-6.197884894220991,53.867565009163364]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":3,"sovereignt":"Iceland","sov_a3":"ISL","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Iceland","adm0_a3":"ISL","geou_dif":0,"geounit":"Iceland","gu_a3":"ISL","su_dif":0,"subunit":"Iceland","su_a3":"ISL","brk_diff":0,"name":"Iceland","name_long":"Iceland","brk_a3":"ISL","brk_name":"Iceland","brk_group":null,"abbrev":"Iceland","postal":"IS","formal_en":"Republic of Iceland","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Iceland","name_alt":null,"mapcolor7":1,"mapcolor8":4,"mapcolor9":4,"mapcolor13":9,"pop_est":306694,"gdp_md_est":12710,"pop_year":-99,"lastcensus":-99,"gdp_year":-99,"economy":"2. Developed region: nonG7","income_grp":"1. High income: OECD","wikipedia":-99,"fips_10":null,"iso_a2":"IS","iso_a3":"ISL","iso_n3":"352","un_a3":"352","wb_a2":"IS","wb_a3":"ISL","woe_id":-99,"adm0_a3_is":"ISL","adm0_a3_us":"ISL","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Northern Europe","region_wb":"Europe & Central Asia","name_len":7,"long_len":7,"abbrev_len":7,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[-14.508695441129234,66.45589223903143],[-14.739637417041607,65.8087482774403],[-13.60973222497981,65.12667104761987],[-14.909833746794902,64.36408193628868],[-17.794438035543422,63.678749091233854],[-18.656245896874992,63.49638296167582],[-19.97275468594276,63.64363495549153],[-22.762971971110158,63.960178941495386],[-21.778484259517683,64.40211579045551],[-23.95504391121911,64.8911298692335],[-22.184402635170358,65.0849681667603],[-22.227423265053332,65.37859365504274],[-24.326184047939336,65.61118927678847],[-23.65051469572309,66.26251902939522],[-22.134922451250887,66.41046865504687],[-20.57628373867955,65.73211212835143],[-19.05684160000159,66.27660085719477],[-17.79862382655905,65.99385325790978],[-16.167818976292125,66.52679230413587],[-14.508695441129234,66.45589223903143]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":2,"sovereignt":"Italy","sov_a3":"ITA","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Italy","adm0_a3":"ITA","geou_dif":0,"geounit":"Italy","gu_a3":"ITA","su_dif":0,"subunit":"Italy","su_a3":"ITA","brk_diff":0,"name":"Italy","name_long":"Italy","brk_a3":"ITA","brk_name":"Italy","brk_group":null,"abbrev":"Italy","postal":"I","formal_en":"Italian Republic","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Italy","name_alt":null,"mapcolor7":6,"mapcolor8":7,"mapcolor9":8,"mapcolor13":7,"pop_est":58126212,"gdp_md_est":1823000,"pop_year":-99,"lastcensus":2012,"gdp_year":-99,"economy":"1. Developed region: G7","income_grp":"1. High income: OECD","wikipedia":-99,"fips_10":null,"iso_a2":"IT","iso_a3":"ITA","iso_n3":"380","un_a3":"380","wb_a2":"IT","wb_a3":"ITA","woe_id":-99,"adm0_a3_is":"ITA","adm0_a3_us":"ITA","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Southern Europe","region_wb":"Europe & Central Asia","name_len":5,"long_len":5,"abbrev_len":5,"tiny":-99,"homepart":1},"geometry":
+{"type":"MultiPolygon","coordinates":[[[[15.520376010813834,38.23115509699147],[15.160242954171736,37.44404551853782],[15.309897902089006,37.1342194687318],[15.09998823411945,36.6199872909954],[14.335228712632016,36.996630967754754],[13.82673261887993,37.1045313583802],[12.431003859108813,37.61294993748382],[12.570943637755136,38.12638113051969],[13.741156447004585,38.03496552179536],[14.76124922044616,38.143873602850505],[15.520376010813834,38.23115509699147]]],[[[9.210011834356266,41.20999136002422],[9.809975213264977,40.5000088567661],[9.669518670295673,39.177376410471794],[9.21481774255949,39.240473334300134],[8.80693566247973,38.90661774347848],[8.428302443077115,39.17184703221662],[8.38825320805094,40.378310858718805],[8.15999840661766,40.95000722916379],[8.709990675500109,40.89998444270523],[9.210011834356266,41.20999136002422]]],[[[12.376485223040845,46.76755910906988],[13.806475457421556,46.50930613869119],[13.698109978905478,46.016778062517375],[13.937630242578336,45.591015936864665],[13.141606479554298,45.73669179949542],[12.328581170306308,45.381778062514854],[12.383874952858605,44.88537425391908],[12.261453484759159,44.600482082694015],[12.589237094786483,44.091365871754476],[13.526905958722494,43.58772736263791],[14.029820997787027,42.76100779883248],[15.142569614327954,41.955139675456905],[15.926191033601896,41.96131500911574],[16.169897088290412,41.740294908203424],[15.889345737377795,41.5410822617182],[16.785001661860576,41.179605617836586],[17.519168735431208,40.87714345963224],[18.376687452882578,40.35562490494266],[18.480247023195403,40.168866278639825],[18.2933850440281,39.81077444107325],[17.738380161213286,40.2776710068303],[16.869595981522338,40.44223460546385],[16.448743116937322,39.79540070246648],[17.1714896989715,39.42469981542072],[17.052840610429342,38.902871202137305],[16.635088331781844,38.8435724960824],[16.100960727613057,37.98589874933418],[15.684086948314501,37.90884918878703],[15.68796268073632,38.214592800441864],[15.891981235424709,38.750942491199226],[16.109332309644316,38.96454702407769],[15.718813510814641,39.544072374014945],[15.413612501698822,40.04835683853517],[14.998495721098237,40.17294871679093],[14.70326826341477,40.604550279292624],[14.060671827865264,40.78634796809544],[13.627985060285397,41.188287258461656],[12.88808190273042,41.25308950455562],[12.10668257004491,41.70453481705741],[11.191906365614187,42.35542531998968],[10.511947869517797,42.931462510747224],[10.200028924204048,43.920006822274615],[9.702488234097814,44.03627879493132],[8.88894616052687,44.36633616797954],[8.428560825238577,44.23122813575242],[7.850766635783202,43.76714793555524],[7.435184767291844,43.69384491634918],[7.549596388386163,44.12790110938482],[7.007562290076663,44.25476675066139],[6.749955275101712,45.02851797136759],[7.096652459347837,45.333098863295874],[6.802355177445662,45.70857982032868],[6.843592970414562,45.99114655210067],[7.273850945676685,45.77694774025076],[7.755992058959833,45.82449005795928],[8.31662967289438,46.163642483090854],[8.489952426801295,46.00515086525175],[8.966305779667834,46.036931871111165],[9.182881707403112,46.44021474871698],[9.922836541390353,46.31489940040919],[10.363378126678668,46.483571275409844],[10.442701450246602,46.893546250997446],[11.048555942436508,46.7513585475464],[11.164827915093326,46.94157949481274],[12.153088006243081,47.11539317482644],[12.376485223040845,46.76755910906988]]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":6,"sovereignt":"Kosovo","sov_a3":"KOS","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Kosovo","adm0_a3":"KOS","geou_dif":0,"geounit":"Kosovo","gu_a3":"KOS","su_dif":0,"subunit":"Kosovo","su_a3":"KOS","brk_diff":1,"name":"Kosovo","name_long":"Kosovo","brk_a3":"B57","brk_name":"Kosovo","brk_group":null,"abbrev":"Kos.","postal":"KO","formal_en":"Republic of Kosovo","formal_fr":null,"note_adm0":null,"note_brk":"Self admin.; Claimed by Serbia","name_sort":"Kosovo","name_alt":null,"mapcolor7":2,"mapcolor8":2,"mapcolor9":3,"mapcolor13":11,"pop_est":1804838,"gdp_md_est":5352,"pop_year":-99,"lastcensus":1981,"gdp_year":-99,"economy":"6. Developing region","income_grp":"4. Lower middle income","wikipedia":-99,"fips_10":null,"iso_a2":"-99","iso_a3":"-99","iso_n3":"-99","un_a3":"-099","wb_a2":"KV","wb_a3":"KSV","woe_id":-99,"adm0_a3_is":"SRB","adm0_a3_us":"KOS","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Southern Europe","region_wb":"Europe & Central Asia","name_len":6,"long_len":6,"abbrev_len":4,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[20.76216,42.05186],[20.71731000000011,41.84711],[20.59023,41.85541],[20.52295,42.21787],[20.28374,42.3202500000001],[20.0707,42.58863],[20.25758,42.81275000000011],[20.49679,42.88469],[20.63508,43.21671],[20.81448,43.27205],[20.95651,43.13094],[21.143395,43.06868500000013],[21.27421,42.90959],[21.43866,42.86255],[21.63302,42.67717],[21.77505,42.6827],[21.66292,42.43922],[21.54332,42.3202500000001],[21.57663598940212,42.24522439706186],[21.35270000000014,42.2068],[20.76216,42.05186]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":5,"sovereignt":"Lithuania","sov_a3":"LTU","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Lithuania","adm0_a3":"LTU","geou_dif":0,"geounit":"Lithuania","gu_a3":"LTU","su_dif":0,"subunit":"Lithuania","su_a3":"LTU","brk_diff":0,"name":"Lithuania","name_long":"Lithuania","brk_a3":"LTU","brk_name":"Lithuania","brk_group":null,"abbrev":"Lith.","postal":"LT","formal_en":"Republic of Lithuania","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Lithuania","name_alt":null,"mapcolor7":6,"mapcolor8":3,"mapcolor9":3,"mapcolor13":9,"pop_est":3555179,"gdp_md_est":63330,"pop_year":-99,"lastcensus":2011,"gdp_year":-99,"economy":"2. Developed region: nonG7","income_grp":"3. Upper middle income","wikipedia":-99,"fips_10":null,"iso_a2":"LT","iso_a3":"LTU","iso_n3":"440","un_a3":"440","wb_a2":"LT","wb_a3":"LTU","woe_id":-99,"adm0_a3_is":"LTU","adm0_a3_us":"LTU","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Northern Europe","region_wb":"Europe & Central Asia","name_len":9,"long_len":9,"abbrev_len":5,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[22.731098667092652,54.327536932993326],[22.65105187347254,54.582740993866736],[22.75776370615526,54.85657440858138],[22.315723504330577,55.015298570365864],[21.268448927503467,55.190481675835315],[21.055800408622417,56.031076361711065],[22.201156853939494,56.33780182557949],[23.878263787539964,56.27367137310527],[24.86068444184076,56.37252838807963],[25.000934279080894,56.16453074810484],[25.533046502390334,56.100296942766036],[26.494331495883756,55.615106919977634],[26.58827924979039,55.16717560487167],[25.7684326514798,54.84696259217509],[25.536353794056993,54.28242340760253],[24.450683628037037,53.905702216194754],[23.48412763844985,53.91249766704114],[23.24398725758951,54.22056671814914],[22.731098667092652,54.327536932993326]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":6,"sovereignt":"Luxembourg","sov_a3":"LUX","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Luxembourg","adm0_a3":"LUX","geou_dif":0,"geounit":"Luxembourg","gu_a3":"LUX","su_dif":0,"subunit":"Luxembourg","su_a3":"LUX","brk_diff":0,"name":"Luxembourg","name_long":"Luxembourg","brk_a3":"LUX","brk_name":"Luxembourg","brk_group":null,"abbrev":"Lux.","postal":"L","formal_en":"Grand Duchy of Luxembourg","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Luxembourg","name_alt":null,"mapcolor7":1,"mapcolor8":7,"mapcolor9":3,"mapcolor13":7,"pop_est":491775,"gdp_md_est":39370,"pop_year":-99,"lastcensus":2011,"gdp_year":-99,"economy":"2. Developed region: nonG7","income_grp":"1. High income: OECD","wikipedia":-99,"fips_10":null,"iso_a2":"LU","iso_a3":"LUX","iso_n3":"442","un_a3":"442","wb_a2":"LU","wb_a3":"LUX","woe_id":-99,"adm0_a3_is":"LUX","adm0_a3_us":"LUX","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Western Europe","region_wb":"Europe & Central Asia","name_len":10,"long_len":10,"abbrev_len":4,"tiny":5,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[6.043073357781111,50.128051662794235],[6.242751092156993,49.90222565367873],[6.186320428094177,49.463802802114515],[5.897759230176405,49.44266714130703],[5.674051954784829,49.529483547557504],[5.782417433300907,50.09032786722122],[6.043073357781111,50.128051662794235]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":5,"sovereignt":"Latvia","sov_a3":"LVA","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Latvia","adm0_a3":"LVA","geou_dif":0,"geounit":"Latvia","gu_a3":"LVA","su_dif":0,"subunit":"Latvia","su_a3":"LVA","brk_diff":0,"name":"Latvia","name_long":"Latvia","brk_a3":"LVA","brk_name":"Latvia","brk_group":null,"abbrev":"Lat.","postal":"LV","formal_en":"Republic of Latvia","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Latvia","name_alt":null,"mapcolor7":4,"mapcolor8":7,"mapcolor9":6,"mapcolor13":13,"pop_est":2231503,"gdp_md_est":38860,"pop_year":-99,"lastcensus":2011,"gdp_year":-99,"economy":"2. Developed region: nonG7","income_grp":"3. Upper middle income","wikipedia":-99,"fips_10":null,"iso_a2":"LV","iso_a3":"LVA","iso_n3":"428","un_a3":"428","wb_a2":"LV","wb_a3":"LVA","woe_id":-99,"adm0_a3_is":"LVA","adm0_a3_us":"LVA","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Northern Europe","region_wb":"Europe & Central Asia","name_len":6,"long_len":6,"abbrev_len":4,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[21.055800408622417,56.031076361711065],[21.090423618257972,56.78387278912294],[21.581866489353672,57.411870632549935],[22.52434126149288,57.75337433535076],[23.318452996522097,57.00623647727487],[24.12072960785343,57.02569265403277],[24.312862583114622,57.79342357037697],[25.16459354014927,57.97015696881519],[25.60280968598437,57.84752879498657],[26.463532342237787,57.47638865826633],[27.288184848751513,57.47452830670383],[27.77001590344093,57.24425812441123],[27.855282016722526,56.75932648378429],[28.176709425577997,56.169129950578814],[27.10245975109453,55.783313707087686],[26.494331495883756,55.615106919977634],[25.533046502390334,56.100296942766036],[25.000934279080894,56.16453074810484],[24.86068444184076,56.37252838807963],[23.878263787539964,56.27367137310527],[22.201156853939494,56.33780182557949],[21.055800408622417,56.031076361711065]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":6,"sovereignt":"Moldova","sov_a3":"MDA","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Moldova","adm0_a3":"MDA","geou_dif":0,"geounit":"Moldova","gu_a3":"MDA","su_dif":0,"subunit":"Moldova","su_a3":"MDA","brk_diff":0,"name":"Moldova","name_long":"Moldova","brk_a3":"MDA","brk_name":"Moldova","brk_group":null,"abbrev":"Mda.","postal":"MD","formal_en":"Republic of Moldova","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Moldova","name_alt":null,"mapcolor7":3,"mapcolor8":5,"mapcolor9":4,"mapcolor13":12,"pop_est":4320748,"gdp_md_est":10670,"pop_year":-99,"lastcensus":2004,"gdp_year":-99,"economy":"6. Developing region","income_grp":"4. Lower middle income","wikipedia":-99,"fips_10":null,"iso_a2":"MD","iso_a3":"MDA","iso_n3":"498","un_a3":"498","wb_a2":"MD","wb_a3":"MDA","woe_id":-99,"adm0_a3_is":"MDA","adm0_a3_us":"MDA","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Eastern Europe","region_wb":"Europe & Central Asia","name_len":7,"long_len":7,"abbrev_len":4,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[26.619336785597795,48.22072622333347],[26.857823520624805,48.368210761094495],[27.522537469195157,48.467119452501116],[28.259546746541844,48.15556224221342],[28.670891147585166,48.1181485052341],[29.12269819511303,47.849095160506465],[29.05086795422733,47.5102269557525],[29.415135125452736,47.34664520933258],[29.559674106573112,46.928582872091326],[29.908851759569302,46.67436066343146],[29.838210076626297,46.52532583270169],[30.024658644335375,46.42393667254504],[29.759971958136394,46.34998769793536],[29.170653924279886,46.3792623968287],[29.07210696789929,46.517677720722496],[28.862972446414062,46.43788930926383],[28.933717482221624,46.2588304713725],[28.65998742037158,45.93998688413164],[28.485269402792767,45.5969070501459],[28.233553501099042,45.488283189468376],[28.0544429867754,45.944586086605625],[28.160017937947714,46.37156260841722],[28.128030226359044,46.810476386088254],[27.551166212684848,47.40511709247083],[27.233872918412743,47.82677094175638],[26.924176059687568,48.123264472030996],[26.619336785597795,48.22072622333347]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":6,"sovereignt":"Macedonia","sov_a3":"MKD","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Macedonia","adm0_a3":"MKD","geou_dif":0,"geounit":"Macedonia","gu_a3":"MKD","su_dif":0,"subunit":"Macedonia","su_a3":"MKD","brk_diff":0,"name":"Macedonia","name_long":"Macedonia","brk_a3":"MKD","brk_name":"Macedonia","brk_group":null,"abbrev":"Mkd.","postal":"MK","formal_en":"Former Yugoslav Republic of Macedonia","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Macedonia, FYR","name_alt":null,"mapcolor7":5,"mapcolor8":3,"mapcolor9":7,"mapcolor13":3,"pop_est":2066718,"gdp_md_est":18780,"pop_year":-99,"lastcensus":2010,"gdp_year":-99,"economy":"6. Developing region","income_grp":"3. Upper middle income","wikipedia":-99,"fips_10":null,"iso_a2":"MK","iso_a3":"MKD","iso_n3":"807","un_a3":"807","wb_a2":"MK","wb_a3":"MKD","woe_id":-99,"adm0_a3_is":"MKD","adm0_a3_us":"MKD","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Southern Europe","region_wb":"Europe & Central Asia","name_len":9,"long_len":9,"abbrev_len":4,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[20.59023,41.85541],[20.71731000000011,41.84711],[20.76216,42.05186],[21.35270000000014,42.2068],[21.57663598940212,42.24522439706186],[21.917080000000112,42.30364],[22.38052575042468,42.32025950781508],[22.881373732197346,41.999297186850356],[22.952377150166512,41.33799388281119],[22.76177,41.3048],[22.597308383889015,41.130487168943205],[22.05537763844427,41.14986583105269],[21.674160597426976,40.931274522457954],[21.0200403174764,40.84272695572588],[20.60518,41.08622],[20.46315,41.5150900000001],[20.59023,41.85541]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":6,"sovereignt":"Montenegro","sov_a3":"MNE","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Montenegro","adm0_a3":"MNE","geou_dif":0,"geounit":"Montenegro","gu_a3":"MNE","su_dif":0,"subunit":"Montenegro","su_a3":"MNE","brk_diff":0,"name":"Montenegro","name_long":"Montenegro","brk_a3":"MNE","brk_name":"Montenegro","brk_group":null,"abbrev":"Mont.","postal":"ME","formal_en":"Montenegro","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Montenegro","name_alt":null,"mapcolor7":4,"mapcolor8":1,"mapcolor9":4,"mapcolor13":5,"pop_est":672180,"gdp_md_est":6816,"pop_year":-99,"lastcensus":2011,"gdp_year":-99,"economy":"6. Developing region","income_grp":"3. Upper middle income","wikipedia":-99,"fips_10":null,"iso_a2":"ME","iso_a3":"MNE","iso_n3":"499","un_a3":"499","wb_a2":"ME","wb_a3":"MNE","woe_id":-99,"adm0_a3_is":"MNE","adm0_a3_us":"MNE","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Southern Europe","region_wb":"Europe & Central Asia","name_len":10,"long_len":10,"abbrev_len":5,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[19.801613396898688,42.50009349219084],[19.73805138517963,42.68824738216557],[19.3044900000001,42.19574],[19.37177000000014,41.87755],[19.16246,41.95502],[18.88214,42.28151],[18.45,42.48],[18.56,42.65],[18.70648,43.20011],[19.03165,43.43253],[19.21852,43.52384],[19.48389,43.35229],[19.63,43.21377997027054],[19.95857,43.10604],[20.3398,42.89852],[20.25758,42.81275000000011],[20.0707,42.58863],[19.801613396898688,42.50009349219084]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":5,"sovereignt":"Netherlands","sov_a3":"NL1","adm0_dif":1,"level":2,"type":"Country","admin":"Netherlands","adm0_a3":"NLD","geou_dif":0,"geounit":"Netherlands","gu_a3":"NLD","su_dif":0,"subunit":"Netherlands","su_a3":"NLD","brk_diff":0,"name":"Netherlands","name_long":"Netherlands","brk_a3":"NLD","brk_name":"Netherlands","brk_group":null,"abbrev":"Neth.","postal":"NL","formal_en":"Kingdom of the Netherlands","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Netherlands","name_alt":null,"mapcolor7":4,"mapcolor8":2,"mapcolor9":2,"mapcolor13":9,"pop_est":16715999,"gdp_md_est":672000,"pop_year":-99,"lastcensus":2011,"gdp_year":-99,"economy":"2. Developed region: nonG7","income_grp":"1. High income: OECD","wikipedia":-99,"fips_10":null,"iso_a2":"NL","iso_a3":"NLD","iso_n3":"528","un_a3":"528","wb_a2":"NL","wb_a3":"NLD","woe_id":-99,"adm0_a3_is":"NLD","adm0_a3_us":"NLD","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Western Europe","region_wb":"Europe & Central Asia","name_len":11,"long_len":11,"abbrev_len":5,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[6.074182570020923,53.510403347378144],[6.905139601274129,53.48216217713065],[7.092053256873896,53.144043280644894],[6.842869500362383,52.22844025329755],[6.589396599970826,51.852029120483394],[5.988658074577813,51.851615709025054],[6.15665815595878,50.80372101501058],[5.606975945670001,51.03729848896978],[4.973991326526914,51.47502370869813],[4.047071160507528,51.26725861266857],[3.314971144228537,51.34575511331991],[3.830288527043137,51.62054454203195],[4.705997348661185,53.091798407597764],[6.074182570020923,53.510403347378144]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":3,"sovereignt":"Norway","sov_a3":"NOR","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Norway","adm0_a3":"NOR","geou_dif":0,"geounit":"Norway","gu_a3":"NOR","su_dif":0,"subunit":"Norway","su_a3":"NOR","brk_diff":0,"name":"Norway","name_long":"Norway","brk_a3":"NOR","brk_name":"Norway","brk_group":null,"abbrev":"Nor.","postal":"N","formal_en":"Kingdom of Norway","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Norway","name_alt":null,"mapcolor7":5,"mapcolor8":3,"mapcolor9":8,"mapcolor13":12,"pop_est":4676305,"gdp_md_est":276400,"pop_year":-99,"lastcensus":2001,"gdp_year":-99,"economy":"2. Developed region: nonG7","income_grp":"1. High income: OECD","wikipedia":-99,"fips_10":null,"iso_a2":"NO","iso_a3":"NOR","iso_n3":"578","un_a3":"578","wb_a2":"NO","wb_a3":"NOR","woe_id":-99,"adm0_a3_is":"NOR","adm0_a3_us":"NOR","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Northern Europe","region_wb":"Europe & Central Asia","name_len":6,"long_len":6,"abbrev_len":4,"tiny":-99,"homepart":1},"geometry":
+{"type":"MultiPolygon","coordinates":[[[[28.165547316202918,71.18547435168051],[31.293418409965483,70.45378774685992],[30.005435011522792,70.1862588568849],[31.101078728975125,69.55808014594487],[29.399580519332886,69.15691600206307],[28.591929559043194,69.0647769232867],[29.015572950971972,69.76649119737797],[27.73229210786789,70.1641930202963],[26.1796220232263,69.82529897732616],[25.689212680776393,69.09211375596902],[24.73567915212672,68.64955678982145],[23.662049594830762,68.89124746365053],[22.356237827247412,68.84174144151496],[21.24493615081073,69.37044302029312],[20.645592889089585,69.10624726020086],[20.025268995857914,69.06513865831272],[19.878559604581255,68.40719432237262],[17.99386844246439,68.56739126247734],[17.729181756265348,68.01055186631623],[16.76887861498554,68.01393667263139],[16.108712192456835,67.3024555528369],[15.108411492583059,66.19386688909543],[13.55568973150909,64.78702769638147],[13.919905226302205,64.44542064071612],[13.57191613124877,64.04911408146967],[12.579935336973932,64.06621898055835],[11.930569288794231,63.12831757267699],[11.992064243221535,61.800362453856565],[12.631146681375242,61.2935716823701],[12.3003658382749,60.11793284773006],[11.468271925511175,59.432393296946],[11.027368605196926,58.8561494004594],[10.356556837616097,59.46980703392538],[8.382000359743643,58.31328847923328],[7.048748406613299,58.078884182357285],[5.665835402050419,58.58815542259367],[5.308234490590735,59.66323191999382],[4.992078077829007,61.970998033284275],[5.912900424837886,62.614472968182696],[8.553411085655767,63.45400828719647],[10.527709181366788,64.48603831649748],[12.358346795306375,65.87972585719316],[14.761145867581604,67.81064158799515],[16.43592736172897,68.56320547146169],[19.184028354578516,69.81744415961782],[21.378416375420613,70.25516937934606],[23.023742303161583,70.20207184516627],[24.546543409938522,71.03049673123724],[26.37004967622181,70.98626170519537],[28.165547316202918,71.18547435168051]]],[[[24.72412,77.85385],[22.49032,77.44493],[20.72601,77.67704],[21.41611,77.93504],[20.8119,78.25463],[22.88426,78.45494],[23.28134,78.07954],[24.72412,77.85385]]],[[[18.25183,79.70175],[21.54383,78.95611],[19.02737,78.5626],[18.47172,77.82669],[17.59441,77.63796],[17.1182,76.80941],[15.91315,76.77045],[13.76259,77.38035],[14.66956,77.73565],[13.1706,78.02493],[11.22231,78.8693],[10.44453,79.65239],[13.17077,80.01046],[13.71852,79.66039],[15.14282,79.67431],[15.52255,80.01608],[16.99085,80.05086],[18.25183,79.70175]]],[[[25.447625359811894,80.40734039989451],[27.4075057309135,80.05640574820046],[25.92465050629818,79.51783397085455],[23.02446577321362,79.4000117052291],[20.075188429451885,79.56682322866726],[19.897266473070914,79.84236196564751],[18.462263624757924,79.85988027619442],[17.368015170977458,80.31889618602702],[20.455992059010697,80.59815562613224],[21.907944777115404,80.35767934846209],[22.919252557067438,80.6571442735935],[25.447625359811894,80.40734039989451]]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":3,"sovereignt":"Poland","sov_a3":"POL","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Poland","adm0_a3":"POL","geou_dif":0,"geounit":"Poland","gu_a3":"POL","su_dif":0,"subunit":"Poland","su_a3":"POL","brk_diff":0,"name":"Poland","name_long":"Poland","brk_a3":"POL","brk_name":"Poland","brk_group":null,"abbrev":"Pol.","postal":"PL","formal_en":"Republic of Poland","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Poland","name_alt":null,"mapcolor7":3,"mapcolor8":7,"mapcolor9":1,"mapcolor13":2,"pop_est":38482919,"gdp_md_est":667900,"pop_year":-99,"lastcensus":2011,"gdp_year":-99,"economy":"2. Developed region: nonG7","income_grp":"1. High income: OECD","wikipedia":-99,"fips_10":null,"iso_a2":"PL","iso_a3":"POL","iso_n3":"616","un_a3":"616","wb_a2":"PL","wb_a3":"POL","woe_id":-99,"adm0_a3_is":"POL","adm0_a3_us":"POL","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Eastern Europe","region_wb":"Europe & Central Asia","name_len":6,"long_len":6,"abbrev_len":4,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[15.01699588385867,51.10667409932158],[14.607098422919535,51.74518809671997],[14.685026482815687,52.0899474147552],[14.437599725002201,52.62485016540839],[14.074521111719491,52.98126251892543],[14.353315463934138,53.24817129171297],[14.119686313542587,53.75702912049104],[14.802900424873458,54.05070628520575],[16.36347700365573,54.513158677785725],[17.622831658608675,54.85153595643291],[18.62085859546164,54.68260569927078],[18.696254510175464,54.43871877706929],[19.660640089606403,54.42608388937393],[20.892244500418627,54.31252492941253],[22.731098667092652,54.327536932993326],[23.24398725758951,54.22056671814914],[23.48412763844985,53.91249766704114],[23.527535841575002,53.470121568406555],[23.80493493011778,53.089731350306074],[23.79919884613338,52.69109935160657],[23.199493849386187,52.48697744405367],[23.508002150168693,52.02364655212473],[23.527070753684374,51.57845408793024],[24.029985792748903,50.70540660257518],[23.922757195743262,50.42488108987875],[23.426508416444392,50.308505764357456],[22.518450148211603,49.47677358661974],[22.776418898212626,49.02739533140962],[22.558137648211755,49.085738023467144],[21.607808058364213,49.47010732685409],[20.887955356538413,49.32877228453583],[20.415839471119853,49.43145335549977],[19.825022820726872,49.21712535256923],[19.320712517990472,49.571574001659194],[18.90957482267632,49.435845852244576],[18.853144158613617,49.49622976337764],[18.392913852622172,49.98862864847075],[17.64944502123899,50.049038397819956],[17.55456709155112,50.36214590107642],[16.86876915860566,50.47397370055603],[16.719475945714436,50.21574656839354],[16.176253289462267,50.42260732685791],[16.23862674323857,50.69773265237984],[15.490972120839729,50.78472992614321],[15.01699588385867,51.10667409932158]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":2,"sovereignt":"Portugal","sov_a3":"PRT","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Portugal","adm0_a3":"PRT","geou_dif":0,"geounit":"Portugal","gu_a3":"PRT","su_dif":1,"subunit":"Portugal","su_a3":"PR1","brk_diff":0,"name":"Portugal","name_long":"Portugal","brk_a3":"PR1","brk_name":"Portugal","brk_group":null,"abbrev":"Port.","postal":"P","formal_en":"Portuguese Republic","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Portugal","name_alt":null,"mapcolor7":1,"mapcolor8":7,"mapcolor9":1,"mapcolor13":4,"pop_est":10707924,"gdp_md_est":208627,"pop_year":-99,"lastcensus":2011,"gdp_year":0,"economy":"2. Developed region: nonG7","income_grp":"1. High income: OECD","wikipedia":-99,"fips_10":null,"iso_a2":"PT","iso_a3":"PRT","iso_n3":"620","un_a3":"620","wb_a2":"PT","wb_a3":"PRT","woe_id":-99,"adm0_a3_is":"PRT","adm0_a3_us":"PRT","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Southern Europe","region_wb":"Europe & Central Asia","name_len":8,"long_len":8,"abbrev_len":5,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[-9.034817674180246,41.880570583659676],[-8.67194576662672,42.13468943945496],[-8.263856980817792,42.28046865495034],[-8.013174607769912,41.790886135417125],[-7.422512986673795,41.79207469335984],[-7.251308966490824,41.91834605566505],[-6.668605515967656,41.883386949219584],[-6.389087693700915,41.381815497394655],[-6.851126674822552,41.11108266861753],[-6.864019944679385,40.33087189387483],[-7.026413133156595,40.184524237624245],[-7.066591559263529,39.711891587882775],[-7.498632371439726,39.62957103124181],[-7.098036668313128,39.03007274022379],[-7.374092169616318,38.37305858006492],[-7.029281175148796,38.07576406508977],[-7.166507941099865,37.803894354802225],[-7.537105475281024,37.42890432387624],[-7.453725551778092,37.09778758396607],[-7.855613165711986,36.83826854099627],[-8.382816127953689,36.97888011326246],[-8.898856980820327,36.86880931248078],[-8.746101446965554,37.65134552667661],[-8.83999752443988,38.266243394517616],[-9.287463751655224,38.3584858261586],[-9.526570603869715,38.73742910415491],[-9.446988898140233,39.39206614842837],[-9.048305223008427,39.75509308527877],[-8.977353481471681,40.15930613866581],[-8.768684047877102,40.76063894303019],[-8.79085323733031,41.18433401139126],[-8.99078935386757,41.54345937760364],[-9.034817674180246,41.880570583659676]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":3,"sovereignt":"Romania","sov_a3":"ROU","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Romania","adm0_a3":"ROU","geou_dif":0,"geounit":"Romania","gu_a3":"ROU","su_dif":0,"subunit":"Romania","su_a3":"ROU","brk_diff":0,"name":"Romania","name_long":"Romania","brk_a3":"ROU","brk_name":"Romania","brk_group":null,"abbrev":"Rom.","postal":"RO","formal_en":"Romania","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Romania","name_alt":null,"mapcolor7":1,"mapcolor8":4,"mapcolor9":3,"mapcolor13":13,"pop_est":22215421,"gdp_md_est":271400,"pop_year":-99,"lastcensus":2011,"gdp_year":-99,"economy":"2. Developed region: nonG7","income_grp":"3. Upper middle income","wikipedia":-99,"fips_10":null,"iso_a2":"RO","iso_a3":"ROU","iso_n3":"642","un_a3":"642","wb_a2":"RO","wb_a3":"ROM","woe_id":-99,"adm0_a3_is":"ROU","adm0_a3_us":"ROU","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Eastern Europe","region_wb":"Europe & Central Asia","name_len":7,"long_len":7,"abbrev_len":4,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[22.710531447040495,47.88219391538941],[23.142236362406805,48.09634105080695],[23.76095828623741,47.985598456405455],[24.40205610525038,47.98187775328043],[24.866317172960578,47.737525743188314],[25.20774336111299,47.89105642352747],[25.9459411964024,47.987148749374214],[26.19745039236693,48.22088125263035],[26.619336785597795,48.22072622333347],[26.924176059687568,48.123264472030996],[27.233872918412743,47.82677094175638],[27.551166212684848,47.40511709247083],[28.128030226359044,46.810476386088254],[28.160017937947714,46.37156260841722],[28.0544429867754,45.944586086605625],[28.233553501099042,45.488283189468376],[28.67977949393938,45.304030870131704],[29.149724969201653,45.464925442072456],[29.603289015427436,45.293308010431126],[29.62654340995877,45.0353909368624],[29.141611769331835,44.820210272799045],[28.8378577003202,44.913873806328056],[28.558081495891997,43.70746165625813],[27.970107049275075,43.81246816667522],[27.242399529740908,44.175986029632405],[26.065158725699746,43.94349376075127],[25.569271681426926,43.68844472917472],[24.100679152124172,43.74105133724785],[23.332302280376325,43.897010809904714],[22.944832391051847,43.82378530534713],[22.65714969248299,44.23492300066128],[22.4740084164406,44.40922760678177],[22.705725538837356,44.57800283464702],[22.459022251075936,44.7025171982543],[22.14508792490281,44.47842234962059],[21.56202273935361,44.7689472519655],[21.483526238702236,45.18117015235778],[20.874312778413355,45.416375433934235],[20.762174920339987,45.73457306577144],[20.220192498462836,46.127468980486555],[21.02195234547125,46.3160879583519],[21.626514926853872,46.99423777931816],[22.099767693782837,47.6724392767167],[22.710531447040495,47.88219391538941]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":2,"sovereignt":"Russia","sov_a3":"RUS","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Russia","adm0_a3":"RUS","geou_dif":0,"geounit":"Russia","gu_a3":"RUS","su_dif":0,"subunit":"Russia","su_a3":"RUS","brk_diff":0,"name":"Russia","name_long":"Russian Federation","brk_a3":"RUS","brk_name":"Russia","brk_group":null,"abbrev":"Rus.","postal":"RUS","formal_en":"Russian Federation","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Russian Federation","name_alt":null,"mapcolor7":2,"mapcolor8":5,"mapcolor9":7,"mapcolor13":7,"pop_est":140041247,"gdp_md_est":2266000,"pop_year":-99,"lastcensus":2010,"gdp_year":-99,"economy":"3. Emerging region: BRIC","income_grp":"3. Upper middle income","wikipedia":-99,"fips_10":null,"iso_a2":"RU","iso_a3":"RUS","iso_n3":"643","un_a3":"643","wb_a2":"RU","wb_a3":"RUS","woe_id":-99,"adm0_a3_is":"RUS","adm0_a3_us":"RUS","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Eastern Europe","region_wb":"Europe & Central Asia","name_len":6,"long_len":18,"abbrev_len":4,"tiny":-99,"homepart":1},"geometry":
+{"type":"MultiPolygon","coordinates":[[[[143.64800744036287,50.74760040954152],[144.65414757708564,48.976390692737596],[143.17392785051723,49.30655141865037],[142.5586682476501,47.861575018904915],[143.53349246640406,46.83672801369249],[143.50527713437262,46.13790761980948],[142.74770063697392,46.74076487892657],[142.0920300640545,45.96675527605879],[141.90692508358504,46.80592886004655],[142.0184428244709,47.780132961612935],[141.90444461483506,48.85918854429957],[142.13580000220568,49.61516307229746],[142.1799833518153,50.95234243428192],[141.59407596249005,51.93543488220254],[141.68254601457366,53.30196645772878],[142.60693403541077,53.762145087287905],[142.2097489768154,54.22547597921687],[142.654786411713,54.36588084575388],[142.91461551327657,53.70457754171474],[143.26084760963207,52.74076040303905],[143.23526777564766,51.75666026468875],[143.64800744036287,50.74760040954152]]],[[[22.731098667092652,54.327536932993326],[20.892244500418656,54.312524929412575],[19.660640089606403,54.426083889373984],[19.888481479581344,54.8661603867715],[21.2684489275035,55.19048167583529],[22.315723504330606,55.0152985703659],[22.757763706155288,54.85657440858142],[22.651051873472568,54.58274099386671],[22.731098667092652,54.327536932993326]]],[[[-175.01425,66.58435],[-174.33983,66.33556],[-174.57182,67.06219],[-171.85731,66.91308],[-169.89958,65.97724],[-170.89107,65.54139],[-172.53025,65.43791],[-172.555,64.46079],[-172.95533,64.25269],[-173.89184,64.2826],[-174.65392,64.63125],[-175.98353,64.92288],[-176.20716,65.35667],[-177.22266,65.52024],[-178.35993,65.39052],[-178.90332,65.74044],[-178.68611,66.11211],[-179.88377,65.87456],[-179.43268,65.40411],[-180,64.97970870219837],[-180,68.96363636363637],[-177.55,68.2],[-174.92825,67.20589],[-175.01425,66.58435]]],[[[180.00000000000014,70.83219920854668],[178.9034250000001,70.78114],[178.7253,71.0988],[180.00000000000014,71.51571433642826],[180.00000000000014,70.83219920854668]]],[[[-178.69378,70.89302],[-180,70.83219920854668],[-180,71.51571433642826],[-179.87187,71.55762],[-179.02433,71.55553],[-177.577945,71.26948],[-177.663575,71.13277],[-178.69378,70.89302]]],[[[143.60385,73.21244],[142.08763,73.20544],[140.038155,73.31692],[139.86312,73.36983],[140.81171,73.76506],[142.06207,73.85758],[143.48283,73.47525],[143.60385,73.21244]]],[[[150.73167,75.08406],[149.575925,74.68892],[147.97746,74.778355],[146.11919,75.17298],[146.358485,75.49682],[148.22223,75.345845],[150.73167,75.08406]]],[[[145.086285,75.56262],[144.3,74.82],[140.61381,74.84768],[138.95544,74.61148],[136.97439,75.26167],[137.51176,75.94917],[138.831075,76.13676],[141.47161,76.09289],[145.086285,75.56262]]],[[[57.5356925799924,70.72046397570216],[56.94497928246395,70.63274323188668],[53.6773751157842,70.76265778266847],[53.41201663596539,71.2066616889202],[51.60189456564572,71.47475901965049],[51.45575361512422,72.01488108996514],[52.47827518088357,72.22944163684096],[52.444168735570855,72.77473135038485],[54.42761355979766,73.62754751249759],[53.50828982932515,73.74981395130015],[55.90245893740766,74.62748647734534],[55.631932814359715,75.08141225859717],[57.86864383324885,75.60939036732321],[61.170044386647504,76.25188345000814],[64.49836836127022,76.43905548776928],[66.2109770038551,76.80978221303124],[68.15705976753483,76.93969676381292],[68.85221113472514,76.54481130645462],[68.18057254422766,76.23364166940911],[64.63732628770302,75.73775462513623],[61.58350752141476,75.2608845079468],[58.47708214705338,74.30905630156283],[56.98678551618801,73.33304352486624],[55.419335971910954,72.37126760526598],[55.622837762276305,71.54059479439033],[57.5356925799924,70.72046397570216]]],[[[106.97013000000013,76.97419],[107.24000000000015,76.48],[108.1538,76.72335000000015],[111.07726000000017,76.71],[113.33151,76.22224],[114.13417,75.84764],[113.88539,75.32779000000014],[112.77918,75.03186],[110.1512500000002,74.47673],[109.4,74.18],[110.64,74.04],[112.11919,73.78774000000013],[113.01954000000026,73.97693000000015],[113.52958000000032,73.33505000000011],[113.96881,73.5948800000001],[115.56782,73.75285],[118.77633000000023,73.58772],[119.02,73.12],[123.20066000000011,72.97122],[123.25777000000019,73.73503000000011],[125.3800000000002,73.56],[126.97644,73.56549],[128.59126,73.03871],[129.05157,72.39872],[128.46000000000012,71.98],[129.71599000000023,71.19304],[131.28858000000028,70.78699000000012],[132.25350000000017,71.83630000000011],[133.85766000000032,71.38642000000016],[135.56193,71.65525000000014],[137.49755,71.34763],[138.23409000000018,71.62803],[139.86983000000012,71.48783000000014],[139.14791,72.41619000000011],[140.46817,72.84941000000015],[149.5,72.2],[150.3511800000002,71.60643],[152.96890000000022,70.84222],[157.00688,71.03141],[158.99779,70.86672],[159.83031000000025,70.45324],[159.70866,69.72198],[160.94053000000034,69.4372800000001],[162.27907000000013,69.64204],[164.05248000000014,69.66823],[165.94037000000023,69.47199],[167.83567,69.58269],[169.5776300000002,68.6938],[170.81688000000028,69.01363],[170.0082000000002,69.65276],[170.4534500000003,70.09703],[173.64391000000026,69.81743],[175.72403000000023,69.87725000000023],[178.6,69.4],[180.00000000000014,68.96363636363657],[180.00000000000014,64.97970870219848],[179.99281,64.97433],[178.70720000000026,64.53493],[177.41128000000018,64.60821],[178.31300000000024,64.07593],[178.9082500000002,63.25197000000014],[179.37034,62.98262000000011],[179.48636,62.56894],[179.22825000000014,62.30410000000015],[177.3643,62.5219],[174.56929000000022,61.76915],[173.68013,61.65261],[172.15,60.95],[170.6985000000001,60.33618],[170.3308500000003,59.88177],[168.90046,60.57355],[166.29498000000032,59.788550000000214],[165.84000000000023,60.16],[164.87674,59.7316],[163.53929000000014,59.86871],[163.21711000000025,59.21101],[162.0173300000001,58.24328],[162.05297,57.83912],[163.19191,57.615030000000104],[163.05794000000017,56.159240000000125],[162.12958000000023,56.12219],[161.70146,55.285680000000156],[162.11749000000017,54.85514],[160.36877000000035,54.34433],[160.02173000000025,53.20257],[158.5309400000002,52.95868000000024],[158.23118,51.94269],[156.7897900000003,51.01105],[156.42000000000016,51.7],[155.99182,53.15895],[155.43366000000012,55.38103000000012],[155.91442000000032,56.767920000000146],[156.75815,57.3647],[156.8103500000001,57.83204],[158.3643300000002,58.05575],[160.15064000000015,59.314770000000124],[161.87204,60.34300000000013],[163.66969,61.1409000000001],[164.47355000000013,62.55061],[163.2584200000002,62.46627],[162.65791,61.6425],[160.1214800000001,60.54423],[159.30232,61.7739600000001],[156.7206800000001,61.43442],[154.21806000000035,59.758180000000124],[155.04375,59.14495],[152.81185,58.88385],[151.26573000000027,58.78089],[151.33815000000013,59.50396],[149.78371,59.65573000000015],[148.54481,59.16448],[145.48722,59.33637],[142.19782000000018,59.03998],[138.95848000000032,57.08805],[135.12619,54.72959],[136.70171,54.603550000000126],[137.19342,53.97732],[138.1647,53.755010000000254],[138.80463,54.25455000000011],[139.90151,54.18968000000018],[141.34531,53.08957000000012],[141.37923,52.23877],[140.5974200000002,51.2396700000001],[140.51308,50.04553000000013],[140.06193000000022,48.44671000000017],[138.55472000000023,46.99965],[138.21971,46.30795],[136.86232,45.14350000000019],[135.5153500000002,43.989],[134.86939000000027,43.39821],[133.53687000000028,42.81147],[132.90627000000015,42.7984900000001],[132.27807000000027,43.28456000000011],[130.93587000000016,42.55274],[130.78,42.2200000000002],[130.64000000000019,42.395],[130.63386640840983,42.90301463477056],[131.144687941615,42.92998973242695],[131.28855512911562,44.111519680348266],[131.02519000000026,44.96796],[131.8834542176596,45.32116160743652],[133.09712000000022,45.14409],[133.7696439963132,46.116926988299156],[134.1123500000002,47.21248000000014],[134.50081,47.578450000000146],[135.0263114767868,48.47822988544391],[133.37359581922803,48.18344167743484],[132.50669000000013,47.78896],[130.98726000000013,47.79013],[130.58229332898267,48.729687404976204],[129.3978178244205,49.440600084015614],[127.65740000000037,49.76027],[127.28745568248493,50.73979726826545],[126.93915652883786,51.35389415140591],[126.564399041857,51.7842554795327],[125.94634891164648,52.79279857035695],[125.06821129771046,53.16104482686893],[123.57147,53.4588],[122.24574791879306,53.431725979213695],[121.00308475147037,53.25140106873124],[120.1770886577169,52.75388621684121],[120.725789015792,52.51622630473091],[120.7382,51.96411],[120.18208000000018,51.64355],[119.27939,50.58292],[119.28846072802585,50.14288279886196],[117.8792444194265,49.51098338479704],[116.67880089728621,49.888531399121405],[115.48569542853144,49.80517731383475],[114.9621098165504,50.14024730081513],[114.36245649623535,50.248302720737485],[112.89773969935439,49.54356537535699],[111.58123091028668,49.37796824807768],[110.66201053267886,49.13012807880585],[109.40244917199672,49.29296051695769],[108.47516727095129,49.28254771585071],[107.86817589725112,49.793705145865886],[106.88880415245532,50.27429596618029],[105.8865914245869,50.406019192092174],[104.62158,50.275320000000164],[103.67654544476036,50.089966132195144],[102.25589000000011,50.51056000000011],[102.06521,51.259910000000104],[100.88948042196265,51.51685578063842],[99.98173221232358,51.63400625264396],[98.8614905131005,52.04736603454671],[97.82573978067452,51.01099518493325],[98.23176150919173,50.42240062112873],[97.25976000000023,49.72605],[95.81402000000017,49.97746000000012],[94.81594933469879,50.01343333597089],[94.14756635943561,50.48053660745717],[93.10421,50.49529],[92.23471154171969,50.80217072204175],[90.71366743364078,50.331811835321105],[88.80556684769559,49.47052073831247],[87.75126427607685,49.29719798440556],[87.3599703307627,49.21498078062916],[86.82935672398966,49.82667470966814],[85.5412699726825,49.69285858824816],[85.11555952346211,50.11730296487764],[84.41637739455305,50.311399644565824],[83.93511478061893,50.88924551045358],[83.38300377801247,51.069182847693895],[81.94598554883996,50.81219594990634],[80.56844689323546,51.38833649352844],[80.03555952344172,50.864750881547224],[77.80091556184433,53.40441498474755],[76.52517947785478,54.17700348572714],[76.89110029491346,54.49052440044193],[74.38482000000013,53.54685000000012],[73.42567874542053,53.489810289109755],[73.50851606638437,54.0356167669766],[72.22415001820221,54.37665538188679],[71.1801310566095,54.13328522400826],[70.86526655465516,55.169733588270105],[69.0681669452729,55.3852501491435],[68.16910037625891,54.97039175070438],[65.6668700000001,54.601250000000164],[65.17853356309595,54.35422781027208],[61.43660000000014,54.00625],[60.97806644068325,53.66499339457914],[61.699986199800634,52.97999644633427],[60.73999311711455,52.71998647725775],[60.92726850774025,52.44754832621501],[59.967533807215574,51.960420437215674],[61.58800337102414,51.272658799843185],[61.33742435084102,50.79907013610426],[59.932807244715576,50.842194118851836],[59.64228234237058,50.545442206415714],[58.36332000000013,51.06364],[56.77798,51.04355],[55.71694000000011,50.62171000000015],[54.532878452376195,51.02623973245937],[52.32872358583106,51.718652248738096],[50.76664839051219,51.692762356159875],[48.70238162618105,50.60512848571284],[48.577841424357615,49.874759629915644],[47.549480421749394,50.454698391311126],[46.75159630716277,49.35600576435374],[47.0436715024766,49.152038886097586],[46.4664457537763,48.39415233010493],[47.31524000000016,47.71585],[48.05725,47.74377],[48.694733514201886,47.0756281601779],[48.593250000000154,46.561040000000105],[49.101160000000135,46.399330000000106],[48.64541000000011,45.80629],[47.67591,45.64149000000012],[46.68201,44.6092000000001],[47.59094,43.66016000000013],[47.49252,42.98658],[48.58437000000018,41.80888],[47.98728315612604,41.4058192001944],[47.81566572448466,41.15141612402135],[47.373315464066394,41.21973236751114],[46.686070591016716,41.827137152669906],[46.40495079934894,41.86067515722743],[45.7764,42.09244000000024],[45.470279168485916,42.50278066667005],[44.53762291848207,42.711992702803684],[43.93121000000011,42.55496000000011],[43.755990000000196,42.74083],[42.39440000000016,43.2203],[40.92219000000014,43.38215000000014],[40.07696495947985,43.553104153002494],[39.955008579271095,43.434997666999294],[38.68,44.28],[37.53912000000011,44.65721],[36.67546000000013,45.24469],[37.40317,45.4045100000001],[38.23295,46.24087],[37.67372,46.63657],[39.14767,47.044750000000136],[39.12120000000013,47.26336],[38.22353803889948,47.10218984637598],[38.25511233902981,47.54640045835697],[38.77057,47.82562000000024],[39.738277622238996,47.89893707945208],[39.89562000000015,48.23241],[39.67465,48.783820000000134],[40.08078901546949,49.30742991799937],[40.069040000000115,49.60105],[38.59498823421356,49.92646190042373],[38.010631137857075,49.91566152607473],[37.39345950699524,50.38395335550368],[36.626167840325394,50.225590928745135],[35.35611616388812,50.57719737405915],[35.37791,50.77394],[35.02218305841794,51.2075723333715],[34.22481570815441,51.255993150428935],[34.14197838719062,51.566413479206204],[34.391730584457235,51.768881740925906],[33.75269982273588,52.33507457133166],[32.71576053236717,52.238465481162166],[32.412058139787774,52.28869497334978],[32.15944000000022,52.061250000000115],[31.78597,52.10168],[31.54001834486226,52.74205231384644],[31.305200636527985,53.07399587667331],[31.49764,53.16743000000014],[32.304519484188376,53.13272614197285],[32.693643019346126,53.35142080343215],[32.405598585751164,53.618045355842014],[31.731272820774592,53.79402944601202],[31.791424187962406,53.974638576872195],[31.384472283663825,54.15705638286238],[30.75753380709878,54.8117709417844],[30.97183597181325,55.081547756564134],[30.87390913262007,55.55097646750352],[29.89629438652244,55.7894632025305],[29.37157189303079,55.67009064393628],[29.229513380660393,55.91834422466641],[28.17670942557794,56.16912995057879],[27.855282016722526,56.75932648378438],[27.770015903440992,57.2442581244112],[27.288184848751655,57.47452830670392],[27.71668582531578,57.79189911562446],[27.420150000000206,58.72457000000014],[28.131699253051863,59.300825100331],[27.98112,59.47537],[29.1177,60.02805000000012],[28.07,60.50352000000015],[30.211107212044652,61.780027777749694],[31.139991082491036,62.35769277612445],[31.516092156711267,62.867687486412905],[30.035872430142803,63.552813625738565],[30.44468468600374,64.20445343693908],[29.544429559047018,64.94867157659056],[30.21765,65.80598],[29.054588657352383,66.94428620062203],[29.977426385220696,67.69829702419275],[28.445943637818772,68.364612942164],[28.591929559043365,69.0647769232867],[29.39955,69.15692000000018],[31.10108000000011,69.55811],[32.13272000000026,69.90595000000025],[33.77547,69.30142000000012],[36.51396,69.06342],[40.292340000000166,67.9324],[41.05987000000013,67.45713000000012],[41.12595000000019,66.79158000000012],[40.01583,66.26618000000013],[38.38295,65.9995300000001],[33.918710000000175,66.75961],[33.18444,66.63253],[34.81477,65.90015000000014],[34.87857425307877,65.4362128770482],[34.94391000000016,64.41437000000016],[36.23129,64.10945],[37.01273000000012,63.84983000000011],[37.14197000000016,64.33471],[36.539579035089815,64.76446],[37.17604000000014,65.14322000000013],[39.59345,64.52079000000018],[40.43560000000011,64.76446],[39.76260000000016,65.49682],[42.0930900000001,66.47623],[43.01604000000012,66.4185800000001],[43.94975000000014,66.06908],[44.53226,66.75634000000014],[43.69839,67.35245],[44.18795000000014,67.95051],[43.45282,68.57079],[46.25000000000014,68.25],[46.82134000000016,67.68997],[45.55517,67.56652],[45.5620200000001,67.0100500000002],[46.34915000000015,66.6676700000001],[47.894160000000255,66.88455000000016],[48.13876,67.52238],[50.22766000000016,67.99867000000015],[53.71743000000018,68.85738000000012],[54.47171,68.80815],[53.48582000000013,68.20131],[54.72628,68.09702],[55.44268000000014,68.43866],[57.317020000000156,68.46628],[58.80200000000022,68.88082],[59.94142000000019,68.2784400000001],[61.07784000000018,68.94069],[60.03,69.52],[60.55,69.85],[63.50400000000016,69.54739],[64.888115,69.23483500000015],[68.51216000000014,68.09233000000017],[69.18068,68.61563000000012],[68.16444,69.14436],[68.13522,69.35649],[66.93008000000012,69.45461000000012],[67.25976,69.92873],[66.72492000000014,70.70889000000014],[66.69466,71.02897000000024],[68.54006000000012,71.93450000000024],[69.19636000000011,72.84336000000016],[69.94,73.04000000000013],[72.58754,72.7762900000001],[72.79603,72.22006],[71.8481100000001,71.40898],[72.47011,71.09019],[72.79188,70.39114],[72.56470000000022,69.02085],[73.66787,68.4079],[73.2387,67.7404],[71.28000000000011,66.32000000000016],[72.42301000000018,66.17267000000018],[72.82077,66.53267],[73.92099000000016,66.78946000000013],[74.1865100000002,67.28429],[75.052,67.76047000000017],[74.46926000000016,68.32899],[74.93584000000013,68.98918],[73.84236,69.07146],[73.60187000000022,69.62763],[74.3998,70.63175],[73.1011,71.44717000000026],[74.89082000000022,72.12119],[74.65926,72.83227],[75.15801000000019,72.85497000000012],[75.68351,72.30056000000013],[75.28898000000012,71.33556],[76.35911,71.15287000000015],[75.90313000000017,71.87401],[77.57665000000011,72.26717],[79.65202000000014,72.32011],[81.5,71.75],[80.61071000000013,72.58285000000012],[80.51109,73.6482],[82.25,73.85000000000011],[84.65526,73.80591000000018],[86.82230000000024,73.93688],[86.00956,74.45967000000016],[87.16682000000017,75.11643],[88.31571000000011,75.14393],[90.26,75.64],[92.90058,75.77333],[93.23421000000016,76.0472],[95.86000000000016,76.1400000000001],[96.67821,75.91548],[98.92254000000023,76.44689],[100.75967000000023,76.43028],[101.03532,76.86189],[101.99084000000013,77.2875400000002],[104.3516000000001,77.69792],[106.06664000000015,77.37389],[104.70500000000024,77.1274],[106.97013000000013,76.97419]]],[[[105.07547,78.30689],[99.43814,77.921],[101.2649,79.23399],[102.08635,79.34641],[102.837815,79.28129],[105.37243,78.71334],[105.07547,78.30689]]],[[[51.13618655783128,80.54728017854094],[49.79368452332071,80.41542776154822],[48.89441124857754,80.3395667589437],[48.754936557821765,80.17546824820084],[47.586119012244154,80.01018117951534],[46.502825962109654,80.24724681265437],[47.07245527526291,80.55942414012947],[44.846958042181114,80.58980988231718],[46.79913862487123,80.77191762971364],[48.318477410684665,80.78400991486996],[48.522806023966695,80.51456899690015],[49.09718956889091,80.75398590770843],[50.03976769389462,80.91888540315182],[51.52293297710369,80.69972565380192],[51.13618655783128,80.54728017854094]]],[[[99.93976,78.88094],[97.75794,78.7562],[94.97259,79.044745],[93.31288,79.4265],[92.5454,80.14379],[91.18107,80.34146],[93.77766,81.0246],[95.940895,81.2504],[97.88385,80.746975],[100.186655,79.780135],[99.93976,78.88094]]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":5,"sovereignt":"Republic of Serbia","sov_a3":"SRB","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Republic of Serbia","adm0_a3":"SRB","geou_dif":0,"geounit":"Republic of Serbia","gu_a3":"SRB","su_dif":0,"subunit":"Republic of Serbia","su_a3":"SRB","brk_diff":0,"name":"Serbia","name_long":"Serbia","brk_a3":"SRB","brk_name":"Serbia","brk_group":null,"abbrev":"Serb.","postal":"RS","formal_en":"Republic of Serbia","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Serbia","name_alt":null,"mapcolor7":3,"mapcolor8":3,"mapcolor9":2,"mapcolor13":10,"pop_est":7379339,"gdp_md_est":80340,"pop_year":-99,"lastcensus":2011,"gdp_year":-99,"economy":"6. Developing region","income_grp":"3. Upper middle income","wikipedia":-99,"fips_10":null,"iso_a2":"RS","iso_a3":"SRB","iso_n3":"688","un_a3":"688","wb_a2":"YF","wb_a3":"SRB","woe_id":-99,"adm0_a3_is":"SRB","adm0_a3_us":"SRB","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Southern Europe","region_wb":"Europe & Central Asia","name_len":6,"long_len":6,"abbrev_len":5,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[20.87431277841341,45.41637543393432],[21.48352623870221,45.18117015235788],[21.562022739353722,44.76894725196564],[22.145087924902896,44.47842234962059],[22.459022251075965,44.70251719825444],[22.70572553883744,44.57800283464701],[22.474008416440654,44.40922760678177],[22.657149692483074,44.234923000661354],[22.410446404721597,44.008063462900054],[22.500156691180223,43.642814439461006],[22.986018507588483,43.2111612005271],[22.60480146657136,42.898518785161116],[22.436594679461393,42.58032115332395],[22.54501183440965,42.46136200618804],[22.38052575042468,42.32025950781508],[21.917080000000112,42.30364],[21.57663598940212,42.24522439706186],[21.54332,42.3202500000001],[21.66292,42.43922],[21.77505,42.6827],[21.63302,42.67717],[21.43866,42.86255],[21.27421,42.90959],[21.143395,43.06868500000013],[20.95651,43.13094],[20.81448,43.27205],[20.63508,43.21671],[20.49679,42.88469],[20.25758,42.81275000000011],[20.3398,42.89852],[19.95857,43.10604],[19.63,43.21377997027054],[19.48389,43.35229],[19.21852,43.52384],[19.454,43.56810000000013],[19.59976,44.03847],[19.11761,44.42307000000011],[19.36803,44.863],[19.00548,44.86023],[19.39047570158459,45.236515611342384],[19.072768995854176,45.52151113543209],[18.82982,45.90888],[19.59604454924164,46.17172984474456],[20.220192498462893,46.12746898048658],[20.762174920339987,45.734573065771485],[20.87431277841341,45.41637543393432]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":6,"sovereignt":"Slovakia","sov_a3":"SVK","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Slovakia","adm0_a3":"SVK","geou_dif":0,"geounit":"Slovakia","gu_a3":"SVK","su_dif":0,"subunit":"Slovakia","su_a3":"SVK","brk_diff":0,"name":"Slovakia","name_long":"Slovakia","brk_a3":"SVK","brk_name":"Slovakia","brk_group":null,"abbrev":"Svk.","postal":"SK","formal_en":"Slovak Republic","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Slovak Republic","name_alt":null,"mapcolor7":2,"mapcolor8":4,"mapcolor9":4,"mapcolor13":9,"pop_est":5463046,"gdp_md_est":119500,"pop_year":-99,"lastcensus":2011,"gdp_year":-99,"economy":"2. Developed region: nonG7","income_grp":"1. High income: OECD","wikipedia":-99,"fips_10":null,"iso_a2":"SK","iso_a3":"SVK","iso_n3":"703","un_a3":"703","wb_a2":"SK","wb_a3":"SVK","woe_id":-99,"adm0_a3_is":"SVK","adm0_a3_us":"SVK","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Eastern Europe","region_wb":"Europe & Central Asia","name_len":8,"long_len":8,"abbrev_len":4,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[18.853144158613617,49.49622976337764],[18.90957482267632,49.435845852244576],[19.320712517990472,49.571574001659194],[19.825022820726872,49.21712535256923],[20.415839471119853,49.43145335549977],[20.887955356538413,49.32877228453583],[21.607808058364213,49.47010732685409],[22.558137648211755,49.085738023467144],[22.28084191253356,48.82539215758067],[22.085608351334855,48.42226430927179],[21.872236362401736,48.31997081155002],[20.801293979584926,48.623854071642384],[20.473562045989866,48.562850043321816],[20.239054396249347,48.32756724709692],[19.769470656013112,48.202691148463614],[19.661363559658497,48.26661489520866],[19.17436486173989,48.11137889260387],[18.77702477384767,48.081768296900634],[18.696512892336926,47.880953681014404],[17.857132602620027,47.75842886005037],[17.48847293464982,47.867466132186216],[16.979666782304037,48.123497015976305],[16.879982944413,48.47001333270947],[16.960288120194576,48.5969823268506],[17.101984897538898,48.816968899117114],[17.545006951577108,48.80001902932537],[17.88648481616181,48.90347524677371],[17.913511590250465,48.996492824899086],[18.104972771891852,49.04398346617531],[18.170498488037964,49.271514797556435],[18.399993523846177,49.31500051533004],[18.554971144289482,49.495015367218784],[18.853144158613617,49.49622976337764]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":3,"sovereignt":"Sweden","sov_a3":"SWE","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Sweden","adm0_a3":"SWE","geou_dif":0,"geounit":"Sweden","gu_a3":"SWE","su_dif":0,"subunit":"Sweden","su_a3":"SWE","brk_diff":0,"name":"Sweden","name_long":"Sweden","brk_a3":"SWE","brk_name":"Sweden","brk_group":null,"abbrev":"Swe.","postal":"S","formal_en":"Kingdom of Sweden","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Sweden","name_alt":null,"mapcolor7":1,"mapcolor8":4,"mapcolor9":2,"mapcolor13":4,"pop_est":9059651,"gdp_md_est":344300,"pop_year":-99,"lastcensus":-99,"gdp_year":-99,"economy":"2. Developed region: nonG7","income_grp":"1. High income: OECD","wikipedia":-99,"fips_10":null,"iso_a2":"SE","iso_a3":"SWE","iso_n3":"752","un_a3":"752","wb_a2":"SE","wb_a3":"SWE","woe_id":-99,"adm0_a3_is":"SWE","adm0_a3_us":"SWE","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Northern Europe","region_wb":"Europe & Central Asia","name_len":6,"long_len":6,"abbrev_len":4,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[22.18317345550193,65.72374054632017],[21.21351687997722,65.02600535751527],[21.369631381930958,64.41358795842429],[19.77887576669022,63.60955434839504],[17.84777916837521,62.74940013289681],[17.119554884518124,61.34116567651097],[17.83134606290639,60.63658336042741],[18.78772179533209,60.081914374422595],[17.86922488777634,58.9537661810587],[16.829185011470088,58.71982697207339],[16.447709588291474,57.041118069071885],[15.879785597403783,56.10430186626866],[14.666681349352075,56.200885118222175],[14.100721062891465,55.40778107362265],[12.942910597392057,55.36173737245058],[12.625100538797028,56.30708018658197],[11.787942335668674,57.44181712506307],[11.027368605196868,58.85614940045936],[11.468271925511146,59.43239329694604],[12.3003658382749,60.11793284773003],[12.631146681375185,61.293571682370136],[11.992064243221563,61.80036245385655],[11.930569288794231,63.12831757267698],[12.579935336973934,64.06621898055833],[13.571916131248713,64.04911408146971],[13.919905226302204,64.44542064071608],[13.55568973150909,64.78702769638151],[15.108411492583002,66.19386688909547],[16.108712192456778,67.30245555283689],[16.768878614985482,68.0139366726314],[17.729181756265348,68.01055186631628],[17.993868442464333,68.56739126247736],[19.878559604581255,68.40719432237258],[20.025268995857886,69.0651386583127],[20.645592889089528,69.10624726020087],[21.978534783626117,68.6168456081807],[23.53947309743444,67.93600861273525],[23.565879754335583,66.39605093043743],[23.903378533633802,66.00692739527962],[22.18317345550193,65.72374054632017]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":6,"sovereignt":"Slovenia","sov_a3":"SVN","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Slovenia","adm0_a3":"SVN","geou_dif":0,"geounit":"Slovenia","gu_a3":"SVN","su_dif":0,"subunit":"Slovenia","su_a3":"SVN","brk_diff":0,"name":"Slovenia","name_long":"Slovenia","brk_a3":"SVN","brk_name":"Slovenia","brk_group":null,"abbrev":"Slo.","postal":"SLO","formal_en":"Republic of Slovenia","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Slovenia","name_alt":null,"mapcolor7":2,"mapcolor8":3,"mapcolor9":2,"mapcolor13":12,"pop_est":2005692,"gdp_md_est":59340,"pop_year":-99,"lastcensus":2011,"gdp_year":-99,"economy":"2. Developed region: nonG7","income_grp":"1. High income: OECD","wikipedia":-99,"fips_10":null,"iso_a2":"SI","iso_a3":"SVN","iso_n3":"705","un_a3":"705","wb_a2":"SI","wb_a3":"SVN","woe_id":-99,"adm0_a3_is":"SVN","adm0_a3_us":"SVN","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Southern Europe","region_wb":"Europe & Central Asia","name_len":8,"long_len":8,"abbrev_len":4,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[13.806475457421527,46.509306138691215],[14.63247155117483,46.43181732846955],[15.137091912504985,46.65870270444703],[16.011663852612656,46.6836107448117],[16.202298211337364,46.85238597267696],[16.370504998447416,46.841327216166505],[16.564808383864857,46.50375092221983],[15.768732944408553,46.23810822202345],[15.671529575267556,45.83415355079788],[15.323953891672405,45.73178253842768],[15.327674594797429,45.45231639259323],[14.935243767972935,45.471695054702685],[14.595109490627806,45.634940904312714],[14.411968214585414,45.46616567644746],[13.715059848697223,45.500323798192376],[13.937630242578308,45.59101593686462],[13.698109978905478,46.01677806251735],[13.806475457421527,46.509306138691215]]]}},
+{"type":"Feature","properties":{"scalerank":1,"featurecla":"Admin-0 country","labelrank":3,"sovereignt":"Ukraine","sov_a3":"UKR","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Ukraine","adm0_a3":"UKR","geou_dif":0,"geounit":"Ukraine","gu_a3":"UKR","su_dif":0,"subunit":"Ukraine","su_a3":"UKR","brk_diff":0,"name":"Ukraine","name_long":"Ukraine","brk_a3":"UKR","brk_name":"Ukraine","brk_group":null,"abbrev":"Ukr.","postal":"UA","formal_en":"Ukraine","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Ukraine","name_alt":null,"mapcolor7":5,"mapcolor8":1,"mapcolor9":6,"mapcolor13":3,"pop_est":45700395,"gdp_md_est":339800,"pop_year":-99,"lastcensus":2001,"gdp_year":-99,"economy":"6. Developing region","income_grp":"4. Lower middle income","wikipedia":-99,"fips_10":null,"iso_a2":"UA","iso_a3":"UKR","iso_n3":"804","un_a3":"804","wb_a2":"UA","wb_a3":"UKR","woe_id":-99,"adm0_a3_is":"UKR","adm0_a3_us":"UKR","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Europe","region_un":"Europe","subregion":"Eastern Europe","region_wb":"Europe & Central Asia","name_len":7,"long_len":7,"abbrev_len":4,"tiny":-99,"homepart":1},"geometry":
+{"type":"Polygon","coordinates":[[[31.785998162571587,52.101677964885454],[32.15941206231267,52.06126699483322],[32.41205813978763,52.28869497334975],[32.71576053236697,52.23846548116205],[33.75269982273571,52.335074571331695],[34.39173058445701,51.76888174092579],[34.14197838719039,51.56641347920623],[34.22481570815427,51.25599315042896],[35.02218305841788,51.20757233337146],[35.37792361831512,50.77395539001035],[35.35611616388795,50.57719737405906],[36.62616784032534,50.225590928745135],[37.39345950699507,50.38395335550359],[38.010631137856905,49.91566152607463],[38.59498823421342,49.92646190042363],[40.06905846533911,49.6010554062817],[40.08078901546935,49.307429917999286],[39.67466393408753,48.78381846780188],[39.89563235856758,48.23240509703143],[39.738277622238826,47.89893707945199],[38.7705847511412,47.825608222029814],[38.25511233902975,47.546400458356814],[38.22353803889942,47.102189846375886],[37.42513715998999,47.022220567404204],[36.75985477066439,46.698700263040934],[35.82368452326483,46.64596446388707],[34.96234174982388,46.27319651954964],[35.020787794745985,45.65121898048466],[35.51000857925317,45.40999339454619],[36.52999799983016,45.46998973243706],[36.33471276219916,45.113215643893966],[35.23999922052812,44.939996242851606],[33.882511020652885,44.36147858334407],[33.326420932760044,44.56487702084489],[33.54692426934946,45.03477081967489],[32.4541744321055,45.32746613217608],[32.630804477679135,45.51918569597891],[33.58816206231839,45.85156850848024],[33.29856733575471,46.080598456397844],[31.74414025241518,46.333347886737386],[31.675307244602408,46.70624502215554],[30.7487488136091,46.583100084004],[30.377608676888883,46.03241018328567],[29.603289015427436,45.293308010431126],[29.149724969201653,45.464925442072456],[28.67977949393938,45.304030870131704],[28.233553501099042,45.488283189468376],[28.485269402792767,45.5969070501459],[28.65998742037158,45.93998688413164],[28.933717482221624,46.2588304713725],[28.862972446414062,46.43788930926383],[29.07210696789929,46.517677720722496],[29.170653924279886,46.3792623968287],[29.759971958136394,46.34998769793536],[30.024658644335375,46.42393667254504],[29.838210076626297,46.52532583270169],[29.908851759569302,46.67436066343146],[29.559674106573112,46.928582872091326],[29.415135125452736,47.34664520933258],[29.05086795422733,47.5102269557525],[29.12269819511303,47.849095160506465],[28.670891147585166,48.1181485052341],[28.259546746541844,48.15556224221342],[27.522537469195157,48.467119452501116],[26.857823520624805,48.368210761094495],[26.619336785597795,48.22072622333347],[26.19745039236693,48.22088125263035],[25.9459411964024,47.987148749374214],[25.20774336111299,47.89105642352747],[24.866317172960578,47.737525743188314],[24.40205610525038,47.98187775328043],[23.76095828623741,47.985598456405455],[23.142236362406805,48.09634105080695],[22.710531447040495,47.88219391538941],[22.640819939878753,48.15023956968736],[22.085608351334855,48.42226430927179],[22.28084191253356,48.82539215758067],[22.558137648211755,49.085738023467144],[22.776418898212626,49.02739533140962],[22.518450148211603,49.47677358661974],[23.426508416444392,50.308505764357456],[23.922757195743262,50.42488108987875],[24.029985792748903,50.70540660257518],[23.527070753684374,51.57845408793024],[24.00507775238421,51.61744395609446],[24.553106316839518,51.888461005249184],[25.32778771332701,51.91065603291855],[26.337958611768556,51.83228872334793],[27.454066196408434,51.59230337178447],[28.24161502453657,51.57222707783907],[28.61761274589225,51.42771393493484],[28.992835320763533,51.602044379271476],[29.254938185347925,51.368234361366895],[30.157363722460897,51.41613841410147],[30.555117221811457,51.31950348571566],[30.619454380014844,51.822806098022376],[30.927549269338982,52.04235342061439],[31.785998162571587,52.101677964885454]]]}}]}
\ No newline at end of file
diff --git a/src/public/Leaflet-1.7.1/docs/examples/map-panes/example.md b/src/public/Leaflet-1.7.1/docs/examples/map-panes/example.md
new file mode 100644
index 0000000..24ba695
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/map-panes/example.md
@@ -0,0 +1,37 @@
+---
+layout: tutorial_frame
+title: Custom Icons Tutorial
+---
+
+
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/map-panes/index.md b/src/public/Leaflet-1.7.1/docs/examples/map-panes/index.md
new file mode 100644
index 0000000..1d2882e
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/map-panes/index.md
@@ -0,0 +1,105 @@
+---
+layout: tutorial_v2
+title: Working with map panes
+---
+
+## What are panes?
+
+In Leaflet, map panes group layers together implicitly, without the developer knowing about it. This grouping allows web browsers to work with several layers at once in a more efficient way than working with layers individually.
+
+Map panes use the [z-index CSS property](https://developer.mozilla.org/docs/Web/CSS/z-index) to always show some layers on top of others. The [default order](/reference.html#map-pane) is:
+
+* `TileLayer`s and `GridLayer`s
+* `Path`s, like lines, polylines, circles, or `GeoJSON` layers.
+* `Marker` shadows
+* `Marker` icons
+* `Popup`s
+
+This is why, in Leaflet maps, popups always show "on top" of other layers, markers always show on top of tile layers, etc.
+
+A new feature of **Leaflet 1.0.0** (not present in 0.7.x) is custom map panes, which allows for customization of this order.
+
+## The default is not always right
+
+In some particular cases, the default order is not the right one for the map. We can demonstrate this with the [Carto basemaps](https://carto.com/location-data-services/basemaps/) and labels:
+
+
+
+
+
+
+
+Basemap tile with no labels
+
+
+
+
+Transparent labels-only tile
+
+
+
+
+
+Labels on top of basemap
+
+
+
+If we create a Leaflet map with these two tile layers, any marker or polygon will show on top of both, but having the labels on top [looks much nicer](http://blog.cartodb.com/let-your-labels-shine/). How can we do that?
+
+{% include frame.html url="example.html" %}
+
+## Custom pane
+
+We can use the defaults for the basemap tiles and some overlays like GeoJSON layers, but we have to define a custom pane for the labels, so they show on top of the GeoJSON data.
+
+Custom map panes are created on a per-map basis, so first create an instance of `L.Map` and the pane:
+
+
+ var map = L.map('map');
+ map.createPane('labels');
+
+
+The next step is setting the z-index of the pane. Looking at the [defaults](https://github.com/Leaflet/Leaflet/blob/v1.0.0/dist/leaflet.css#L87), a value of 650 will make the `TileLayer` with the labels show on top of markers but below pop-ups. By using `getPane()`, we have a reference to the [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) representing the pane, and change its z-index:
+
+
+ map.getPane('labels').style.zIndex = 650;
+
+
+One of the problems of having image tiles on top of other map layers is that the tiles will capture clicks and touches. If a user clicks anywhere on the map, the web browser will assume she clicked on the labels tiles, and not on the GeoJSON or on the markers. This can be solved using [the `pointer-events` CSS property](https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events):
+
+
+ map.getPane('labels').style.pointerEvents = 'none';
+
+
+With the pane now ready, we can add the layers, paying attention to use the `pane` option on the labels tiles:
+
+
+ var positron = L.tileLayer('https://{s}.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}.png', {
+ attribution: '©OpenStreetMap, ©CartoDB'
+ }).addTo(map);
+
+ var positronLabels = L.tileLayer('https://{s}.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}.png', {
+ attribution: '©OpenStreetMap, ©CartoDB',
+ pane: 'labels'
+ }).addTo(map);
+
+ var geojson = L.geoJson(GeoJsonData, geoJsonOptions).addTo(map);
+
+Finally, add some interaction to each feature on the GeoJSON layer:
+
+ geojson.eachLayer(function (layer) {
+ layer.bindPopup(layer.feature.properties.name);
+ });
+
+ map.fitBounds(geojson.getBounds());
+
+
+Now the [example map](example.html) is complete!
+
+
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/map-panes/thumbnail.png b/src/public/Leaflet-1.7.1/docs/examples/map-panes/thumbnail.png
new file mode 100644
index 0000000..7f123a8
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/examples/map-panes/thumbnail.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/examples/mobile-example.md b/src/public/Leaflet-1.7.1/docs/examples/mobile-example.md
new file mode 100644
index 0000000..373babd
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/mobile-example.md
@@ -0,0 +1,5 @@
+---
+layout: redirected
+sitemap: false
+redirect_to: mobile/example.html
+---
diff --git a/src/public/Leaflet-1.7.1/docs/examples/mobile.md b/src/public/Leaflet-1.7.1/docs/examples/mobile.md
new file mode 100644
index 0000000..dba01e9
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/mobile.md
@@ -0,0 +1,5 @@
+---
+layout: redirected
+sitemap: false
+redirect_to: mobile/
+---
diff --git a/src/public/Leaflet-1.7.1/docs/examples/mobile/example.md b/src/public/Leaflet-1.7.1/docs/examples/mobile/example.md
new file mode 100644
index 0000000..a056e34
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/mobile/example.md
@@ -0,0 +1,43 @@
+---
+layout: tutorial_frame
+title: Mobile tutorial
+css: "body {
+ padding: 0;
+ margin: 0;
+ }
+ #map {
+ height: 100%;
+ width: 100vw;
+ }"
+---
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/mobile/index.md b/src/public/Leaflet-1.7.1/docs/examples/mobile/index.md
new file mode 100644
index 0000000..4a12dfc
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/mobile/index.md
@@ -0,0 +1,74 @@
+---
+layout: tutorial_v2
+title: Leaflet on Mobile
+---
+
+## Leaflet on Mobile
+
+In this example, you'll learn how to create a fullscreen map tuned for mobile devices like iPhone, iPad or Android phones, and how to easily detect and use the current user location.
+
+{% include frame.html url="example.html" %}
+
+### Preparing the page
+
+First we'll take a look at the HTML & CSS code of the page. To make our map `div` element stretch to all available space (fullscreen), we can use the following CSS code (note: In this example we use percentage for height. While vh is arguably better, due to a bug with Google Chrome on mobile.):
+
+{: .css}
+ body {
+ padding: 0;
+ margin: 0;
+ }
+ html, body, #map {
+ height: 100%;
+ width: 100vw;
+ }
+
+Also, we need to tell the mobile browser to disable unwanted scaling of the page and set it to its actual size by placing the following line in the `head` section or our HTML page:
+
+
+
+### Initializing the map
+
+We'll now initialize the map in the JavaScript code like we did in the [quick start guide](../quick-start/), showing the whole world:
+
+var map = L.map('map').fitWorld();
+
+L.tileLayer('https://api.mapbox.com/styles/v1/{id }/tiles/{z}/{x}/{y}?access_token={accessToken}', {
+ attribution: 'Map data © <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> ',
+ maxZoom: 18,
+ tileSize: 512,
+ zoomOffset: -1
+}).addTo(map);
+
+### Geolocation
+
+Leaflet has a very handy shortcut for zooming the map view to the detected location --- `locate` method with the `setView` option, replacing the usual `setView` method in the code:
+
+ map.locate({setView: true, maxZoom: 16});
+
+Here we specify 16 as the maximum zoom when setting the map view automatically. As soon as the user agrees to share its location and it's detected by the browser, the map will set the view to it. Now we have a working fullscreen mobile map! But what if we need to do something after the geolocation completed? Here's what the `locationfound` and `locationerror` events are for. Let's for example add a marker in the detected location, showing accuracy in a popup, by adding an event listener to `locationfound` event before the `locateAndSetView` call:
+
+ function onLocationFound(e) {
+ var radius = e.accuracy;
+
+ L.marker(e.latlng).addTo(map)
+ .bindPopup("You are within " + radius + " meters from this point").openPopup();
+
+ L.circle(e.latlng, radius).addTo(map);
+ }
+
+ map.on('locationfound', onLocationFound);
+
+Excellent! But it would also be nice to show an error message if the geolocation failed:
+
+ function onLocationError(e) {
+ alert(e.message);
+ }
+
+ map.on('locationerror', onLocationError);
+
+If you have `setView` option set to true and the geolocation failed, it will set the view to the whole world.
+
+Now the example is complete --- try it on your mobile phone: [View the full example →](example.html)
+
+Next steps would be to take a look at the detailed [documentation](/reference.html) and browse [other examples](../../examples.html).
diff --git a/src/public/Leaflet-1.7.1/docs/examples/mobile/thumbnail.png b/src/public/Leaflet-1.7.1/docs/examples/mobile/thumbnail.png
new file mode 100644
index 0000000..37d5492
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/examples/mobile/thumbnail.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/examples/quick-start-example.md b/src/public/Leaflet-1.7.1/docs/examples/quick-start-example.md
new file mode 100644
index 0000000..ca9cae2
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/quick-start-example.md
@@ -0,0 +1,5 @@
+---
+layout: redirected
+sitemap: false
+redirect_to: quick-start/example.html
+---
diff --git a/src/public/Leaflet-1.7.1/docs/examples/quick-start.md b/src/public/Leaflet-1.7.1/docs/examples/quick-start.md
new file mode 100644
index 0000000..24c997a
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/quick-start.md
@@ -0,0 +1,5 @@
+---
+layout: redirected
+sitemap: false
+redirect_to: quick-start/
+---
diff --git a/src/public/Leaflet-1.7.1/docs/examples/quick-start/example-basic.md b/src/public/Leaflet-1.7.1/docs/examples/quick-start/example-basic.md
new file mode 100644
index 0000000..d765414
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/quick-start/example-basic.md
@@ -0,0 +1,21 @@
+---
+layout: tutorial_frame
+title: Quick Start
+customMapContainer: "true"
+---
+
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/quick-start/example-overlays.md b/src/public/Leaflet-1.7.1/docs/examples/quick-start/example-overlays.md
new file mode 100644
index 0000000..0495fb1
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/quick-start/example-overlays.md
@@ -0,0 +1,37 @@
+---
+layout: tutorial_frame
+title: Quick Start
+customMapContainer: "true"
+---
+
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/quick-start/example-popups.md b/src/public/Leaflet-1.7.1/docs/examples/quick-start/example-popups.md
new file mode 100644
index 0000000..278f722
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/quick-start/example-popups.md
@@ -0,0 +1,39 @@
+---
+layout: tutorial_frame
+title: Quick Start
+customMapContainer: "true"
+---
+
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/quick-start/example.md b/src/public/Leaflet-1.7.1/docs/examples/quick-start/example.md
new file mode 100644
index 0000000..501348c
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/quick-start/example.md
@@ -0,0 +1,48 @@
+---
+layout: tutorial_frame
+title: Quick Start
+customMapContainer: "true"
+---
+
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/quick-start/index.md b/src/public/Leaflet-1.7.1/docs/examples/quick-start/index.md
new file mode 100644
index 0000000..06db77a
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/quick-start/index.md
@@ -0,0 +1,147 @@
+---
+layout: tutorial_v2
+title: Quick Start Guide
+---
+
+## Leaflet Quick Start Guide
+
+This step-by-step guide will quickly get you started on Leaflet basics, including setting up a Leaflet map, working with markers, polylines and popups, and dealing with events.
+
+{% include frame.html url="example.html" %}
+
+### Preparing your page
+
+Before writing any code for the map, you need to do the following preparation steps on your page:
+
+ * Include Leaflet CSS file in the head section of your document:
+
+
+
+ * Include Leaflet JavaScript file **after** Leaflet's CSS:
+
+
+
+
+ * Put a `div` element with a certain `id` where you want your map to be:
+
+
+
+ * Make sure the map container has a defined height, for example by setting it in CSS:
+
+ #mapid { height: 180px; }
+
+Now you're ready to initialize the map and do some stuff with it.
+
+
+### Setting up the map
+
+
+{% include frame.html url="example-basic.html" %}
+
+Let's create a map of the center of London with pretty Mapbox Streets tiles. First we'll initialize the map and set its view to our chosen geographical coordinates and a zoom level:
+
+ var mymap = L.map('mapid').setView([51.505, -0.09], 13);
+
+By default (as we didn't pass any options when creating the map instance), all mouse and touch interactions on the map are enabled, and it has zoom and attribution controls.
+
+Note that `setView` call also returns the map object --- most Leaflet methods act like this when they don't return an explicit value, which allows convenient jQuery-like method chaining.
+
+Next we'll add a tile layer to add to our map, in this case it's a Mapbox Streets tile layer. Creating a tile layer usually involves setting the [URL template](/reference.html#tilelayer-url-template) for the tile images, the attribution text and the maximum zoom level of the layer. In this example we'll use the `mapbox/streets-v11` tiles from [Mapbox's Static Tiles API](https://docs.mapbox.com/api/maps/#static-tiles) (in order to use tiles from Mapbox, you must also [request an access token](https://www.mapbox.com/studio/account/tokens/)). Because this API returns 512x512 tiles by default (instead of 256x256), we will also have to explicitly specify this and offset our zoom by a value of -1.
+
+L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
+ attribution: 'Map data © <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> ',
+ maxZoom: 18,
+ id: 'mapbox/streets-v11',
+ tileSize: 512,
+ zoomOffset: -1,
+ accessToken: 'your.mapbox.access.token'
+}).addTo(mymap);
+
+Make sure all the code is called after the `div` and `leaflet.js` inclusion. That's it! You have a working Leaflet map now.
+
+It's worth noting that Leaflet is provider-agnostic, meaning that it doesn't enforce a particular choice of providers for tiles. You can try replacing `mapbox/streets-v11` with `mapbox/satellite-v9`, and see what happens. Also, Leaflet doesn't even contain a single provider-specific line of code, so you're free to use other providers if you need to (we'd suggest Mapbox though, it looks beautiful).
+
+Whenever using anything based on OpenStreetMap, an *attribution* is obligatory as per the [copyright notice](https://www.openstreetmap.org/copyright). Most other tile providers (such as [Mapbox](https://docs.mapbox.com/help/how-mapbox-works/attribution/), [Stamen](http://maps.stamen.com/) or [Thunderforest](https://www.thunderforest.com/terms/)) require an attribution as well. Make sure to give credit where credit is due.
+
+
+### Markers, circles and polygons
+
+{% include frame.html url="example-overlays.html" %}
+
+
+Besides tile layers, you can easily add other things to your map, including markers, polylines, polygons, circles, and popups. Let's add a marker:
+
+ var marker = L.marker([51.5, -0.09]).addTo(mymap);
+
+Adding a circle is the same (except for specifying the radius in meters as a second argument), but lets you control how it looks by passing options as the last argument when creating the object:
+
+ var circle = L.circle([51.508, -0.11], {
+ color: 'red',
+ fillColor: '#f03',
+ fillOpacity: 0.5,
+ radius: 500
+ }).addTo(mymap);
+
+Adding a polygon is as easy:
+
+ var polygon = L.polygon([
+ [51.509, -0.08],
+ [51.503, -0.06],
+ [51.51, -0.047]
+ ]).addTo(mymap);
+
+
+### Working with popups
+
+{% include frame.html url="example-popups.html" %}
+
+Popups are usually used when you want to attach some information to a particular object on a map. Leaflet has a very handy shortcut for this:
+
+ marker.bindPopup("Hello world! I am a popup.").openPopup();
+ circle.bindPopup("I am a circle.");
+ polygon.bindPopup("I am a polygon.");
+
+Try clicking on our objects. The `bindPopup` method attaches a popup with the specified HTML content to your marker so the popup appears when you click on the object, and the `openPopup` method (for markers only) immediately opens the attached popup.
+
+You can also use popups as layers (when you need something more than attaching a popup to an object):
+
+ var popup = L.popup()
+ .setLatLng([51.5, -0.09])
+ .setContent("I am a standalone popup.")
+ .openOn(mymap);
+
+Here we use `openOn` instead of `addTo` because it handles automatic closing of a previously opened popup when opening a new one which is good for usability.
+
+
+### Dealing with events
+
+Every time something happens in Leaflet, e.g. user clicks on a marker or map zoom changes, the corresponding object sends an event which you can subscribe to with a function. It allows you to react to user interaction:
+
+ function onMapClick(e) {
+ alert("You clicked the map at " + e.latlng);
+ }
+
+ mymap.on('click', onMapClick);
+
+Each object has its own set of events --- see [documentation](/reference.html) for details. The first argument of the listener function is an event object --- it contains useful information about the event that happened. For example, map click event object (`e` in the example above) has `latlng` property which is a location at which the click occurred.
+
+Let's improve our example by using a popup instead of an alert:
+
+ var popup = L.popup();
+
+ function onMapClick(e) {
+ popup
+ .setLatLng(e.latlng)
+ .setContent("You clicked the map at " + e.latlng.toString())
+ .openOn(mymap);
+ }
+
+ mymap.on('click', onMapClick);
+
+Try clicking on the map and you will see the coordinates in a popup. View the full example →
+
+Now you've learned Leaflet basics and can start building map apps straight away! Don't forget to take a look at the detailed documentation or other examples .
diff --git a/src/public/Leaflet-1.7.1/docs/examples/quick-start/thumbnail.png b/src/public/Leaflet-1.7.1/docs/examples/quick-start/thumbnail.png
new file mode 100644
index 0000000..60ee04b
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/examples/quick-start/thumbnail.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/examples/video-overlay/example-bounds.md b/src/public/Leaflet-1.7.1/docs/examples/video-overlay/example-bounds.md
new file mode 100644
index 0000000..4e28ef7
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/video-overlay/example-bounds.md
@@ -0,0 +1,24 @@
+---
+layout: tutorial_frame
+title: Video Overlay Tutorial
+---
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/video-overlay/example-nocontrols.md b/src/public/Leaflet-1.7.1/docs/examples/video-overlay/example-nocontrols.md
new file mode 100644
index 0000000..4c72d04
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/video-overlay/example-nocontrols.md
@@ -0,0 +1,32 @@
+---
+layout: tutorial_frame
+title: Video Overlay Tutorial
+---
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/video-overlay/example.md b/src/public/Leaflet-1.7.1/docs/examples/video-overlay/example.md
new file mode 100644
index 0000000..a4ce19c
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/video-overlay/example.md
@@ -0,0 +1,59 @@
+---
+layout: tutorial_frame
+title: Video Overlay Tutorial
+---
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/video-overlay/index.md b/src/public/Leaflet-1.7.1/docs/examples/video-overlay/index.md
new file mode 100644
index 0000000..ffbdb0a
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/video-overlay/index.md
@@ -0,0 +1,124 @@
+---
+layout: tutorial_v2
+title: Leaflet on Mobile
+---
+
+## Video on webpages
+
+Video used to be a hard task when building a webpage, until the [`` HTML element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video) was made available.
+
+Nowadays, we can use the following HTML code:
+
+
+
+
+
+
+To display this video:
+
+
+
+
+
+
+If a video can be shown in a webpage in this way, then Leaflet can display it inside a map. It is important that the videos are prepared in such a way that they will fit the map: The video should have a "north-up" orientation, and its proportions should fit the map. If not, it will look out of place.
+
+### Bounds of an image overlay
+
+First of all, create a Leaflet map and add a background `L.TileLayer` in the usual way:
+
+ var map = L.map('map').setView([37.8, -96], 4);
+
+ L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=' + mapboxAccessToken, {
+ id: 'mapbox/satellite-v9',
+ attribution: ...,
+ tileSize: 512,
+ zoomOffset: -1
+ }).addTo(map);
+
+Then, we'll define the geographical bounds that the video will cover. This is an instance of [`L.LatLngBounds`](/reference.html#latlngbounds), which is a rectangular shape:
+
+ var bounds = L.latLngBounds([[ 32, -130], [ 13, -100]]);
+
+If you want to see the area covered by a `LatLngBounds`, use a [`L.Rectangle`](/reference.html#rectangle):
+
+ L.rectangle(bounds).addTo(map);
+
+ map.fitBounds(bounds);
+
+{% include frame.html url="example-bounds.html" %}
+
+
+### Adding the video overlay
+
+Adding a video overlay works very similar to adding a image overlay. For just one image, [`L.ImageOverlay`s](/reference.html#imageoverlay) is used like this:
+
+ var overlay = L.imageOverlay( imageUrl, bounds, options );
+
+For a video overlay, just:
+
+* Use `L.videoOverlay` instead of `L.imageOverlay`
+* Instead of the image URL, specify one video URL *or* an array of video URLs
+
+```
+ var videoUrls = [
+ 'https://www.mapbox.com/bites/00188/patricia_nasa.webm',
+ 'https://www.mapbox.com/bites/00188/patricia_nasa.mp4'
+ ];
+
+ var bounds = L.latLngBounds([[ 32, -130], [ 13, -100]]);
+
+ var videoOverlay = L.videoOverlay( videoUrls, bounds, {
+ opacity: 0.8
+ }).addTo(map);
+```
+
+And just like that, you'll get the video on your map:
+
+{% include frame.html url="example-nocontrols.html" %}
+
+
+Video overlays behave like any other Leaflet layer - you can add and remove them, let the user select from several videos using a [layers control](../layers-control/), etc.
+
+
+### A bit of control over the video
+
+If you read the API documentation, you'll notice that the `L.VideoOverlay` class does not have a `play()` or `pause()` method.
+
+For this, the `getElement()` method of the video overlay is useful. It returns the [`HTMLVideoElement`](https://developer.mozilla.org/docs/Web/API/HTMLImageElement) (which inherits from [`HTMLMediaElement`](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement)) for the overlay - and that has methods like `play()` and `pause()`, e.g.
+
+```
+ videoOverlay.getElement().pause();
+```
+
+This allows us to build custom interfaces. For example, we can build a small subclass of `L.Control` to play/pause this video overlay once it's loaded:
+
+```
+ videoOverlay.on('load', function () {
+ var MyPauseControl = L.Control.extend({
+ onAdd: function() {
+ var button = L.DomUtil.create('button');
+ button.innerHTML = '⏸';
+ L.DomEvent.on(button, 'click', function () {
+ videoOverlay.getElement().pause();
+ });
+ return button;
+ }
+ });
+ var MyPlayControl = L.Control.extend({
+ onAdd: function() {
+ var button = L.DomUtil.create('button');
+ button.innerHTML = '▶️';
+ L.DomEvent.on(button, 'click', function () {
+ videoOverlay.getElement().play();
+ });
+ return button;
+ }
+ });
+
+ var pauseControl = (new MyPauseControl()).addTo(map);
+ var playControl = (new MyPlayControl()).addTo(map);
+ });
+```
+
+{% include frame.html url="example.html" %}
diff --git a/src/public/Leaflet-1.7.1/docs/examples/video-overlay/thumbnail.gif b/src/public/Leaflet-1.7.1/docs/examples/video-overlay/thumbnail.gif
new file mode 100644
index 0000000..ee0a30b
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/examples/video-overlay/thumbnail.gif differ
diff --git a/src/public/Leaflet-1.7.1/docs/examples/wms/qgis-wms-layers.png b/src/public/Leaflet-1.7.1/docs/examples/wms/qgis-wms-layers.png
new file mode 100644
index 0000000..4b356aa
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/examples/wms/qgis-wms-layers.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/examples/wms/thumbnail.png b/src/public/Leaflet-1.7.1/docs/examples/wms/thumbnail.png
new file mode 100644
index 0000000..7827b4a
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/examples/wms/thumbnail.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/examples/wms/wms-example-crs.md b/src/public/Leaflet-1.7.1/docs/examples/wms/wms-example-crs.md
new file mode 100644
index 0000000..0bd1e51
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/wms/wms-example-crs.md
@@ -0,0 +1,18 @@
+---
+layout: tutorial_frame
+title: WMS example
+---
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/wms/wms-example1.md b/src/public/Leaflet-1.7.1/docs/examples/wms/wms-example1.md
new file mode 100644
index 0000000..afd5543
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/wms/wms-example1.md
@@ -0,0 +1,16 @@
+---
+layout: tutorial_frame
+title: WMS example
+---
+
\ No newline at end of file
diff --git a/src/public/Leaflet-1.7.1/docs/examples/wms/wms-example2.md b/src/public/Leaflet-1.7.1/docs/examples/wms/wms-example2.md
new file mode 100644
index 0000000..241d89c
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/wms/wms-example2.md
@@ -0,0 +1,16 @@
+---
+layout: tutorial_frame
+title: WMS example
+---
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/wms/wms-example3.md b/src/public/Leaflet-1.7.1/docs/examples/wms/wms-example3.md
new file mode 100644
index 0000000..e4d4d7d
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/wms/wms-example3.md
@@ -0,0 +1,34 @@
+---
+layout: tutorial_frame
+title: WMS example
+---
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/wms/wms.md b/src/public/Leaflet-1.7.1/docs/examples/wms/wms.md
new file mode 100644
index 0000000..a0d99e3
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/wms/wms.md
@@ -0,0 +1,152 @@
+---
+layout: tutorial_v2
+title: Using WMS and TMS services
+---
+
+
+
+
+
+WMS, short for [*web map service*](https://en.wikipedia.org/wiki/Web_Map_Service), is a popular way of publishing maps by professional GIS software (and seldomly used by non-GISers). This format is similar to map tiles, but more generic and not so well optimized for use in web maps. A WMS image is defined by the coordinates of its corners - a calculation that Leaflet does under the hood.
+
+TMS stands for [*tiled map service*](https://en.wikipedia.org/wiki/Tile_Map_Service), and is a map tiling standard more focused on web maps, very similar to the map tiles that Leaflet expects in a `L.TileLayer`.
+
+WMTS, for [*web map tile service*](https://en.wikipedia.org/wiki/Web_Map_Tile_Service), is the standard protocol for map tiles and serves map tiles directly usable in a `L.TileLayer`.
+
+
+## WMS in Leaflet
+
+When somebody publishes a WMS service, most likely they link to something called a `GetCapabilities` document. For this tutorial, we'll use the WMS offered by [*Mundialis*](https://www.mundialis.de) at http://ows.mundialis.de/services/service? . The service capabilities are described at the following URL:
+
+ http://ows.mundialis.de/services/service?request=GetCapabilities
+
+Leaflet does not understand WMS `GetCapabilities` documents. Instead, you have to create a `L.TileLayer.WMS` layer, provide the base WMS URL, and specify whatever WMS options you need.
+
+The base WMS URL is simply the `GetCapabilities` URL, without any parameters, like so:
+
+ http://ows.mundialis.de/services/service?
+
+And the way to use that in a Leaflet map is simply:
+
+ var map = L.map(mapDiv, mapOptions);
+
+ var wmsLayer = L.tileLayer.wms('http://ows.mundialis.de/services/service?', wmsOptions).addTo(map);
+
+An instance of `L.TileLayer.WMS` needs at least one option: `layers`. Be careful, as the concept of "layer" in Leaflet is different from the concept of "layer" in WMS!
+
+WMS servers define a set of *layers* in the service. These are defined in the `GetCapabilities` XML document, which most times is tedious and difficult to understand. Usually it's a good idea to use software such as [QGIS to see what layers are available in a WMS server](http://www.qgistutorials.com/en/docs/working_with_wms.html) to see the layer names available:
+
+
+
+We can see that the *Mundialis* WMS has a WMS layer named `TOPO-OSM-WMS` with a basemap. Let's see how it looks:
+
+ var wmsLayer = L.tileLayer.wms('http://ows.mundialis.de/services/service?', {
+ layers: 'TOPO-OSM-WMS'
+ }).addTo(map);
+
+{% include frame.html url="wms-example1.html" %}
+
+
+Or we can try the `SRTM30-Colored-Hillshade` WMS layer:
+
+ var wmsLayer = L.tileLayer.wms('http://ows.mundialis.de/services/service?', {
+ layers: 'SRTM30-Colored-Hillshade'
+ }).addTo(map);
+
+{% include frame.html url="wms-example2.html" %}
+
+
+The `layers` option is a comma-separated list of layers. If a WMS service has defined several layers, then a request for a map image can refer to more than one layer.
+
+For the example WMS server we're using, there is a `TOPO-WMS` WMS layer showing the world topography, and a `OSM-Overlay-WMS` WMS layer showing the names of places. The WMS server will compose both layers in one image if we request both, separated with a comma:
+
+ var topographyAndPlaces = L.tileLayer.wms('http://ows.mundialis.de/services/service?', {
+ layers: 'TOPO-WMS,OSM-Overlay-WMS'
+ }).addTo(map);
+
+Note this will request *one* image to the WMS server. This is different than creating a `L.TileLayer.WMS` for the topography, another one for the places, and adding them both to the map. In the first case, there is one image request and it's the WMS server who decides how to compose (put on top of each other) the image. In the second case, there would be two image requests and it's the Leaflet code running in the web browser who decides how to compose them.
+
+If we combine this with the [layers control](/examples/layers-control.html), then we can build a simple map to see the difference:
+
+ var basemaps = {
+ Topography: L.tileLayer.wms('http://ows.mundialis.de/services/service?', {
+ layers: 'TOPO-WMS'
+ }),
+
+ Places: L.tileLayer.wms('http://ows.mundialis.de/services/service?', {
+ layers: 'OSM-Overlay-WMS'
+ }),
+
+ 'Topography, then places': L.tileLayer.wms('http://ows.mundialis.de/services/service?', {
+ layers: 'TOPO-WMS,OSM-Overlay-WMS'
+ }),
+
+ 'Places, then topography': L.tileLayer.wms('http://ows.mundialis.de/services/service?', {
+ layers: 'OSM-Overlay-WMS,TOPO-WMS'
+ })
+ };
+
+ L.control.layers(basemaps).addTo(map);
+
+ basemaps.Topography.addTo(map);
+
+Change to the "Topography, then places" option, so you can see the places "on top" of the topography, but the WMS server is clever enough to display building labels on top of that. It's up to the WMS server how to compose layers when asked for many.
+
+{% include frame.html url="wms-example3.html" %}
+
+
+### Notes to GIS users of WMS services
+
+From a GIS point of view, WMS handling in Leaflet is quite basic. There's no `GetCapabilities` support, no legend support, and no `GetFeatureInfo` support.
+
+`L.TileLayer.WMS` has extra options, which can be found in [Leaflet's API documentation](/reference.html#tilelayer-wms). Any option not described there will be passed to the WMS server in the `getImage` URLs.
+
+Also note that Leaflet supports very few [coordinate systems](https://en.wikipedia.org/wiki/Spatial_reference_system): `CRS:3857`, `CRS:3395` and `CRS:4326` (See the documentation for `L.CRS`). If your WMS service doesn't serve images in those coordinate systems, you might need to use [Proj4Leaflet](https://github.com/kartena/Proj4Leaflet) to use a different coordinate system in Leaflet. Other than that, just use the right CRS when initializing your map, and any WMS layers added will use it:
+
+ var map = L.map('map', {
+ crs: L.CRS.EPSG4326
+ });
+
+ var wmsLayer = L.tileLayer.wms('http://ows.mundialis.de/services/service?', {
+ layers: 'TOPO-OSM-WMS'
+ }).addTo(map);
+
+{% include frame.html url="wms-example-crs.html" %}
+
+
+## TMS in Leaflet
+
+Leaflet doesn't have explicit support for TMS services, but the tile naming structure is so similar to the common `L.TileLayer` naming scheme, that displaying a TMS service is almost trivial.
+
+Let's consider a TMS server with the following endpoint:
+
+ http://base_url/tms/1.0.0
+
+Checking the [MapCache help about TMS](http://mapserver.org/mapcache/services.html) and the [TMS specification](https://wiki.osgeo.org/wiki/Tile_Map_Service_Specification) you can see that the URL for a map tile in TMS looks like:
+
+ http://base_url/tms/1.0.0/ {tileset} / {z} / {x} / {y} .png
+
+To use the TMS services as a `L.TileLayer`, we can check the capabilities document (the same as the base endpoint, in our case [`http://base_url/tms/1.0.0`](http://base_url/tms/1.0.0)) to see what `tileset`s are available, and build our base URLs:
+
+ http://base_url/tms/1.0.0/{example_layer}@png/{z}/{x}/{y}.png
+
+
+And use the `tms:true` option when instantiating the layers, like so:
+
+ var tms_example = L.tileLayer('http://base_url/tms/1.0.0/example_layer@png/{z}/{x}/{y}.png', {
+ tms: true
+ }).addTo(map);
+
+
+A new feature in **Leaflet 1.0** is the ability to use `{-y}` in the URL instead of a `tms: true` option, e.g.:
+
+ var layer = L.tileLayer('http://base_url/tms/1.0.0/tileset/{z}/{x}/{-y}.png');
+
+The `tms: true` option (in Leaflet 0.7) or `{-y}` (in Leaflet 1.0) are needed because the origin of coordinates of vanilla `L.TileLayer`s is the top left corner, so the Y coordinate goes *down*. In TMS, the origin of coordinates is the *bottom* left corner so the Y coordinate goes *up*.
+
+Besides the difference in the `y` coordinate and the discovery of tilesets, TMS services serve tiles exactly in the way that `L.TileLayer` expects.
diff --git a/src/public/Leaflet-1.7.1/docs/examples/zoom-levels/example-delta.md b/src/public/Leaflet-1.7.1/docs/examples/zoom-levels/example-delta.md
new file mode 100644
index 0000000..5c21b28
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/zoom-levels/example-delta.md
@@ -0,0 +1,40 @@
+---
+layout: tutorial_frame
+title: Zoom Levels Tutorial
+---
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/zoom-levels/example-fractional.md b/src/public/Leaflet-1.7.1/docs/examples/zoom-levels/example-fractional.md
new file mode 100644
index 0000000..71d958c
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/zoom-levels/example-fractional.md
@@ -0,0 +1,55 @@
+---
+layout: tutorial_frame
+title: Zoom Levels Tutorial
+---
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/zoom-levels/example-scale.md b/src/public/Leaflet-1.7.1/docs/examples/zoom-levels/example-scale.md
new file mode 100644
index 0000000..d79f4e2
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/zoom-levels/example-scale.md
@@ -0,0 +1,29 @@
+---
+layout: tutorial_frame
+title: Zoom Levels Tutorial
+---
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/zoom-levels/example-setzoom.md b/src/public/Leaflet-1.7.1/docs/examples/zoom-levels/example-setzoom.md
new file mode 100644
index 0000000..44c7de7
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/zoom-levels/example-setzoom.md
@@ -0,0 +1,44 @@
+---
+layout: tutorial_frame
+title: Zoom Levels Tutorial
+---
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/zoom-levels/example-zero.md b/src/public/Leaflet-1.7.1/docs/examples/zoom-levels/example-zero.md
new file mode 100644
index 0000000..26ac26a
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/zoom-levels/example-zero.md
@@ -0,0 +1,19 @@
+---
+layout: tutorial_frame
+title: Zoom Levels Tutorial
+---
+
diff --git a/src/public/Leaflet-1.7.1/docs/examples/zoom-levels/index.md b/src/public/Leaflet-1.7.1/docs/examples/zoom-levels/index.md
new file mode 100644
index 0000000..457440e
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/examples/zoom-levels/index.md
@@ -0,0 +1,260 @@
+---
+layout: tutorial_v2
+title: Zoom levels
+---
+
+
+
+## Zoom levels
+
+Leaflet works with [latitude](https://en.wikipedia.org/wiki/Latitude), [longitude](https://en.wikipedia.org/wiki/Longitude) and "zoom level".
+
+Lower zoom levels means that the map shows entire continents, while higher zoom
+levels means that the map can show details of a city.
+
+To understand how zoom levels work, first we need a basic introduction to geodesy .
+
+## The shape of the earth
+
+Let's have a look at a simple map locked at zoom zero:
+
+ var map = L.map('map', {
+ minZoom: 0,
+ maxZoom: 0
+ });
+
+ var cartodbAttribution = '© OpenStreetMap contributors, © CARTO ';
+
+ var positron = L.tileLayer('https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
+ attribution: cartodbAttribution
+ }).addTo(map);
+
+ map.setView([0, 0], 0);
+
+{% include frame.html url="example-zero.html" %}
+
+Notice that the "whole earth" is just one image, 256 pixels wide and 256 pixels high:
+
+
+
+
+
+Just to be clear: the earth is not a square. Rather, the earth has an irregular shape that can be approximated to [something similar to a sphere](https://en.wikipedia.org/wiki/Geoid).
+
+So we *assume* that the earth is mostly round. To make it flat, we put an imaginary cylinder around, unroll it, and cut it so it looks square:
+
+
+
+This is not the only way of displaying the surface on the earth on a plane. There
+are [hundreds of ways](https://en.wikipedia.org/wiki/Map_projection), each of them
+with its own advantages and disadvantages. The following 6-minute video is a nice
+introduction to the topic:
+
+VIDEO
+
+Things like geodesy, map projections and coordinate systems are hard, *very hard*
+(and out of scope for this tutorial). Assuming that the earth is a square is not
+always the right thing to do, but most of the time works fine enough, makes things
+simpler, and allows Leaflet (and other map libraries) to be fast.
+
+## Powers of two
+
+For now, let's just ***assume*** that the world is a square:
+
+
+
+
+
+When we represent the world at zoom level **zero**, it's 256 pixels wide and high. When we go into zoom level **one**, it doubles its width and height, and can be represented by four 256-pixel-by-256-pixel images:
+
+
+
+At each zoom level, each tile is divided in four, and its size (length of the edge, given by the `tileSize` option) doubles, quadrupling the area. (in other words, the width and height of the world is 256·2zoomlevel pixels):
+
+
+
+
+
+
+
+
+
+
+Zoom 0 Zoom 1 Zoom 2
+
+This goes on and on. Most tile services offer tiles up to zoom level 18, depending on
+their coverage. This is enough to see a few city blocks per tile.
+
+## A note about scale
+
+One of the disadvantages of using a cylindrical projection is that the scale is not
+constant, and measuring distances or sizes is not reliable, specially at low zoom levels.
+
+In [technical terms](https://en.wikipedia.org/wiki/Map_projection#Projections_by_preservation_of_a_metric_property),
+the cylindrical projection that Leaflet uses is conformal (preserves shapes),
+but not equidistant (does not preserve distances), and not equal-area
+(does not preserve areas, as things near the equator appear smaller than they are).
+
+By adding a `L.Control.Scale` to a map, and panning to the equator and to 60° north,
+we can see how the scale factor doubles . The following example uses
+[javascript timeouts](https://developer.mozilla.org/docs/Web/API/WindowTimers/setTimeout)
+to do this automatically:
+
+ L.control.scale().addTo(map);
+
+ setInterval(function(){
+ map.setView([0, 0]);
+ setTimeout(function(){
+ map.setView([60, 0]);
+ }, 2000);
+ }, 4000);
+
+{% include frame.html url="example-scale.html" %}
+
+`L.Control.Scale` shows the scale which applies to the center point of the map.
+At high zoom levels, the scale changes very little, and is not noticeable.
+
+
+## Controlling the zoom
+
+A leaflet map has several ways to control the zoom level shown, but the most obvious
+one is [`setZoom()`](/reference.html#map-setzoom). For example, `map.setZoom(0);`
+will set the zoom level of `map` to `0`.
+
+This example again uses timeouts to alternate between zoom levels `0` and `1` automatically:
+
+ setInterval(function(){
+ map.setZoom(0);
+ setTimeout(function(){
+ map.setZoom(1);
+ }, 2000);
+ }, 4000);
+
+{% include frame.html url="example-setzoom.html" %}
+
+Notice how the images shown at zoom levels 0 and one correspond with the images
+shown in the previous section!
+
+Other ways of setting the zoom are:
+
+* [`setView(center, zoom)`](/reference.html#map-setview), which also sets the map center
+* [`flyTo(center, zoom)`](/reference.html#map-flyto), like `setView` but with a smooth animation
+* [`zoomIn()` / `zoomIn(delta)`](/reference.html#map-zoomin), zooms in `delta` zoom levels, `1` by default
+* [`zoomOut()` / `zoomOut(delta)`](/reference.html#map-zoomout), zooms out `delta` zoom levels, `1` by default
+* [`setZoomAround(fixedPoint, zoom)`](/reference.html#map-setzoomaround), sets the zoom level while keeping a point fixed (what scrollwheel zooming does)
+* [`fitBounds(bounds)`](/reference.html#map-fitbounds), automatically calculates the zoom to fit a rectangular area on the map
+
+
+## Fractional zoom
+
+A feature introduced in Leaflet 1.0.0 was the concept of fractional zoom .
+Before this, the zoom level of the map could be only an integer number (`0`, `1`, `2`, and so on);
+but now you can use fractional numbers like `1.5` or `1.25`.
+
+Fractional zoom is disabled by default. To enable it, use the
+[map's `zoomSnap` option](/reference.html#map-zoomsnap).
+The `zoomSnap` option has a default value of `1` (which means that the zoom level
+of the map can be `0`, `1`, `2`, and so on).
+
+If you set the value of `zoomSnap` to `0.5`, the valid zoom levels of the map
+will be `0`, `0.5`, `1`, `1.5`, `2`, and so on.
+
+If you set a value of `0.1`, the valid zoom levels of the map will be `0`, `0.1`,
+`0.2`, `0.3`, `0.4`, and so on.
+
+The following example uses a `zoomSnap` value of `0.25`:
+
+ var map = L.map('map', {
+ zoomSnap: 0.25
+ });
+
+{% include frame.html url="example-fractional.html" %}
+
+As you can see, Leaflet will only load the tiles for zoom levels `0` or `1`, and will scale them
+as needed.
+
+Leaflet will snap the zoom level to the closest valid one. For example,
+if you have `zoomSnap: 0.25` and you try to do `map.setZoom(0.8)`, the zoom will
+snap back to `0.75`. The same happens with `map.fitBounds(bounds)`, or when ending
+a pinch-zoom gesture on a touchscreen.
+
+`zoomSnap` can be set to zero. This means that Leaflet will not
+snap the zoom level.
+
+There is another important map option related to `zoomSnap`: [the `zoomDelta` option](/reference.html#map-zoomdelta).
+This controls how many zoom levels to zoom in/out when using the zoom buttons
+(from the default [`L.Control.Zoom`](/reference.html#control-zoom))
+or the `+`/`-` keys in your keyboard.
+
+For the mousewheel zoom, the [`wheelPxPerZoomLevel`](/reference.html#map-wheelpxperzoomlevel)
+option controls how fast the mousewheel zooms in or out.
+
+Here is an example with `zoomSnap` set to zero:
+
+ var map = L.map('map', {
+ zoomDelta: 0.25,
+ zoomSnap: 0
+ });
+
+Try the following, and see how the zoom level changes:
+
+* Pinch-zoom if you have a touchscreen
+* Zoom in/out with your mousewheel
+* Do a box zoom (drag with your mouse while pressing the `shift` key in your keyboard)
+* Use the zoom in/out buttons
+
+{% include frame.html url="example-delta.html" %}
+
+
+That concludes this tutorial. Now play with your zoom levels in your maps!
diff --git a/src/public/Leaflet-1.7.1/docs/examples/zoom-levels/thumbnail.png b/src/public/Leaflet-1.7.1/docs/examples/zoom-levels/thumbnail.png
new file mode 100644
index 0000000..63f0651
Binary files /dev/null and b/src/public/Leaflet-1.7.1/docs/examples/zoom-levels/thumbnail.png differ
diff --git a/src/public/Leaflet-1.7.1/docs/index.html b/src/public/Leaflet-1.7.1/docs/index.html
new file mode 100644
index 0000000..cfb0091
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/index.html
@@ -0,0 +1,223 @@
+---
+layout: v2
+---
+
+
+
+Leaflet is the leading open-source JavaScript library for mobile-friendly interactive maps.
+Weighing just about 38 KB of JS ,
+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,
+can be extended with lots of plugins ,
+has a beautiful, easy to use and well-documented API
+and a simple, readable source code that is a joy to
+contribute to.
+
+
+
+Here we create a map in the 'map' div, add tiles of our choice , and then add a marker with some text in a popup:
+
+var map = L.map('map').setView([51.505, -0.09], 13);
+
+L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
+ attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
+}).addTo(map);
+
+L.marker([51.5, -0.09]).addTo(map)
+ .bindPopup('A pretty CSS3 popup.<br> Easily customizable.')
+ .openPopup();
+
+Learn more with the quick start guide , check out other tutorials ,
+or head straight to the API documentation .
+If you have any questions, take a look at the FAQ first.
+
+
+
+
+Trusted by the best
+
+
+
+
+
Features
+
+
Leaflet doesn't try to do everything for everyone. Instead it focuses on making the basic things work perfectly .
+
+
+
+
Layers Out of the Box
+
+
+ Tile layers, WMS
+ Markers, Popups
+ Vector layers: polylines, polygons, circles, rectangles
+ Image overlays
+ GeoJSON
+
+
+
+
+
+
Interaction Features
+
+
+ Drag panning with inertia
+ Scroll wheel zoom
+ Pinch-zoom on mobile
+ Double click zoom
+ Zoom to area (shift-drag)
+ Keyboard navigation
+ Events: click, mouseover, etc.
+ Marker dragging
+
+
+
+
+
Visual Features
+
+
+ Zoom and pan animation
+ Tile and popup fade animation
+ Very nice default design for markers, popups and map controls
+ Retina resolution support
+
+
+
+
+
+
Customization Features
+
+
+ Pure CSS3 popups and controls for easy restyling
+ Image- and HTML-based markers
+ A simple interface for custom map layers and controls
+ Custom map projections (with EPSG:3857/4326/3395 out of the box)
+ Powerful OOP facilities for extending existing classes
+
+
+
+
+
Performance Features
+
+
+ Hardware acceleration on mobile makes it feel as smooth as native apps
+ Utilizing CSS3 features to make panning and zooming really smooth
+ Smart polyline/polygon rendering with dynamic clipping and simplification makes it very fast
+ Modular build system for leaving out features you don't need
+ Tap delay elimination on mobile
+
+
+
+
+
Map Controls
+
+
+ Zoom buttons
+ Attribution
+ Layer switcher
+ Scale
+
+
+
+
+
+
Browser Support
+
+
Desktop
+
+
+ Chrome
+ Firefox
+ Safari 5+
+ Opera 12+
+ IE 7–11
+ Edge
+
+
+
+
+
Mobile
+
+
+ Safari for iOS 7+
+ Android browser 2.2+, 3.1+, 4+
+ Chrome for mobile
+ Firefox for mobile
+ IE10+ for Win8 devices
+
+
+
+
+
Misc
+
+
+ Extremely lightweight
+ No external dependencies
+
+
+
+
+
If you find some feature really missing in Leaflet, first check if there's a plugin for it
+and if it's been discussed before already on GitHub issues .
+If not, please open a new GitHub issue.
+
+
Getting Involved
+
+
Let's create the best mapping library in the world!
+Leaflet was originally created by Vladimir Agafonkin ,
+but is now developed by a big community of contributors .
+Pull requests are always welcome.
+However, there are many more ways to get involved with the development of Leaflet.
+
+
You can help the project tremendously by discovering and reporting bugs , improving documentation ,
+helping others on Stack Overflow , GIS Stack Exchange
+and GitHub issues ,
+tweeting to @LeafletJS
+and spreading the word about Leaflet among your colleagues and friends.
+
+
Check out the contribution guide for more information on getting involved with Leaflet development.
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/public/Leaflet-1.7.1/docs/plugins.md b/src/public/Leaflet-1.7.1/docs/plugins.md
new file mode 100644
index 0000000..5d3caf9
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/plugins.md
@@ -0,0 +1,4828 @@
+---
+layout: v2
+title: Plugins
+bodyclass: plugins-page
+---
+
+## Leaflet Plugins
+
+While Leaflet is meant to be as lightweight as possible, and focuses on a core set of features, an easy way to extend its functionality is to use third-party plugins. Thanks to the awesome community behind Leaflet, there are literally hundreds of nice plugins to choose from.
+
+---
+
+
+
+
Tile & image layers
+
+
Overlay data
+
+
+
+
Overlay Display
+
+
Overlay interaction
+
+
+
+
+
+
+
+## Tile & image layers
+
+The following plugins allow loading different maps and provide functionality to tile and image layers.
+
+* [Basemap providers](#basemap-providers)
+* [Basemap formats](#basemap-formats)
+* [Non-map base layers](#non-map-base-layers)
+* [Tile/image display](#tileimage-display)
+* [Tile load](#tile-load)
+* [Vector tiles](#vector-tiles)
+
+
+### Basemap providers
+
+Ready-to-go basemaps, with little or no configuration at all.
+
+
Plugin Description Maintainer
+
+
+ leaflet-providers
+
+ Contains configurations for various free tile providers — OSM, OpenCycleMap, Stamen, Esri, etc.
+
+ leaflet-extras members
+
+
+
+
+ Leaflet.KoreanTmsProviders
+
+ Contains configurations for various (South) Korean tile providers — Daum, Naver, VWorld, etc.
+
+ Seong Choi
+
+
+
+
+ Leaflet.ChineseTmsProviders
+
+ Contains configurations for various Chinese tile providers — TianDiTu, MapABC, GaoDe, etc.
+
+ Tao Huang
+
+
+
+
+ Esri Leaflet
+
+ A set of tools for using ArcGIS services with Leaflet. Support for map services, feature layers, ArcGIS Online tiles and more.
+
+ Patrick Arlt
+
+
+
+
+ Leaflet.GIBS
+
+ NASA EOSDIS GIBS imagery integration. The plugin provides 96 daily updated layers with satellite imagery and science parameters. Demo .
+
+ Alexander Parshin
+
+
+
+
+ L.TileLayer.Kartverket
+
+ Provides easy setup of the tile layers from Kartverket (The Norwegian Mapping Authority)
+
+ Kultur og naturreise / Atle Frenvik Sveen
+
+
+
+
+ Leaflet.Spain.WMS
+
+ Provides easy setup for several Web Map Services (WMS) layers for Spain (PNOA, IGN base, Catastro, etc), from Spanish mapping agencies.
+
+ Patricio Soriano
+
+
+
+
+ PolarMap.js
+
+ JavaScript library for displaying tiles from ArcticWebMap , a free tile provider with OSM data in multiple Arctic polar projections. Includes lower-level API for deeper integration with other Leaflet plugins.
+
+ GeoSensorWeb Lab
+
+
+
+
+ Bing Maps Layer
+
+ Add Bing Maps tiles to your Leaflet Map. Requires Leaflet v1.0.0.beta.2 or later.
+
+ Gregor MacLennan
+
+
+
+
+ L.TileLayer.HERE
+
+ Displays map tiles from HERE maps (demo ).
+
+ Iván Sánchez
+
+
+
+
+ L.GridLayer.GoogleMutant
+
+ Displays Google maps (with minimal artifacts thanks to a DOM mutation observer technique) (demo ).
+
+ Iván Sánchez
+
+
+
+
+ L.MapkitMutant
+
+ Displays Apple's MapkitJS basemaps.
+
+ Iván Sánchez
+
+
+
+ SuperMap Leaflet
+
+ SuperMap Leaflet is a Leaflet plugins for working with SuperMap service types.
+ Support for SuperMap services, tiles and more.
+
+ SuperMap
+
+
+
+
+ Leaflet.TileLayer.Mierune
+
+ Displays tiles from Mierune map . (Demo )
+
+ Mierune
+
+
+
+
+ Leaflet.TileLayer.Swiss
+
+ Displays national maps of Switzerland using map tiles from Swisstopo.
+ Demo .
+
+ Roman Karavia
+
+
+
+
+
+
+### Basemap formats
+
+Plugins for loading basemaps or GIS raster layers in common (albeit non-default) formats.
+
+
Plugin Description Maintainer
+
+
+ leaflet.TileLayer.WMTS
+ Add WMTS (IGN) layering for leaflet.
+
+ Alexandre Melard
+
+
+
+
+ azgs-leaflet
+
+ A set of small plugins for Leaflet, including WFS-GeoJSON layer with filtering, a hover control for GeoJSON, and an Esri tile layer.
+
+ AZGS
+
+
+
+
+ leaflet.wms
+
+ Enhanced WMS support for Leaflet, including single-tile/untiled layers, shared WMS sources, and layer identify via GetFeatureInfo.
+
+ S. Andrew Sheppard (HEI Geo )
+
+
+
+
+ Leaflet.NonTiledLayer.WCS
+
+ Display raster data from Web Coverage Services. Rasters can be styled and queried in the client. See the demo .
+
+ Stuart Matthews
+
+
+
+
+ Leaflet.bpg
+
+ TileLayer with .bpg image format decoding.
+
+ Andrzej Zaborowski
+
+
+
+
+ TileLayer.GeoJSON
+
+ A TileLayer for GeoJSON tiles.
+
+ Glen Robertson
+
+
+
+
+ leaflet-tilejson
+
+ Adds support for the TileJSON specification to Leaflet.
+
+ Per Liedman , Kartena
+
+
+
+
+ cartodb-leaflet
+
+ Official CartoDB plugin for Leaflet.
+
+ Vizzuality
+
+
+
+
+ Leaflet-2gis
+
+ Adds support for 2GIS tile layer
+
+ Eugene Mikhalev
+
+
+
+
+ Leaflet GeoJSON Encoded
+
+ Extends the L.GeoJSON layer using Google polyline encoding algorithm, allowing an optimized data transfer.
+
+ Geobricks
+
+
+
+
+ Leaflet.TileLayer.MBTiles
+
+ Loads .mbtiles tilesets.
+
+ Iván Sánchez
+
+
+
+
+ Leaflet.CanvasLayer.Field
+
+ Loads and styles raster files (geotiff & asciigrid formats).
+ It includes a ScalarField layer (for DTM, temperature...) and
+ VectorFieldAnim (an animated layer for wind, currents...). See the examples
+
+ Víctor Velarde
+
+
+
+
+ leaflet-geotiff
+
+ Display raster data from geoTIFF files as images or direction arrows. Rasters can be styled and queried in the client. An optional clipping mask can be applied, e.g. to restrict DEMs to land areas. See the demo .
+
+ Stuart Matthews
+
+
+
+
+ Leaflet.projwmts
+
+ Adding WMTS services (GUGiK Poland).
+ (demo ).
+
+ Geoportal Poland
+
+
+
+
+
+### Non-map base layers
+
+Sometimes you don't want to load a map, just big custom images. **Really** big ones.
+
+
+
+
+
+### Tile/image display
+
+The following plugins change the way that tile or image layers are displayed in the map.
+
+
Plugin Description Maintainer
+
+
+ TileLayer.BoundaryCanvas
+
+ Allows you to draw tile layers with arbitrary polygonal boundary. HTML5 Canvas is used for rendering.
+
+ Alexander Parshin
+
+
+
+
+ TileLayer.Grayscale
+
+ A regular TileLayer with grayscale makeover.
+
+ Ilya Zverev
+
+
+
+
+ Leaflet.ImageTransform
+ Add support of image overlays with arbitrary perspective transformation.
+
+ Alexander Parshin ,
+ Sergey Alekseev
+
+
+
+
+ Leaflet.OpacityControls
+
+ Simple Leaflet controls to adjust the opacity of a map layer.
+
+ Jared Dominguez
+
+
+
+
+ Leaflet.DistortableImage
+
+ Enable users to scale, rotate, and distort images on Leaflet maps.
+
+ Public Lab
+
+
+
+
+ Leaflet.DistortableVideo
+
+ Enable users to scale, rotate, and distort videos on Leaflet maps. (demo ).
+
+ Roni Karilkar
+
+
+
+
+ Leaflet.ImageOverlay.Rotate
+
+ Displays rotated, scaled and skewed (but not rubbersheeted) ImageOverlays, given three control points. (demo ).
+
+ Iván Sánchez Ortega
+
+
+
+
+ Leaflet.TileLayer.ColorFilter
+
+ A simple and lightweight Leaflet plugin to apply CSS filters on map tiles (demo ).
+
+ Cláudio Kawakani
+
+
+
+
+ Leaflet.TileLayer.Mask
+
+ A TileLayer with mask effect (demo )
+
+ Yuzo Matsuzawa
+
+
+
+
+ Leaflet.TileLayer.PixelFilter
+
+ A TileLayer which can filter and replace pixels by RGB code.
+
+ demo 1 • demo 2
+
+ GreenInfo Network
+
+
+
+
+ Leaflet.Control.SideBySide
+
+ A Leaflet control to add a split screen to compare two map overlays (demo ).
+
+ Digital Democracy
+
+
+
+
+ Leaflet.TileLayer.GL
+
+ Applies custom WebGL shaders to each tile in a tilelayer (demo ).
+
+ Iván Sánchez
+
+
+
+
+ Leaflet.TileLayer.ColorPicker
+
+ A Leaflet TileLayer with getColor(latLng). Demos: color picker , elevation picker with mapbox terrain-RGB
+
+ Yuzo Matsuzawa
+
+
+
+
+ Leaflet.TileLayer.Colorizr
+
+ A Leaflet TileLayer which can modify colors by RGBA code. Demos: coming soon.
+
+ Hinrich Riedel
+
+
+
+
+ Leaflet.UTFGrid
+
+ Provides UTF-8 Grid support for Leaflet >= 1.0. Includes basic mouseover support plus ability to highlight feature from UTFGrid on hover (demo ).
+
+ Brendan Ward
+
+
+
+
+ Leaflet.Control.Opacity
+
+ Make multiple tile layers transparent. (demo )
+
+ Yasunori Kirimoto
+
+
+
+
+ Leaflet.TileLayer.GLColorScale
+
+ TileLayer that uses WebGL to colorize floating-point pixels according to a specified color scale (demo ).
+
+ David Schneider
+
+
+
+
+ Leaflet.Control.DetailLevel
+
+ Display tiles at higher-than-retina (hdpi) resolutions, by real-time modification of the zoomOffset. Useful for mapping sources which drastically change map style between different zoom levels. Increasing the zoomOffset by too much does slow down the browser, as the number of displayed tiles grows exponentially with the zoomOffset. (demo ).
+
+ Wessel Valkenburg
+
+
+
+
+ Leaflet.Multispectral
+
+ Provides multispectral channel manipulation and processing tools (such as NDVI or other remote sensing methods) for Leaflet image layers using pure client-side JavaScript. It uses `image-sequencer` via an ImageOverlay `filter()` function. (demo ).
+
+ Public Lab
+
+
+
+
+
+
+### Tile Load
+
+The following plugins change the way that tile layers are loaded into the map.
+
+
+
+
+
+### Vector tiles
+
+Plugins to display [vector tiles](https://github.com/mapbox/vector-tile-spec).
+
+
Plugin Description Maintainer
+
+
+ Leaflet.MapboxVectorTile
+
+ A Leaflet Plugin that renders Mapbox Vector Tiles on canvas. See demo . Compatible with Leaflet 0.7.x only.
+
+ SpatialDev
+
+
+
+
+ Hoverboard
+
+ Render vector tiles on canvas with leaflet (geojson, topojson, and protobuf). See demo . Compatible with Leaflet 0.7.x only.
+
+ Tristan Davies
+
+
+
+
+ geojson-vt
+
+ Efficient library for slicing GeoJSON data into vector tiles on the fly.
+
+ Mapbox
+
+
+
+
+ Leaflet.VectorGrid
+
+ Display gridded vector data (GeoJSON or TopoJSON sliced with geojson-vt, or protobuf vector tiles) in Leaflet 1.0.0. See demos . Not compatible with 0.7.x.
+
+ Iván Sánchez
+
+
+
+
+ Leaflet.VectorTileLayer
+
+ A Leaflet layer for displaying vector tiles. Very similar to Leaflet.VectorGrid except for styling: a single style can be specified for all layers while VectorGrid requires knowing layer names in advance. For Leaflet 1.0.0.
+
+ Joachim Kuebart
+
+
+
+
+
+## Overlay data
+
+The following plugins provide new ways of loading overlay data (GIS vector data): points, lines and polygons.
+
+* [Overlay data formats](#overlay-data-formats)
+* [Dynamic data loading](#dynamiccustom-data-loading)
+* [Synthetic overlays](#synthetic-overlays)
+* [Data providers](#data-providers)
+
+### Overlay data formats
+
+Load your own data from various GIS formats.
+
+
Plugin Description Maintainer
+
+
+ leaflet-kml
+
+ Loads & displays KML
+
+ Windyx
+
+
+
+
+ leaflet-omnivore
+
+ Loads & converts CSV, KML, GPX, TopoJSON, WKT formats for Leaflet.
+
+ Mapbox
+
+
+
+
+ Leaflet.FileLayer
+
+ Loads files (GeoJSON, GPX, KML) into the map using the HTML5 FileReader API (i.e. locally without server).
+
+ Mathieu Leplatre
+
+
+
+
+ Leaflet.geoCSV
+
+ Leaflet plugin for loading a CSV file as geoJSON layer.
+
+ Iván Eixarch
+
+
+
+
+ Leaflet.Shapefile
+
+ Put a shapefile onto your map as a layer.
+
+ Calvin Metcalf
+
+
+
+
+ Leaflet.FileGDB
+
+ Put an ESRI File GeoDatabase onto your map as a layer.
+
+ Calvin Metcalf
+
+
+
+
+ Leaflet.encoded
+
+ Use encoded polylines in Leaflet.
+
+ Jieter
+
+
+
+
+ Leaflet GPX
+
+ GPX layer, targeted at sporting activities by providing access to information such as distance, moving time, pace, elevation, heart rate, etc.
+
+ Maxime Petazzoni
+
+
+
+
+ Wicket
+
+ A modest library for translating between Well-Known Text (WKT) and Leaflet geometry objects (e.g. between L.marker() instances and "POINT()" strings).
+
+ K. Arthur Endsley
+
+
+
+
+ qgis2web
+
+ A QGIS plugin to make webmaps without coding.
+
+ Tom Chadwin
+
+
+
+
+ Leaflet-WFST
+
+ WFS client layer with transaction support
+
+ Flexberry
+
+
+
+
+ Leaflet-BetterScale
+
+ A new, more GIS-like scalebar with alternating black/white bars.
+
+ Dan Brown
+
+
+
+
+ Leaflet-GeoPackage
+
+ Load GeoPackage Tile and Feature Layers.
+
+ Daniel Barela ,
+ NGA
+
+
+
+
+ Leaflet-CsvTiles
+
+ Load points from tiled csv files, using the amazing PapaParse library. Demo .
+
+ Gherardo Varando
+
+
+
+
+
+
+### Dynamic/custom data loading
+
+Load dynamic data which is updated in the map, or load GIS vector data in non-standard ways.
+
+
+
+
+
+### Synthetic overlays
+
+These plugins create useful overlays from scratch, no loading required.
+
+
+
+
+
+### Data providers
+
+Load overlay data from third-party-services. See also [basemap providers](#basemap-providers) and [plugin collections](#collections).
+
+
+
+
+
+## Overlay display
+
+The following plugins provide new ways of displaying overlay data information.
+
+* [Markers & renderers](#markers--renderers)
+* [Overlay animations](#overlay-animations)
+* [Clustering/decluttering](#clusteringdecluttering)
+* [Heatmaps](#heatmaps)
+* [DataViz](#dataviz)
+
+
+### Markers & renderers
+
+These plugins provide new markers or news ways of converting abstract data into images in your screen. Leaflet users versed in GIS also know these as symbolizers.
+
+
Plugin Description Maintainer
+
+
+ Leaflet.RoughCanvas
+
+ Leaflet.RoughCanvas renders hand-drawn, sketch style vector map (polyline, polygon, geojson).
+
+ haoming
+
+
+
+
+ Leaflet.ellipse
+
+ Leaflet.ellipse place ellipses on map by specifying center point, semi-major axis,
+ semi-minor axis, and tilt degrees from west.
+
+ JD Fergason
+
+
+
+
+ Leaflet.label
+
+ Adds text labels to map markers and vector layers.
+
+ Jacob Toye
+
+
+
+
+ Leaflet-semicircle
+
+ Adds functionality to L.Circle to draw semicircles.
+
+ Jieter
+
+
+
+
+ Leaflet.PolylineDecorator
+
+ Allows you to draw patterns (like dashes, arrows or evenly spaced Markers) along Polylines or coordinate paths.
+
+ Benjamin Becquet
+
+
+
+
+ Leaflet-arrowheads
+
+ Allows user to quickly draw arrowheads on polylines for vector visualization.
+
+ Slutske22
+
+
+
+
+ Leaflet.Sprite
+
+ Use sprite based icons in your markers.
+
+ Calvin Metcalf
+
+
+
+
+ Leaflet.TextPath
+
+ Allows you to draw text along Polylines.
+
+ Mathieu Leplatre
+
+
+
+
+ Leaflet-SVGIcon
+
+ A simple and customizable SVG icon with no external dependencies. Also included is a convenience Marker class and two example subclasses. Customizable demo with example subclasses
+
+ Ilya Atkin
+
+
+
+
+ Leaflet.BeautifyMarkers
+
+ Lightweight plugin that adds colorful iconic markers without image and gives full control of style to end user (i.e. Unlimited colors and CSS styling).
+
+ Muhammad Arslan Sajid
+
+
+
+
+ Leaflet.Awesome-Markers
+
+ Colorful, iconic & retina-proof markers based on the Font Awesome icons/Twitter Bootstrap icons
+
+ Lennard Voogdt
+
+
+
+
+ Leaflet.Extra-Markers
+
+ Shameless copy of Awesome-Markers with more shapes, colors and semantic-ui support
+
+ Cory Silva
+
+
+
+
+ Leaflet.MakiMarkers
+ Create markers using Maki Icons from MapBox.
+
+ James Seppi
+
+
+
+
+ Leaflet.Icon.Glyph
+
+ Use icon font glyphs in your markers (from Font Awesome, Material Design Icons, Glyphicons,
+ Metro UI icons, Elusive, and other icon fonts). (demo )
+
+ Iván Sánchez Ortega
+
+
+
+
+ Leaflet.LineExtremities
+
+ Show symbols at the extremities of polylines, using SVG markers.
+
+ Frédéric Bonifas
+
+
+
+
+ Leaflet.VectorMarkers
+
+ Vector SVG markers for Leaflet, with an option for Font Awesome/Twitter Bootstrap icons.
+
+ Mathias Schneider
+
+
+
+
+ Leaflet.SvgShapeMarkers
+
+ Adds support for additional SVG marker types such as triangles, diamonds and squares.
+
+ Rowan Winsemius
+
+
+
+
+ Leaflet.pattern
+
+ Add support for pattern fills on Paths.
+
+ Tyler Eastman
+
+
+
+
+ Leaflet.BoatMarker
+
+ A boat marker using HTML Canvas for displaying yachts and sailboats with heading and optional wind information. Demo .
+
+ Thomas Brüggemann
+
+
+
+
+ leaflet-usermarker
+
+ Plugin for plotting a marker representing a user - or multiple users - on a map,
+ with support for drawing an accuraccy circle. Can be seen in action on
+ Longitude.me .
+
+ Jonatan Heyman
+
+
+
+
+ Leaflet.geojsonCSS
+
+ Geojson CSS implementation for Leaflet.
+
+ Alexander Burtsev
+
+
+
+
+ leaflet-simplestyle
+
+ Extends L.geoJSON to support the simple style spec.
+
+ Rowan Winsemius
+
+
+
+
+ OSM Buildings
+
+ Amazing JS library for visualizing 3D OSM building geometry on top of Leaflet.
+
+ Jan Marsch
+
+
+
+
+ Leaflet.EdgeMarker
+
+ Plugin to indicate the existence of Features outside of the current view.
+
+ Gerald Pape
+
+
+
+
+ Leaflet.orientedMarker
+
+ Allows to manage orientation of markers dynamically.
+
+ Gismartwaredev
+
+
+
+
+ leaflet-icon-pulse
+
+ Renders pulsing icon using CSS3. It can be used for location marker.
+
+ mapshakers /
+ Filip Zavadil
+
+
+
+
+ leaflet-mapkey-icon
+
+ Set of cartographic font icons based on mapkeyicons .
+
+ mapshakers /
+ Filip Zavadil
+
+
+
+
+ Leaflet.Photo
+
+ Plugin to show geotagged photos on a Leaflet map. Demo .
+
+ Bjørn Sandvik
+
+
+
+
+ Leaflet.curve
+
+ A Leaflet plugin for drawing Bézier curves and other complex shapes. Demo .
+
+ elfalem
+
+
+
+
+ Leaflet.bezier
+
+ Draws a Bézier line between two points with an animated flight object.
+
+ Supun Praneeth
+
+
+
+
+ Leaflet.Arc
+
+ This plugin adds L.Polyline.Arc function which wraps arc.js functionality for creation of Great Cirlce arcs.
+
+ Alexey Gusev
+
+
+
+
+ leaflet-choropleth
+
+ Extends L.geoJson to add a choropleth visualization (color scale based on value). Demo .
+
+ Tim Wisniewski
+
+
+
+
+ Leaflet.Canvas-Markers
+
+ Displays markers on canvas instead of DOM.
+
+ Evgeniy Voynov
+
+
+
+
+ leaflet-tracksymbol
+
+ This marker provides a tracksymbol with orientation, velocity-vector and configurable shape.
+
+ Tim Leerhoff
+
+
+
+
+ leaflet-ais-tracksymbol
+
+ AIS Extension for leaflet-tracksymbol It displays AIS Contacts on the Map.
+
+ Johannes Rudolph
+
+
+
+
+ leaflet-ais-tracksymbol-search
+
+ Adds a Search Box for your Leaflet Map and Your [leaflet-ais-trackymbol](https://github.com/PowerPan/leaflet-ais-tracksymbol)
+
+ Johannes Rudolph
+
+
+
+
+ leaflet.TravelNotes
+
+
+ Editable markers and routing engine for leaflet. The routing engine have plugins for Mapbox, GraphHopper and OSRM and can be used for car, bike or pedestrian route. Demo .
+
+
+ Christian Guyette
+
+
+
+
+ Leaflet.Marker.Stack
+
+
+ A pure Leaflet implementation of CartoDB's "stacked chips " symbolizer. Demo .
+
+
+ Iván Sánchez
+
+
+
+
+ leaflet-polygon.fillPattern
+
+
+ Extend the Polygon Object to fill SVG Path element with an image pattern.Demo .
+
+
+ CloudyBay
+
+
+
+
+ Leaflet Polyline Offset
+
+
+ Adds to L.Polyline the ability to be shifted with a relative pixel offset, without modifying its actual LatLngs. The offset value can be either negative or positive, for left- or right-side offset, and remains constant across zoom levels (basic demo ).
+
+
+ Benjamin Becquet
+
+
+
+
+ leaflet-labeled-circle
+
+
+ Special type of SVG marker with a label inside and draggable around the anchor point (demo ).
+
+
+ Alexander Milevski
+
+
+
+
+ Leaflet.ParallaxMarker
+
+
+ Add markers that moves with a parallax-effect relative to the map when panning (demos / examples ).
+
+
+ Dag Jomar Mersland
+
+
+
+
+ leaflet-distance-markers
+
+
+ Allows displaying markers along a route (L.Polyline) at equivalent distances (eg. one per mile) (demo ).
+
+
+ Doroszlai, Attila
+
+
+
+
+ leaflet-corridor
+
+
+ Renders a polyline with width fixed in meters, not in pixels; adjusts width depending on zoom level (demo ).
+
+
+ Mikhail Shilkov
+
+
+
+
+ Leaflet.LabelTextCollision
+
+
+ Displays labels on paths (polylines, polygons, circles) avoiding label collision. (demo ).
+
+
+ Kenta Hakoishi
+
+
+
+
+ Leaflet.streetlabels
+
+
+ A Leaflet plugin to show labels following the paths of polylines. An extension of yakitoritabetai Leaflet.LabelTextCollision (demo ).
+
+
+ Triede TI
+
+
+
+
+ Leaflet.Viewpoint
+
+
+ Displays circleMarker with multiple directions.
+ Useful to show photos taken from one point. (demo ).
+
+
+ Grigory Golikov
+
+
+
+
+ Leaflet.magicMarker
+
+
+ Adding magical animation effect to a marker while loading.(Demo ).
+
+
+ Sylvenas
+
+
+
+
+ Leaflet.Marker.Highlight
+
+
+ Adding highlight performance for L.marker.(Demo ).
+
+
+ Brandon Xiang
+
+
+
+
+ Leaflet.GeotagPhoto
+
+
+ Plugin for photo geotagging, with two modes: camera and crosshair (Demo ).
+
+
+ Bert Spaan
+
+
+
+
+ Leaflet.GLMarkers
+
+ Display thousands of markers with custom WebGL shaders, optionally animated. (demo )
+
+ Iván Sánchez Ortega
+
+
+
+
+ Leaflet.River
+
+
+ Draw lines with different width (like rivers) on a map.
+ Useful when you want to show how rivers 'flow' on the map (demo ).
+
+
+ Grigory Golikov
+
+
+
+
+ Leaflet.SpeechBubble
+
+
+ Popup a speech bubble with the arrow that follow points, layer, markers ...
+ (demo ).
+
+
+ Sylvain BRISSY
+
+
+
+
+ Leaflet Swoopy
+
+
+ A plugin for creating customizable swoopy arrow annotations.
+
+
+ webkid
+
+
+
+
+ leaflet-polycolor
+
+
+ Color each polyline segment. (demo )
+
+
+ Olivier Gasc
+
+
+
+
+ leaflet-marker-direction
+
+
+ display the path and the direction of the marker. (demo )
+
+
+ Jack Zou
+
+
+
+
+ Leaflet Rotated Marker
+
+
+ Enables rotation of marker icons in Leaflet. (Demo )
+
+
+ Benjamin Becquet
+
+
+
+
+ Leaflet Truesize
+
+
+ A plugin for creating projection aware draggable polygons and polylines.
+
+
+ webkid
+
+
+
+
+ Leaflet.RepeatedMarkers
+
+
+ Displays markers when wrapping around the globe, once every 360 degrees of longitude (demo ).
+
+
+ Iván Sánchez
+
+
+
+
+ Leaflet.Geodesic
+
+ Draw geodesic lines and circles. A geodesic line is the shortest path between two given points on the earth surface. It uses Vincenty's formulae for highest precision and distance calculation. Written in Typescript and available via CDN. Demo
+
+ Henry Thasler
+
+
+
+
+ Leaflet.greatCircle
+
+
+ A wrapper class for the Leaflet.js Polygon object that draws true "great circles" (showing true geodesic, spherical paths) that wrap around the Earth (demo ).
+
+
+ Alex Wellerstein
+
+
+
+
+ Leaflet.CustomLayer
+
+
+ A Leaflet plugin L.CustomLayer - fully custom Layer.
+
+
+ Derek Li
+
+
+
+
+
+
+### Overlay animations
+
+These plugins animate markers or some geometries. See also [geometries with time or elevation](#geometryinteraction-time).
+
+
+
+
+
+### Clustering/Decluttering
+
+When you are displaying a lot of data, these plugins will make your map look cleaner.
+
+
+
+### Heatmaps
+
+These plugins create heatmaps and heatmap-like visualizations from vector data.
+
+
+
+
+### DataViz
+
+Powerful multi-purpose libraries for data visualization.
+
+
Plugin Description Maintainer
+
+
+ geogrid.js
+
+ Displays data aggregated by the ISEA3H discrete global grid system. The data can, e.g., be delivered by using Measures REST (a framework to deliver data aggregated by the grid) or geogrid (a library for handling the grid in case that you want to aggregate data manually).
+
+ F.-B. Mocnik, GIScience Research Group, Heidelberg University
+
+
+
+
+ RaphaelLayer
+
+ Allows you to use Raphael as a layer on a Leaflet map for advanced animations and visualizations.
+
+ Dynamic Methods
+
+
+
+
+ Leaflet Data Visualization Framework
+
+ New markers, layers, and utility classes for easy thematic mapping and data visualization.
+
+ Scott Fairgrieve
+
+
+
+
+ Leaflet.D3SvgOverlay
+
+ SVG overlay class for using with D3 library. Supports zoom animation and scaling without need to redraw the layer.
+
+ Kirill Zhuravlev
+
+
+
+
+ mapbox-gl-leaflet
+
+ Binding from Mapbox GL JS to the Leaflet API
+
+ Tom MacWright
+
+
+
+
+ leaflet-echarts
+
+ A plugin for Leaflet to load echarts map and make big data visualization easier.
+
+ wandergis
+
+
+
+
+ jquery-storymap
+
+ A jQuery plugin to display several map locations as the user scrolls through paragraphs.
+
+ Atle Frenvik Sveen
+
+
+
+
+ Leaflet for R
+
+ Allows using Leaflet from within R programs, a programming language popular for statistical analysis and data mining.
+
+ RStudio team
+
+
+
+
+ leaflet.migrationLayer
+
+ leaflet.migrationLayer is used to show migration data such as population, flight, vehicle, traffic and so on. Data visualization on map.demo
+
+ Sylvenas
+
+
+
+
+ Leaflet.Quadtree
+
+ Leaflet.Quadtree is used to retrieve visible data inside given bounds
+
+ ibesora
+
+
+
+
+ Leaflet.Canvas-Flowmap-Layer
+
+ A LeafletJS custom map layer for mapping the flow of objects, ideas, people, etc. with Bezier curves rendered on the HTML canvas.
+
+ Jacob Wasilkowski ,
+ Sarah Bell
+
+
+
+
+ Leaflet.PixiOverlay
+
+ A Leaflet overlay class for drawing and animating with Pixi.js . (demo )
+
+ Manuel Baclet
+
+
+
+
+ leaflet-velocity
+
+
+ Visualise velocity layers with leaflet.
+ Demo here.
+
+
+ Dan Wild
+
+
+
+
+ leaflet-partition
+
+
+ Divide the area into parts in different ways such as voronoi(triangulation) and hexagonal tiling.
+ Basic demo
+
+
+ locknono
+
+
+
+
+
+
+## Interaction with geometries/features
+
+The following plugins enable users to interact with overlay data: edit geometries, select areas or features, interact with the time dimension, search features and display information about them.
+
+* [Edit geometries](#edit-geometries)
+* [Time & elevation](#time--elevation)
+* [Search & popups](#search--popups)
+* [Area/overlay selection](#areaoverlay-selection)
+
+### Edit geometries
+
+Allows users to create, draw, edit and/or delete points, lines and polygons.
+
+
Plugin Description Maintainer
+
+
+ Leaflet-Geoman
+
+ Geometry Management for Leaflet 1.0 and higher. Draw, Edit, Cut, Drag and Snap Layers like Markers, Circles, Rectangles, Polylines, Polygons, LayerGroups, geoJSON, MultiPolygons, MultiLineStrings. Supports holes in polygons, snapping, canvas mode and more. (Demo )
+
+ Sumit Kumar
+
+
+
+
+ Leaflet.FreeDraw
+
+ Zoopla inspired freehand polygon creation using Leaflet.js and D3.
+
+ Wildhoney
+
+
+
+
+ Leaflet.plotter
+
+ leaflet-plotter allows you to create routes using a leaflet powered map. You can click on the mid-points to create a new, draggable point.
+
+ Nathan Mahdavi
+
+
+
+
+ Leaflet.Editable.Polyline
+ Editable polylines: move existing points, add new points and split polylines.
+
+ Tomo Krajina
+
+
+
+
+ Leaflet.draw
+
+ Enables drawing features like polylines, polygons, rectangles, circles and markers through a very nice user-friendly interface with icons and hints. Recommended!
+
+ Jacob Toye
+
+
+
+
+ Leaflet.EditableHandlers
+
+ A set of plugins that includes circle editing, measuring tool, and label for polygon sides.
+
+ Kartena
+
+
+
+
+ Leaflet.StyleEditor
+
+ Enables editing the styles of features (lines, polygons, etc) and markers with a GUI.
+
+ Dennis Wilhelm
+
+
+
+
+ Leaflet.SimpleMarkers
+
+ A light-weight Leaflet plugin for adding and deleting markers.
+
+ Jared Dominguez
+
+
+
+
+ Leaflet.Editable
+
+ Lightweight fully customisable and controllable drawing/editing plugin.
+
+ Yohan Boniface
+
+
+
+
+ Leaflet.Path.Drag
+
+
+ Drag handler and interaction for polygons and polylines (Demo )
+
+
+ Alexander Milevski
+
+
+
+
+ Leaflet.Path.Transform
+
+
+ Scale & rotate handler and interaction for polygons and polylines (Demo )
+
+
+ Alexander Milevski
+
+
+
+
+ Leaflet.Snap
+
+ Enables snapping of draggable markers to polylines and other layers.
+
+ Mathieu Leplatre
+
+
+
+
+ Leaflet.Clipper
+
+ Allows Union, Difference, Xor, and Intersection operations on two polygons. (Demo )
+
+ will Farrell
+
+
+
+
+ Leaflet.MapPaint
+
+
+ Bitmap painting plugin designed for touch devices.
+
+ Antoine Pultier
+
+
+
+
+ Leaflet.Storage
+
+ Create/update/delete Map, Marker, Polygon, Polyline... and expose them for backend storage with an API.
+
+ Yohan Boniface
+
+
+
+
+ Leaflet.Pather
+
+ L.Pather is a freehand polyline creator that simplifies the polyline for mutability. Requires D3 support.
+
+ Wildhoney
+
+
+
+
+ Leaflet.Illustrate
+
+ Extension for Leaflet.draw enabling users to type annotations directly on maps .
+
+ Justin Manley
+
+
+
+
+ Leaflet.Pin
+
+ Enable attaching of markers to other layers during draw or edit features with Leaflet.Draw.
+
+ Konrad Klimczak
+
+
+
+
+ L.Control.PaintPolygon
+
+ Draw yours polygons with a circle brush like Paint[brush]. Includes turf.js dependencies.
+
+ Thibault Coupin
+
+
+
+
+ Leaflet-Craft
+
+ Extends Leaflet.FreeDraw and gives extended features like Undo-Redo, deleting markers,dynamic area calculation of polygons ,various hooks/events and in-build control bars, etc.
+
+ Sagarpreet Chadha
+
+
+
+
+ Leaflet.SegmentEdit
+
+ An extension to Leaflet.draw to allow editing large polylines one chunk at the time.
+
+ Lemaf
+
+
+
+
+
+### Time & elevation
+
+Most data is two-dimensional (latitude and longitude), but some data has more dimensions (altitude and/or time). The following plugins help users navigate these extra dimensions.
+
+
Plugin Description Maintainer
+
+
+ Leaflet.timelineSlider
+
+
+ Leaflet plugin that creates a customizable timeline slider with user designed functionality. Original implementation of timeline at https://codepen.io/trevanhetzel/pen/rOVrGK.
+
+
+ Sol Vitkin
+
+
+
+
+ Leaflet.TimeDimension
+
+
+ Add time dimension capabilities on a Leaflet map. Demos
+
+
+ ICTS SOCIB
+
+
+
+
+ Leaflet Time-Slider
+
+ The Leaflet Time-Slider enables you to dynamically add and remove Markers on a map by using a JQuery UI slider
+
+ Dennis Wilhelm
+
+
+
+
+ LeafletPlayback
+
+ Play back time-stamped GPS Tracks synchronized to a clock.
+
+ Nicholas Hallahan
+
+
+
+
+ Leaflet.timeline
+
+ Display arbitrary GeoJSON on a map with a timeline slider and play button.
+
+ Jonathan Skeate
+
+
+
+
+ Leaflet.Elevation
+
+ A Leaflet plugin to view interactive height profiles of GeoJSON lines using d3 .
+
+ Felix Bache
+
+
+
+
+ Leaflet.Heightgraph
+
+ Inspired by Leaflet.Elevation this Leaflet plugin allows you to view interactive height profiles stored as GeoJSON featuring the handy ability to visualize arbitrary segments (e.g. surface types or steepness categories) with customized colors stored as properties within the GeoJSON itself.
+
+ Robin Boldt
+
+
+
+
+ Leaflet.hotline
+
+ A Leaflet plugin for drawing gradients along polylines.
+
+ iosphere
+
+
+
+
+ leaflet.TrackPlayBack
+
+
+ A leaflet track-playback plugin, can display and dynamically play tracks. Demo .
+
+
+ linghuam
+
+
+
+
+
+
+
+### Search & popups
+
+Plugins that search for overlays and enhance how to display information about them.
+
+
+
+
+
+### Area/overlay selection
+
+These plugins help users select either overlays or areas in the map.
+
+
+
+
+
+## Map interaction
+
+New ways to interact with the map itself.
+
+* [Layer switching controls](#layer-switching-controls)
+* [Interactive pan/zoom](#interactive-panzoom)
+* [Bookmarked pan/zoom](#bookmarked-panzoom)
+* [Fullscreen](#fullscreen-controls)
+* [Minimaps & synced maps](#minimaps--synced-maps)
+* [Measurement](#measurement)
+* [Mouse coordinates](#mouse-coordinates)
+* [Events](#events)
+* [User interface](#user-interface)
+* [Print/export](#printexport)
+* [Geolocation](#geolocation)
+
+### Layer switching controls
+
+The following plugins enhance or extend `L.Control.Layers`.
+
+
+
+
+### Interactive pan/zoom
+
+Change the way the user can interactively move around the map.
+
+
+
+
+
+### Bookmarked pan/zoom
+
+Change the way the user is moved around the map, by jumping to predefined/stored places.
+
+
+
+
+
+### Fullscreen controls
+
+Allows display of the map in full-screen mode.
+
+
+
+
+
+### Minimaps & synced maps
+
+Display two maps at once. One of them might be a different size and zoom level, usable as a minimap to aid with navigation.
+
+
+
+
+
+
+
+
+### Measurement
+
+Allow the user to measure distances or areas.
+
+
+
+
+
+
+
+
+
+
+### Mouse coordinates
+
+Show the geographical coordinates under the mouse cursor in different ways.
+
+
+
+
+
+
+
+
+
+
+
+### Events
+
+These plugins extend Leaflet event handling.
+
+
Plugin Description Maintainer
+
+
+ Leaflet.GestureHandling
+
+ Brings the basic functionality of Google Maps Gesture Handling into Leaflet. Prevents users from getting trapped on the map when scrolling a long page.
+ Demo
+
+ Andy Marquis
+
+
+
+
+ L.Sleep
+
+ Avoid unwanted scroll capturing.
+ Demo
+
+ atstp
+
+
+
+
+ Leaflet.OverIntent
+
+ Adds a new event ``mouseintent``, that differs from ``mouseover`` since it reflects user
+ intentions to aim a particular layer.
+
+ Mathieu Leplatre
+
+
+
+
+ Leaflet.AlmostOver
+
+ Trigger mouse events when cursor is "almost" over a layer.
+
+ Mathieu Leplatre
+
+
+
+
+ Leaflet-active-area
+
+ This plugin allows you to use a smaller portion of the map as an active area.
+ All positioning methods (setView, fitBounds, setZoom) will be applied on this portion instead of the all map.
+
+ Mappy
+
+
+
+
+ Leaflet.ControlledBounds
+
+ Inspired by Leaflet-active-area, automatically detects the largest area of the map not covered by any map controls and applies setView, fitBounds, setZoom, getBounds to that area.
+
+ Iván Sánchez Ortega ,
+ MazeMap
+
+
+
+
+ singleclick
+
+
+ Extend L.Map to fire a singleclick event (demo ). Compatible with Leaflet 0.7.x only.
+
+
+ Guillaume Lathoud
+
+
+
+
+ singleclick
+
+
+ Extend L.Evented to fire a singleclick event (demo ). Compatible with Leaflet 1.0.0-beta1 and greater only.
+
+ Iván Sánchez Ortega ,
+ MazeMap
+
+
+
+
+ Leaflet.VisualClick
+
+
+ Adds visual feedback when user clicks/taps the map (demo ).
+ Useful when further action is delayed by server requests, or implementation of Leaflet.singleclick.
+ Or just because it looks cool :)
+ Only tested with Leaflet 1.0.0-beta1.
+
+ Dag Jomar Mersland ,
+ Iván Sánchez Ortega ,
+ MazeMap
+
+
+
+
+ Leaflet Touch Helper
+
+ Makes it easy to touch vector overlays with thick fingers on a small display by adding a transparent, larger touch surface
+
+ Per Liedman / Prominent Edge
+
+
+
+
+ Leaflet.ClickTolerance
+
+ This plugin allows you to increase the click tolerance of canvas powered layers, making it possible to increase the clickable area of vector layers beyond their visible extent. Useful when your features are difficult to click otherwise.
+
+ Geoloep
+
+
+
+
+ L.DraggableEnhancer
+
+ Modify the default L.Draggable handler (responsible for map panning, ...) to make it work properly if one of the map container's parents has predefined handlers like "event.stopPropagation()' attached to a "mousemove" event for example.
+
+ Vincent Dechandon
+
+
+
+
+ L.Spotlight
+
+ Dynamically highlight features near the mouse cursor with a customizable shape
+
+ Isaac Boates
+
+
+
+
+
+
+### User interface
+
+Buttons, sliders, toolbars, sidebars, and panels.
+
+
Plugin Description Maintainer
+
+
+ Leaflet.Control.Custom
+
+ Fully customizable Leaflet control panel with HTML element.
+ Demo
+
+ Yiğit Yüce
+
+
+
+
+ L.EasyButton
+
+ In one line, add a Font Awesome control button with attached click events.
+ Demo
+
+ atstp
+
+
+
+
+ Leaflet.contextmenu
+
+ A context menu for Leaflet.
+
+ Adam Ratcliffe
+
+
+
+
+ Leaflet.CountrySelect
+
+ Control with menu of all countries, and an event listener that returns
+ the selected country as a GeoJSON feature (demo )
+
+ Anika Halota
+
+
+
+
+ Leaflet.GeojsonLayerSwitcher
+
+
+ Allows to navigate between GeoJSON layers, select some, and return selection.
+
+
+ Easy-Mountain
+
+
+
+
+ leaflet-sidebar-v2
+
+ A responsive, tabbed sidebar with HTML & JS API.
+ Compatible with old (0.7) and current leaflet.
+
+ Norwin Roosen
+
+
+
+
+ leaflet-sidebar
+
+ A responsive sidebar plugin.
+
+ Tobias Bieniek
+
+
+
+
+ sidebar-v2
+
+ Another responsive sidebar plugin. This time with tabs!
+
+ Tobias Bieniek
+
+
+
+
+ Leaflet.Messagebox
+
+
+ Display a temporary text message on a map (Demo )
+
+
+ Martijn Grendelman
+
+
+
+
+ Leaflet.TileLegend
+
+ Create illustrated and interactive legends for your background layers.
+
+ Yohan Boniface
+
+
+
+
+ Leaflet.toolbar
+
+
+ Flexible, extensible toolbars for Leaflet maps. View an example here .
+
+
+ Justin Manley
+
+
+
+
+ L.Credits
+
+
+ A simple, attractive, interactive control to put your logo and link in the corner of your map.
+
+
+ Greg Allensworth
+
+
+
+
+ Leaflet.Spin
+
+ Shows a nice spinner on the map using Spin.js ,
+ for asynchronous data load, like with Leaflet Ajax .
+
+ Mathieu Leplatre
+
+
+
+
+ Leaflet Weather
+
+
+ A Leaflet plugin for adding a weather widget to the map using OpenWeatherMap API (Demo ).
+
+
+ Osk
+
+
+
+
+ Leaflet ResizableControl
+
+
+ A Leaflet plugin to add a resizable and scrollable control to the map (Demo ).
+
+
+ David Albrecht
+
+
+
+
+ Leaflet.Slider
+
+
+ Adds a <input type="range"> slider that calls a function every time its input is changed (Demo )
+
+
+ EPP
+
+
+
+
+ leaflet-control-window
+
+ Creates modal/modeless, draggable, responsive, customisable window in your map.
+
+ mapshakers /
+ Filip Zavadil
+
+
+
+
+ Leaflet.CoordinatedImagePreview
+
+ Displays coordinated images in map bounds.
+
+ Yunus Emre Özkaya
+
+
+
+
+ Leaflet.SlideMenu
+
+
+ A simple slide menu for Leaflet.
+
+
+ Masashi Takeshita
+
+
+
+
+ Leaflet.Dialog
+
+
+ A simple resizable, movable, customizable dialog box. (Demo )
+
+
+ NBT Solutions
+
+
+
+
+ Leaflet.BootstrapZoom
+
+
+ Overrides default zoom control buttons with Twitter Bootstrap styled ones
+
+
+ Alexey Gusev
+
+
+
+
+ Leaflet.CondensedAttribution
+
+
+ An attribution plugin that makes long attributes visible on hover
+
+
+ Motion Intelligence GmbH
+
+
+
+
+ Leaflet.HtmlLegend
+
+
+ A simple Leaflet plugin for creating legends using HTML elements. Demo .
+
+
+ Kaveh Karimi
+
+
+
+
+ leaflet-blurred-location
+
+
+ A Leaflet-based interface for selecting a "blurred" or low-resolution location, to preserve privacy. Demo .
+
+
+ Public Lab
+
+
+
+
+ Leaflet.Control.Resizer
+
+ Control to resize your map on the right or bottom side. See demo
+
+ Javier Jimenez Shaw
+
+
+
+
+ leaflet-blurred-location-display
+
+
+
+ Cleverly dispays "blurred" locations using color-coded heatmap and color-coded markers while fetching data from remote API Demo .
+
+
+ Public Lab
+
+
+
+
+
+
+### Print/export
+
+Print or export your map.
+
+
+
+
+
+
+
+### Geolocation
+
+Plugins that extend Leaflet's geolocation capabilities.
+
+
+
+
+
+
+
+## Miscellaneous
+
+
+
+### Geoprocessing
+
+The following plugins perform several sorts of geoprocessing (mathematical and topological operations on points, lines and polygons).
+
+
+
+
+
+### Routing
+
+The following plugins use external services to calculate driving or walking routes.
+
+
Plugin Description Maintainer
+
+
+ Leaflet Routing Machine
+
+ Control for route search with via points, displaying itinerary and alternative routes. Uses
+ OSRM by default, but also supports
+ GraphHopper ,
+ Mapbox Directions API and more.
+
+ Per Liedman
+
+
+
+
+ Leaflet.Routing
+
+ Leaflet controller and interface for routing paths between waypoints using any user provided routing service.
+
+ Norwegian Trekking Association
+
+
+
+
+ Route360°
+
+ Route360° visualizes the area which is reachable from a set of starting points in a given time and gives detailed routing information (walk, bike, car and public transportation ) to targets.
+
+ Motion Intelligence GmbH
+
+
+
+
+ Leaflet RouteBoxer
+
+ This is a Leaflet implementation of the RouteBoxer Class from Google. The Leaflet RouteBoxer class generates a set of L.LatLngBounds objects that are guaranteed to cover every point within a specified distance of a path.
+
+ Nearest!
+
+
+
+
+ Leaflet.Routing.Amap
+
+ Control for route search using AMap(高德地图) as a backend. Supports the Chinese BD09 and GCJ02 coordinate systems, colourful lines, and turn-by-turn popups.
+
+ Jack Good
+
+
+
+
+ Leaflet TripGo routing
+
+
+ The TripGo mobility platform lets you create apps providing seamless and personalised door-to-door trips using any public, private or commercial mode of transport.
+ TripGo Leaflet's plugin motivation is to provide an easy way to include its functionality in an external platform.
+
+
+ SkedGo
+
+
+
+
+ leaflet.TravelNotes
+
+
+ Editable markers and routing engine for leaflet. The routing engine have plugins for Mapbox, GraphHopper and OSRM and can be used for car, bike or pedestrian route. Demo .
+
+
+ Christian Guyette
+
+
+
+
+ Leaflet.Reachability
+
+ Show areas of reachability based on time or distance for different modes of travel using the openrouteservice isochrones API .
+
+ Trafford Data Lab
+
+
+
+
+
+
+
+### Geocoding
+
+External services that transform an address or the name of a place into latitude and longitude (or vice versa).
+
+
+
+
+
+### Plugin collections
+
+Sets of plugins that span several categories.
+
+Plugin developers: please keep future plugins in individual repositories.
+
+
Plugin Description Maintainer
+
+
+ Plugins by Pavel Shramov
+
+ A set of plugins for: GPX, KML, TOPOJSON layers; Bing tile layer; Yandex layers (implemented with their APIs), and permalink control.
+
+ Pavel Shramov , Bruno B
+
+
+
+
+ Spectrum4Leaflet
+
+ Tools for using Spectrum Spatial Server services with leaflet. This plugin supports: map service, tile service, feature service. It has layers, legend and feature controls.
+
+ SVoyt , ESTI MAP
+
+
+
+
+ MapBBCode-related leaflet plugins
+
+ Seven plugins for various features, independent of the MapBBCode library.
+ From circular and popup icons to buttons, layer switcher, better search and attribution.
+
+ Ilya Zverev
+
+
+
+
+
+
+## Integration
+
+### Frameworks & build systems
+
+Ease your development integrating Leaflet into a development framework or automating some of the javascript/CSS work for complex applications.
+
+
Plugin Description Maintainer
+
+
+ leaflet-defaulticon-compatibility
+
+ Retrieve all Leaflet Default Icon options from CSS, in particular all icon images URL's, to improve compatibility with bundlers and frameworks that modify URL's in CSS. In particular for webpack (with style-, css-, file- and url-loader's), Rails Asset Pipeline and Django pipeline. Should solve all use cases linked to issue Leaflet/Leaflet #4968 . Demo with webpack (and without this plugin ).
+
+ ghybs
+
+
+
+
+ Leaflet Yeoman Generator
+
+ Yeoman generator that scaffolds out a basic Leaflet map application.
+
+ Moritz Klack
+
+
+
+
+ react-leaflet
+
+ React components for Leaflet maps.
+
+ Paul Le Cam
+
+
+
+
+ Leaflet.CSS
+
+ Add the main Leaflet CSS files (or any css) from within JavaScript, be gone conditional comments.
+
+ Calvin Metcalf
+
+
+
+
+ Leaflet LayerConfig
+
+ Provide a json file or service response with a configuration of layers and markers to automatically set up a Leaflet client.
+
+ Alexander Nossum
+
+
+
+
+ Leaflet.i18n
+
+ Internationalization for Leaflet plugins.
+
+ Yohan Boniface
+
+
+
+
+ Leaflet ZoomLevel CSS Class
+
+ Add zoom level css class to map element for easy style updates based on zoom levels
+
+ Dag Jomar Mersland
+
+
+
+
+ famous-map
+
+ Integrate Leaflet in applications made with the famo.us web framework.
+
+ Hein Rutjes
+
+
+
+
+ ngx-leaflet
+
+ Leaflet components and extensions for Angular.io .
+
+ Asymmetrik, Ltd.
+
+
+
+
+ Angular Leaflet directive
+
+ Integrate Leaflet in applications made with the AngularJS web framework.
+
+ David Rubert
+
+
+
+
+ Tiny Leaflet Directive
+
+ Tiny LeafletJS map directive for your AngularJS apps.
+
+ Martin Tesař
+
+
+
+
+ Leaflet Popup Angular
+
+ Use AngularJS in your Leaflet popups. Extends the built-in L.popup.
+
+ Grant Harris
+
+
+
+
+ Leaflet Control Angular
+
+ Insert and use Angularized HTML code in your Leaflet map as a Leaflet control.
+
+ Grant Harris
+
+
+
+
+ YAGA leaflet-ng2
+
+ Granular integration into Angular2/4. demo .
+
+ YAGA Development Team
+
+
+
+
+ <leaflet-map>
+
+ Integrate Leaflet in applications made with the Polymer >= 1.0 web component framework.
+
+ Hendrik Brummermann ,
+ Prateek Saxena
+
+
+
+
+ Leaflet map component
+
+ Integrate Leaflet in applications made with the Polymer 0.5 web framework.
+
+ Prateek Saxena
+
+
+
+
+ Leaflet.jsf
+
+ Comprehensive Java Server Faces(JSF) Component/Wrapper for Leaflet.
+
+ Terra SI LLC.
+ M.Çağrı Tepebaşılı
+
+
+
+
+ JSF2Leaf
+
+ A JavaServer Faces wrapper for Leaflet.
+
+ Leonardo Ciocari
+
+
+
+
+ ember-leaflet
+
+ Easy and declarative mapping for Ember.js using Leaflet.
+
+ Miguel Andrade
+
+
+
+
+ meteor-leaflet
+
+ Provides a Meteor package to quickly build real-time cross-platform map apps.
+
+ Bevan Hunt
+
+
+
+
+ L.Control.BootstrapModal
+
+ Trigger a Bootstrap modal using an on-map control.
+
+ Greg Allensworth
+
+
+
+
+ L.Control.jQueryDialog
+
+ Trigger a jQuery UI dialog/modal using an on-map control.
+
+ Greg Allensworth
+
+
+
+
+ V-Leaflet
+
+ Use Leaflet as a component for the Vaadin Java/HTML framework.
+
+ Matti Tahvonen
+
+
+
+
+ gwty-leaflet
+
+ A Java/GWT JsInterop wrapper for Leaflet. It allows using Leaflet in Java the same way as from a javascript script.
+
+ Zakaria Amine
+
+
+
+
+ Leaflet Map Builder
+
+ It populates a leaflet map from a configuration object, can also creates zoom, layers, attribution and draw controls. demo .
+
+ Gherardo Varando
+
+
+
+
+ Vue2Leaflet
+
+ Vue2Leaflet is a JavaScript library for the Vue.js framework that wraps Leaflet, making it easy to create reactive maps.
+
+ Mickaël KoRiGaN
+
+
+
+
+
+### 3
rd party integration
+
+The following plugins integrate Leaflet into third party services or websites.
+
+
Plugin Description Maintainer
+
+
+ Leaflet.EditInOSM
+
+ Add a control with links to open the current map view on main OSM editors.
+
+ Yohan Boniface
+
+
+
+
+ Maps Marker Pro
+
+ A WordPress plugin that enables users to pin, organize and share their favorite places and tracks through their WordPress powered site.
+
+ Robert Harm
+
+
+
+
+ WordPress Leaflet Map
+
+ Interactive and flexible shortcode to create multiple maps in posts and pages,
+ and to add multiple markers on those maps.
+
+ Benjamin J DeLong
+
+
+
+
+ Maptiks
+
+
+ Analytics platform for web maps. Track map activities, layer load times, marker clicks, and more!
+
+
+ Sparkgeo
+
+
+
+
+ Leaflet for Drupal
+
+ A Drupal (7.x and 8.x) module to integrate Leaflet maps in your Drupal site. Contains a field formatter to show a map for fields containing geospatial data, Views integration to plot data on a map, and a lightweight and easy to use API. Currently used by over 10.000 sites.
+
+ Marzee Labs , and more maintainers listed at drupal.org
+
+
+
+
+ Leaflet Easymap
+
+ Include a map in your HTML page without one line of programming. A data-driven Javascript module.
+
+ Klaus Stein
+
+
+
+
+ WP MapIt
+
+ Easy to use, WordPress Map plugin based on Open Street Map and Leaflet with custom markers images, descriptions and links.
+
+ Chandni Patel
+
+
+
+
+ Map Block Leaflet
+
+ A Block for the New WordPress Block Editor based on Leaflet, it allow add and custom maps from a visual interface.
+
+ Jesús Olazagoitia
+
+
+
+
+ ABP Usermap MyBB
+
+ A plugin for MyBB creating a map of users based on Open Street Map and Leaflet, with customisable popup and markers
+
+ CrazyCat
+
+
+
+
+ Leaflet Extensions for Joomla! (3.x)
+
+
+
+ Agosm:
+ Joomla Module not only for showing Markers on a OpenStreetMap Map.
+ Gibhub
+ Joomla Extension Directory
+
+
+ Aggpxtrack:
+ Joomla Custom Field for dispaying a GPX Track on a Map - you can choose an OpenStreetMap or GoogleMaps. With much options. For example: One option is an elevation profil.
+ Gibhub
+ Joomla Extension Directory
+
+
+ Agosmmapwithmarker:
+ Custom field for show a map with a marker in frond end - always the right card for the content. You can enter the address in backend.
+ Gibhub
+ Joomla Extension Directory
+
+
+
+ Astrid Günther
+
+
+
+
+ Leaflet.Facebook
+
+ Simple plugin for adding Facebook like button as a control.
+
+ Marcin Wasilewski
+
+
+
+
+ WP-Trip-Summary
+
+ A WordPress trip summary plugin to help travel bloggers manage and display structured information about their train rides and biking or hiking trips.
+
+ Alexandru Boia
+
+
+
+
+
+
+## Develop your own
+
+Leaflet keeps it simple. If you can think of a feature that is not required by all Leaflet users, and you can write the JavaScript code in a reusable way, you've got yourself a Leaflet plugin already.
+
+There are no hard requirements on how to create your own plugin, but all developers are encouraged to read the recommendations in the [plugin guide](https://github.com/Leaflet/Leaflet/blob/master/PLUGIN-GUIDE.md).
+
+Once your plugin is ready, you can submit it to this list: just send a pull request with the addition to [/docs/plugins.md](https://github.com/Leaflet/Leaflet/blob/master/docs/plugins.md) to our GitHub repository.
diff --git a/src/public/Leaflet-1.7.1/docs/reference-0.7.7.html b/src/public/Leaflet-1.7.1/docs/reference-0.7.7.html
new file mode 100644
index 0000000..b0ef93f
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/reference-0.7.7.html
@@ -0,0 +1,6424 @@
+---
+layout: v2
+title: Documentation
+bodyclass: api-page
+---
+
+
API Reference
+
+
This reference reflects Leaflet 0.7.x . Check this list if you are using a different version of Leaflet.
+
+
+
+
Map
+
+
Map Methods
+
+
Map Misc
+
+
+
+
UI Layers
+
+
Raster Layers
+
+
Vector Layers
+
+
+
+
Other Layers
+
+
Basic Types
+
+
Controls
+
+
+
+
Events
+
+
Utility
+
+
DOM Utility
+
+
+
+
Interfaces
+
+
+
Misc
+
+
+
+
+
+
+
+
+
Map
+
+
The central class of the API — it is used to create a map on a page and manipulate it.
+
+
Usage example
+
+
// initialize the map on the "map" div with a given center and zoom
+var map = L.map('map', {
+ center: [51.505, -0.09],
+ zoom: 13
+});
+
+
Creation
+
+
+
+ Factory
+ Description
+
+
+ L.map (
+ <HTMLElement|String> id ,
+ <Map options > options? )
+
+
+
+ Instantiates a map object given a div element (or its id) and optionally an object literal with map options described below.
+
+
+
+
+
+
+
Options
+
+
Map State Options
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+ center
+ LatLng
+ null
+ Initial geographical center of the map.
+
+
+ zoom
+ Number
+ null
+ Initial map zoom.
+
+
+ layers
+ ILayer []
+ null
+ Layers that will be added to the map initially.
+
+
+ minZoom
+ Number
+ null
+ Minimum zoom level of the map. Overrides any minZoom set on map layers.
+
+
+ maxZoom
+ Number
+ null
+ Maximum zoom level of the map. This overrides any maxZoom set on map layers.
+
+
+ maxBounds
+ LatLngBounds
+ null
+ When this option is set, the map restricts the view to the given geographical bounds, bouncing the user back when they try to pan outside the view. To set the restriction dynamically, use setMaxBounds method.
+
+
+ crs
+ CRS
+ L.CRS. EPSG3857
+ Coordinate Reference System to use. Don't change this if you're not sure what it means.
+
+
+
+
Interaction Options
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+ dragging
+ Boolean
+ true
+ Whether the map be draggable with mouse/touch or not.
+
+
+ touchZoom
+ Boolean
+ true
+ Whether the map can be zoomed by touch-dragging with two fingers.
+
+
+ scrollWheelZoom
+ Boolean
+ true
+ Whether the map can be zoomed by using the mouse wheel. If passed 'center' , it will zoom to the center of the view regardless of where the mouse was.
+
+
+ doubleClickZoom
+ Boolean
+ true
+ Whether the map can be zoomed in by double clicking on it and zoomed out by double clicking while holding shift. If passed 'center' , double-click zoom will zoom to the center of the view regardless of where the mouse was.
+
+
+ boxZoom
+ Boolean
+ true
+ Whether the map can be zoomed to a rectangular area specified by dragging the mouse while pressing shift.
+
+
+ tap
+ Boolean
+ true
+ Enables mobile hacks for supporting instant taps (fixing 200ms click delay on iOS/Android) and touch holds (fired as contextmenu events).
+
+
+ tapTolerance
+ Number
+ 15
+ The max number of pixels a user can shift his finger during touch for it to be considered a valid tap.
+
+
+ trackResize
+ Boolean
+ true
+ Whether the map automatically handles browser window resize to update itself.
+
+
+ worldCopyJump
+ Boolean
+ false
+ With this option enabled, the map tracks when you pan to another "copy" of the world and seamlessly jumps to the original one so that all overlays like markers and vector layers are still visible.
+
+
+ closePopupOnClick
+ Boolean
+ true
+ Set it to false if you don't want popups to close when user clicks the map.
+
+
+ bounceAtZoomLimits
+ Boolean
+ true
+ Set it to false if you don't want the map to zoom beyond min/max zoom and then bounce back when pinch-zooming.
+
+
+
+
Keyboard Navigation Options
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+ keyboard
+ Boolean
+ true
+ Makes the map focusable and allows users to navigate the map with keyboard arrows and +/- keys.
+
+
+ keyboardPanOffset
+ Number
+ 80
+ Amount of pixels to pan when pressing an arrow key.
+
+
+ keyboardZoomOffset
+ Number
+ 1
+ Number of zoom levels to change when pressing + or - key.
+
+
+
+
Panning Inertia Options
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+ inertia
+ Boolean
+ true
+ If enabled, panning of the map will have an inertia effect where the map builds momentum while dragging and continues moving in the same direction for some time. Feels especially nice on touch devices.
+
+
+ inertiaDeceleration
+ Number
+ 3000
+ The rate with which the inertial movement slows down, in pixels/second2 .
+
+
+ inertiaMaxSpeed
+ Number
+ 1500
+ Max speed of the inertial movement, in pixels/second.
+
+
+ inertiaThreshold
+ Number
+ depends
+ Number of milliseconds that should pass between stopping the movement and releasing the mouse or touch to prevent inertial movement. 32 for touch devices and 14 for the rest by default.
+
+
+
+
Control options
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+ zoomControl
+ Boolean
+ true
+ Whether the zoom control is added to the map by default.
+
+
+ attributionControl
+ Boolean
+ true
+ Whether the attribution control is added to the map by default.
+
+
+
+
Animation options
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+ fadeAnimation
+ Boolean
+ depends
+ Whether the tile fade animation is enabled. By default it's enabled in all browsers that support CSS3 Transitions except Android.
+
+
+ zoomAnimation
+ Boolean
+ depends
+ Whether the tile zoom animation is enabled. By default it's enabled in all browsers that support CSS3 Transitions except Android.
+
+
+ zoomAnimationThreshold
+ Number
+ 4
+ Won't animate zoom if the zoom difference exceeds this value.
+
+
+ markerZoomAnimation
+ Boolean
+ depends
+ Whether markers animate their zoom with the zoom animation, if disabled they will disappear for the length of the animation. By default it's enabled in all browsers that support CSS3 Transitions except Android.
+
+
+
+
+
Events
+
+
You can subscribe to the following events using these methods .
+
+
+
+ Event
+ Data
+ Description
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the map.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the map.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the map.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button on the map.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the map.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the map.
+
+
+ mousemove
+ MouseEvent
+ Fired while the mouse moves over the map.
+
+
+ contextmenu
+ MouseEvent
+ Fired when the user pushes the right mouse button on the map, prevents default browser context menu from showing if there are listeners on this event. Also fired on mobile when the user holds a single touch for a second (also called long press).
+
+
+ focus
+ Event
+ Fired when the user focuses the map either by tabbing to it or clicking/panning.
+
+
+ blur
+ Event
+ Fired when the map loses focus.
+
+
+ preclick
+ MouseEvent
+ Fired before mouse click on the map (sometimes useful when you want something to happen on click before any existing click handlers start running).
+
+
+ load
+ Event
+ Fired when the map is initialized (when its center and zoom are set for the first time).
+
+
+ unload
+ Event
+ Fired when the map is destroyed with remove method.
+
+
+ viewreset
+ Event
+ Fired when the map needs to redraw its content (this usually happens on map zoom or load). Very useful for creating custom overlays.
+
+
+ movestart
+ Event
+ Fired when the view of the map starts changing (e.g. user starts dragging the map).
+
+
+ move
+ Event
+ Fired on any movement of the map view.
+
+
+ moveend
+ Event
+ Fired when the view of the map stops changing (e.g. user stopped dragging the map).
+
+
+ dragstart
+ Event
+ Fired when the user starts dragging the map.
+
+
+ drag
+ Event
+ Fired repeatedly while the user drags the map.
+
+
+ dragend
+ DragEndEvent
+ Fired when the user stops dragging the map.
+
+
+ zoomstart
+ Event
+ Fired when the map zoom is about to change (e.g. before zoom animation).
+
+
+ zoomend
+ Event
+ Fired when the map zoom changes.
+
+
+ zoomlevelschange
+ Event
+ Fired when the number of zoomlevels on the map is changed due to adding or removing a layer.
+
+
+ resize
+ ResizeEvent
+ Fired when the map is resized.
+
+
+ autopanstart
+ Event
+ Fired when the map starts autopanning when opening a popup.
+
+
+ layeradd
+ LayerEvent
+ Fired when a new layer is added to the map.
+
+
+ layerremove
+ LayerEvent
+ Fired when some layer is removed from the map.
+
+
+ baselayerchange
+ LayerEvent
+ Fired when the base layer is changed through the layer control .
+
+
+ overlayadd
+ LayerEvent
+ Fired when an overlay is selected through the layer control .
+
+
+ overlayremove
+ LayerEvent
+ Fired when an overlay is deselected through the layer control .
+
+
+ locationfound
+ LocationEvent
+ Fired when geolocation (using the locate method) went successfully.
+
+
+ locationerror
+ ErrorEvent
+ Fired when geolocation (using the locate method) failed.
+
+
+ popupopen
+ PopupEvent
+ Fired when a popup is opened (using openPopup method).
+
+
+ popupclose
+ PopupEvent
+ Fired when a popup is closed (using closePopup method).
+
+
+
+
+
Methods for Modifying Map State
+
+
+
+ Method
+ Returns
+ Description
+
+
+ setView (
+ <LatLng > center ,
+ <Number> zoom? ,
+ <zoom/pan options > options? )
+
+ this
+ Sets the view of the map (geographical center and zoom) with the given animation options.
+
+
+ setZoom (
+ <Number> zoom ,
+ <zoom options > options? )
+
+ this
+ Sets the zoom of the map.
+
+
+ zoomIn (
+ <Number> delta? ,
+ <zoom options > options? )
+
+ this
+ Increases the zoom of the map by delta (1 by default).
+
+
+ zoomOut (
+ <Number> delta? ,
+ <zoom options > options? )
+
+ this
+ Decreases the zoom of the map by delta (1 by default).
+
+
+ setZoomAround (
+ <LatLng > latlng ,
+ <Number> zoom ,
+ <zoom options > options? )
+
+ this
+ Zooms the map while keeping a specified point on the map stationary (e.g. used internally for scroll zoom and double-click zoom).
+
+
+ fitBounds (
+ <LatLngBounds > bounds ,
+ <fitBounds options > options? )
+
+ this
+ Sets a map view that contains the given geographical bounds with the maximum zoom level possible.
+
+
+ fitWorld (
+ <fitBounds options > options? )
+
+ this
+ Sets a map view that mostly contains the whole world with the maximum zoom level possible.
+
+
+ panTo (
+ <LatLng > latlng ,
+ <pan options > options? )
+
+ this
+ Pans the map to a given center. Makes an animated pan if new center is not more than one screen away from the current one.
+
+
+ panInsideBounds (
+ <LatLngBounds > bounds ,
+ <pan options > options? )
+
+ this
+ Pans the map to the closest view that would lie inside the given bounds (if it's not already), controlling the animation using the options specific, if any.
+
+
+ panBy (
+ <Point > point ,
+ <pan options > options? )
+
+ this
+ Pans the map by a given number of pixels (animated).
+
+
+ invalidateSize (
+ <Boolean> animate )
+
+ this
+ Checks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically, also animating pan by default.
+
+
+ invalidateSize (
+ <zoom/pan options > options )
+
+ this
+ Checks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically, also animating pan by default. If options.pan is false , panning will not occur. If options.debounceMoveend is true , it will delay moveend event so that it doesn't happen often even if the method is called many times in a row.
+
+
+ setMaxBounds (
+ <LatLngBounds > bounds
+
+ this
+ Restricts the map view to the given bounds (see map maxBounds option).
+
+
+ locate (
+ <Locate options > options? )
+
+ this
+ Tries to locate the user using the Geolocation API , firing a locationfound event with location data on success or a locationerror event on failure, and optionally sets the map view to the user's location with respect to detection accuracy (or to the world view if geolocation failed). See Locate options for more details.
+
+
+ stopLocate ()
+ this
+ Stops watching location previously initiated by map.locate ({watch: true}) and aborts resetting the map view if map.locate was called with {setView: true}.
+
+
+ remove ()
+ this
+ Destroys the map and clears all related event listeners.
+
+
+
+
Methods for Getting Map State
+
+
+
+ Method
+ Returns
+ Description
+
+
+ getCenter ()
+ LatLng
+ Returns the geographical center of the map view.
+
+
+ getZoom ()
+ Number
+ Returns the current zoom of the map view.
+
+
+ getMinZoom ()
+ Number
+ Returns the minimum zoom level of the map.
+
+
+ getMaxZoom ()
+ Number
+ Returns the maximum zoom level of the map.
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the current map view.
+
+
+ getBoundsZoom (
+ <LatLngBounds > bounds ,
+ <Boolean> inside? )
+
+
+ Number
+
+ Returns the maximum zoom level on which the given bounds fit to the map view in its entirety. If inside (optional) is set to true , the method instead returns the minimum zoom level on which the map view fits into the given bounds in its entirety.
+
+
+ getSize ()
+ Point
+ Returns the current size of the map container.
+
+
+ getPixelBounds ()
+ Bounds
+ Returns the bounds of the current map view in projected pixel coordinates (sometimes useful in layer and overlay implementations).
+
+
+ getPixelOrigin ()
+ Point
+ Returns the projected pixel coordinates of the top left point of the map layer (useful in custom layer and overlay implementations).
+
+
+
+
Methods for Layers and Controls
+
+
+
+ Method
+ Returns
+ Description
+
+
+ addLayer (
+ <ILayer > layer )
+
+
+ this
+ Adds the given layer to the map.
+
+
+ removeLayer (
+ <ILayer > layer )
+
+
+ this
+ Removes the given layer from the map.
+
+
+ hasLayer (
+ <ILayer > layer )
+
+
+ Boolean
+ Returns true if the given layer is currently added to the map.
+
+
+ eachLayer (
+ <Function> fn ,
+ <Object> context? )
+
+ this
+ Iterates over the layers of the map, optionally specifying context of the iterator function.
+map.eachLayer(function (layer) {
+ layer.bindPopup('Hello');
+});
+
+
+
+
+
+
+
+ addControl (
+ <IControl > control )
+
+
+ this
+ Adds the given control to the map.
+
+
+ removeControl (
+ <IControl > control )
+
+
+ this
+ Removes the given control from the map.
+
+
+
+
+
Conversion Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ latLngToLayerPoint (
+ <LatLng > latlng )
+
+
+ Point
+ Returns the map layer point that corresponds to the given geographical coordinates (useful for placing overlays on the map).
+
+
+ layerPointToLatLng (
+ <Point > point )
+
+
+ LatLng
+ Returns the geographical coordinates of a given map layer point.
+
+
+ containerPointToLayerPoint (
+ <Point > point )
+
+
+ Point
+ Converts the point relative to the map container to a point relative to the map layer.
+
+
+ layerPointToContainerPoint (
+ <Point > point )
+
+
+ Point
+ Converts the point relative to the map layer to a point relative to the map container.
+
+
+ latLngToContainerPoint (
+ <LatLng > latlng )
+
+
+ Point
+ Returns the map container point that corresponds to the given geographical coordinates.
+
+
+ containerPointToLatLng (
+ <Point > point )
+
+
+ LatLng
+ Returns the geographical coordinates of a given map container point.
+
+
+ project (
+ <LatLng > latlng ,
+ <Number> zoom? )
+
+
+ Point
+ Projects the given geographical coordinates to absolute pixel coordinates for the given zoom level (current zoom level by default).
+
+
+ unproject (
+ <Point > point ,
+ <Number> zoom? )
+
+
+ LatLng
+ Projects the given absolute pixel coordinates to geographical coordinates for the given zoom level (current zoom level by default).
+
+
+ mouseEventToContainerPoint (
+ <MouseEvent> event )
+
+
+ Point
+ Returns the pixel coordinates of a mouse click (relative to the top left corner of the map) given its event object.
+
+
+ mouseEventToLayerPoint (
+ <MouseEvent> event )
+
+
+ Point
+ Returns the pixel coordinates of a mouse click relative to the map layer given its event object.
+
+
+ mouseEventToLatLng (
+ <MouseEvent> event )
+
+
+ LatLng
+ Returns the geographical coordinates of the point the mouse clicked on given the click's event object.
+
+
+
+
Other Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ getContainer ()
+ HTMLElement
+ Returns the container element of the map.
+
+
+ getPanes ()
+ MapPanes
+ Returns an object with different map panes (to render overlays in).
+
+
+ whenReady (
+ <Function> fn ,
+ <Object> context? )
+ this
+ Runs the given callback when the map gets initialized with a place and zoom, or immediately if it happened already, optionally passing a function context.
+
+
+
+
Locate options
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+ watch
+ Boolean
+ false
+ If true , starts continuous watching of location changes (instead of detecting it once) using W3C watchPosition method. You can later stop watching using map.stopLocate () method.
+
+
+ setView
+ Boolean
+ false
+ If true , automatically sets the map view to the user location with respect to detection accuracy, or to world view if geolocation failed.
+
+
+ maxZoom
+ Number
+ Infinity
+ The maximum zoom for automatic view setting when using `setView` option.
+
+
+ timeout
+ Number
+ 10000
+ Number of milliseconds to wait for a response from geolocation before firing a locationerror event.
+
+
+ maximumAge
+ Number
+ 0
+ Maximum age of detected location. If less than this amount of milliseconds passed since last geolocation response, locate will return a cached location.
+
+
+ enableHighAccuracy
+ Boolean
+ false
+ Enables high accuracy, see description in the W3C spec .
+
+
+
+
+
Zoom/pan options
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+ reset
+ Boolean
+ false
+ If true , the map view will be completely reset (without any animations).
+
+
+ pan
+ pan options
+ -
+ Sets the options for the panning (without the zoom change) if it occurs.
+
+
+ zoom
+ zoom options
+ -
+ Sets the options for the zoom change if it occurs.
+
+
+ animate
+ Boolean
+ -
+ An equivalent of passing animate to both zoom and pan options (see below).
+
+
+
+
Pan options
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+ animate
+ Boolean
+ -
+ If true , panning will always be animated if possible. If false , it will not animate panning, either resetting the map view if panning more than a screen away, or just setting a new offset for the map pane (except for `panBy` which always does the latter).
+
+
+ duration
+ Number
+ 0.25
+ Duration of animated panning.
+
+
+ easeLinearity
+ Number
+ 0.25
+ The curvature factor of panning animation easing (third parameter of the Cubic Bezier curve ). 1.0 means linear animation, the less the more bowed the curve.
+
+
+ noMoveStart
+ Boolean
+ false
+ If true , panning won't fire movestart event on start (used internally for panning inertia).
+
+
+
+
Zoom options
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+ animate
+ Boolean
+ -
+ If not specified, zoom animation will happen if the zoom origin is inside the current view. If true , the map will attempt animating zoom disregarding where zoom origin is. Setting false will make it always reset the view completely without animation.
+
+
+
+
fitBounds options
+
+
The same as zoom/pan options and additionally:
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+ paddingTopLeft
+ Point
+ [0 , 0 ]
+ Sets the amount of padding in the top left corner of a map container that shouldn't be accounted for when setting the view to fit bounds. Useful if you have some control overlays on the map like a sidebar and you don't want them to obscure objects you're zooming to.
+
+
+ paddingBottomRight
+ Point
+ [0 , 0 ]
+ The same for bottom right corner of the map.
+
+
+ padding
+ Point
+ [0 , 0 ]
+ Equivalent of setting both top left and bottom right padding to the same value.
+
+
+ maxZoom
+ Number
+ null
+ The maximum possible zoom to use.
+
+
+
+
+
Properties
+
+
Map properties include interaction handlers that allow you to control interaction behavior in runtime, enabling or disabling certain features such as dragging or touch zoom (see IHandler methods). Example:
+
+
map.doubleClickZoom.disable();
+
+
You can also access default map controls like attribution control through map properties:
+
+
map.attributionControl.addAttribution("Earthquake data © GeoNames");
+
+
+
+ Property
+ Type
+ Description
+
+
+ dragging
+ IHandler
+ Map dragging handler (by both mouse and touch).
+
+
+ touchZoom
+ IHandler
+ Touch zoom handler.
+
+
+ doubleClickZoom
+ IHandler
+ Double click zoom handler.
+
+
+ scrollWheelZoom
+ IHandler
+ Scroll wheel zoom handler.
+
+
+ boxZoom
+ IHandler
+ Box (shift-drag with mouse) zoom handler.
+
+
+ keyboard
+ IHandler
+ Keyboard navigation handler.
+
+
+ tap
+ IHandler
+ Mobile touch hacks (quick tap and touch hold) handler.
+
+
+ zoomControl
+ Control.Zoom
+ Zoom control.
+
+
+ attributionControl
+ Control.Attribution
+ Attribution control.
+
+
+
+
+
Map Panes
+
+
An object literal (returned by map.getPanes ) that contains different map panes that you can use to put your custom overlays in. The difference is mostly in zIndex order that such overlays get.
+
+
+
+ Property
+ Type
+ Description
+
+
+ mapPane
+ HTMLElement
+ Pane that contains all other map panes.
+
+
+ tilePane
+ HTMLElement
+ Pane for tile layers.
+
+
+ objectsPane
+ HTMLElement
+ Pane that contains all the panes except tile pane.
+
+
+ shadowPane
+ HTMLElement
+ Pane for overlay shadows (e.g. marker shadows).
+
+
+ overlayPane
+ HTMLElement
+ Pane for overlays like polylines and polygons.
+
+
+ markerPane
+ HTMLElement
+ Pane for marker icons.
+
+
+ popupPane
+ HTMLElement
+ Pane for popups.
+
+
+
+
+
Marker
+
+
Used to put markers on the map.
+
+
L.marker([50.5, 30.5]).addTo(map);
+
+
Creation
+
+
+
+ Factory
+
+ Description
+
+
+ L.marker (
+ <LatLng > latlng ,
+ <Marker options > options? )
+
+
+ Instantiates a Marker object given a geographical point and optionally an options object.
+
+
+
+
Options
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+ icon
+ L.Icon
+ *
+ Icon class to use for rendering the marker. See Icon documentation for details on how to customize the marker icon. Set to new L.Icon.Default() by default.
+
+
+ clickable
+ Boolean
+ true
+ If false , the marker will not emit mouse events and will act as a part of the underlying map.
+
+
+ draggable
+ Boolean
+ false
+ Whether the marker is draggable with mouse/touch or not.
+
+
+ keyboard
+ Boolean
+ true
+ Whether the marker can be tabbed to with a keyboard and clicked by pressing enter.
+
+
+ title
+ String
+ ''
+ Text for the browser tooltip that appear on marker hover (no tooltip by default).
+
+
+ alt
+ String
+ ''
+ Text for the alt attribute of the icon image (useful for accessibility).
+
+
+ zIndexOffset
+ Number
+ 0
+ By default, zIndex for the marker image is set automatically based on its latitude. Use this option if you want to put the marker on top of all others (or below), specifying a high value like 1000 (or high negative value, respectively).
+
+
+ opacity
+ Number
+ 1.0
+ The opacity of the marker.
+
+
+ riseOnHover
+ Boolean
+ false
+ If true , the marker will get on top of others when you hover the mouse over it.
+
+
+ riseOffset
+ Number
+ 250
+ The z-index offset used for the riseOnHover feature.
+
+
+
+
Events
+
+
You can subscribe to the following events using these methods .
+
+
+
+ Event
+ Data
+ Description
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the marker.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the marker.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the marker.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the marker.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the marker.
+
+
+ contextmenu
+ MouseEvent
+ Fired when the user right-clicks on the marker.
+
+
+ dragstart
+ Event
+ Fired when the user starts dragging the marker.
+
+
+ drag
+ Event
+ Fired repeatedly while the user drags the marker.
+
+
+ dragend
+ DragEndEvent
+ Fired when the user stops dragging the marker.
+
+
+ move
+ Event
+ Fired when the marker is moved via setLatLng. New coordinate include in event arguments.
+
+
+ add
+ Event
+ Fired when the marker is added to the map.
+
+
+ remove
+ Event
+ Fired when the marker is removed from the map.
+
+
+ popupopen
+ PopupEvent
+ Fired when a popup bound to the marker is open.
+
+
+ popupclose
+ PopupEvent
+ Fired when a popup bound to the marker is closed.
+
+
+
+
Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ addTo (
+ <Map > map )
+
+
+ this
+ Adds the marker to the map.
+
+
+ getLatLng ()
+ LatLng
+ Returns the current geographical position of the marker.
+
+
+ setLatLng (
+ <LatLng > latlng )
+
+
+ this
+ Changes the marker position to the given point.
+
+
+ setIcon (
+ <Icon > icon )
+
+
+ this
+ Changes the marker icon.
+
+
+ setZIndexOffset (
+ <Number> offset )
+
+
+ this
+ Changes the zIndex offset of the marker.
+
+
+ setOpacity (
+ <Number> opacity )
+
+ this
+ Changes the opacity of the marker.
+
+
+ update ()
+
+
+ this
+ Updates the marker position, useful if coordinates of its latLng object were changed directly.
+
+
+
+
+
+ getPopup ()
+ Popup
+ Returns the popup previously bound by the bindPopup method.
+
+
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the marker (GeoJSON Point Feature).
+
+
+
+
Interaction handlers
+
+
Interaction handlers are properties of a marker instance that allow you to control interaction behavior in runtime, enabling or disabling certain features such as dragging (see IHandler methods). Example:
+
+
marker.dragging.disable();
+
+
+
+ Property
+ Type
+ Description
+
+
+ dragging
+ IHandler
+ Marker dragging handler (by both mouse and touch).
+
+
+
+
+
+
+
+
Used to open popups in certain places of the map. Use Map#openPopup to open popups while making sure that only one popup is open at one time (recommended for usability), or use Map#addLayer to open as many as you want.
+
+
Usage example
+
If you want to just bind a popup to marker click and then open it, it's really easy:
+
marker.bindPopup(popupContent).openPopup();
+
Path overlays like polylines also have a bindPopup method. Here's a more complicated way to open a popup on a map:
+
+
var popup = L.popup()
+ .setLatLng(latlng)
+ .setContent('<p>Hello world!<br />This is a nice popup.</p>')
+ .openOn(map);
+
+
Creation
+
+
+
+ Factory
+
+ Description
+
+
+ L.popup (
+ <Popup options > options? ,
+ <ILayer > source? )
+
+
+
+ Instantiates a Popup object given an optional options object that describes its appearance and location and an optional source object that is used to tag the popup with a reference to the ILayer to which it refers.
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+ maxWidth
+ Number
+ 300
+ Max width of the popup.
+
+
+ minWidth
+ Number
+ 50
+ Min width of the popup.
+
+
+ maxHeight
+ Number
+ null
+ If set, creates a scrollable container of the given height inside a popup if its content exceeds it.
+
+
+ autoPan
+ Boolean
+ true
+ Set it to false if you don't want the map to do panning animation to fit the opened popup.
+
+
+ keepInView
+ Boolean
+ false
+ Set it to true if you want to prevent users from panning the popup off of the screen while it is open.
+
+
+ closeButton
+ Boolean
+ true
+ Controls the presence of a close button in the popup.
+
+
+ offset
+ Point
+ Point(0 , 6 )
+
+ The offset of the popup position. Useful to control the anchor of the popup when opening it on some overlays.
+
+
+ autoPanPaddingTopLeft
+ Point
+ null
+
+ The margin between the popup and the top left corner of the map view after autopanning was performed.
+
+
+ autoPanPaddingBottomRight
+ Point
+ null
+
+ The margin between the popup and the bottom right corner of the map view after autopanning was performed.
+
+
+ autoPanPadding
+ Point
+ Point(5 , 5 )
+
+ Equivalent of setting both top left and bottom right autopan padding to the same value.
+
+
+ zoomAnimation
+ Boolean
+ true
+ Whether to animate the popup on zoom. Disable it if you have problems with Flash content inside popups.
+
+
+ closeOnClick
+ Boolean
+ null
+ Set it to false if you want to override the default behavior of the popup closing when user clicks the map (set globally by the Map closePopupOnClick option).
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the popup.
+
+
+
+
Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ addTo (
+ <Map > map )
+
+
+ this
+ Adds the popup to the map.
+
+
+ openOn (
+ <Map > map )
+
+
+ this
+ Adds the popup to the map and closes the previous one. The same as map.openPopup(popup).
+
+
+ setLatLng (
+ <LatLng > latlng )
+
+
+ this
+ Sets the geographical point where the popup will open.
+
+
+ getLatLng ()
+ LatLng
+ Returns the geographical point of popup.
+
+
+ setContent (
+ <String|HTMLElement> htmlContent )
+
+
+ this
+ Sets the HTML content of the popup.
+
+
+ getContent ()
+ <String|HTMLElement>
+ Returns the content of the popup.
+
+
+ update ()
+
+ this
+ Updates the popup content, layout and position. Useful for updating the popup after something inside changed, e.g. image loaded.
+
+
+
+
+
+
TileLayer
+
+
Used to load and display tile layers on the map, implements ILayer interface.
+
+
Usage example
+
+
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png?{foo}', {foo: 'bar'}).addTo(map);
+
+
Creation
+
+
+
+ Factory
+
+ Description
+
+
+ L.tileLayer (
+ <String> urlTemplate ,
+ <TileLayer options > options? )
+
+
+
+ Instantiates a tile layer object given a URL template and optionally an options object.
+
+
+
+
URL template
+
+
A string of the following form:
+
+
'http://{s}.somedomain.com/blabla/{z}/{x}/{y}.png'
+
+
{s} means one of the available subdomains (used sequentially to help with browser parallel requests per domain limitation; subdomain values are specified in options; a, b or c by default, can be omitted), {z} — zoom level, {x} and {y} — tile coordinates.
+
+
You can use custom keys in the template, which will be evaluated from TileLayer options, like this:
+
+
L.tileLayer('http://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png', {foo: 'bar'});
+
+
Options
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+ minZoom
+ Number
+ 0
+ Minimum zoom number.
+
+
+ maxZoom
+ Number
+ 18
+ Maximum zoom number.
+
+
+ maxNativeZoom
+ Number
+ null
+ Maximum zoom number the tiles source has available. If it is specified, the tiles on all zoom levels higher than maxNativeZoom will be loaded from maxNativeZoom level and auto-scaled.
+
+
+ tileSize
+ Number
+ 256
+ Tile size (width and height in pixels, assuming tiles are square).
+
+
+ subdomains
+ String or String[]
+ 'abc'
+ Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.
+
+
+ errorTileUrl
+ String
+ ''
+ URL to the tile image to show in place of the tile that failed to load.
+
+
+ attribution
+ String
+ ''
+ e.g. "© Mapbox" — the string used by the attribution control, describes the layer data.
+
+
+ tms
+ Boolean
+ false
+ If true , inverses Y axis numbering for tiles (turn this on for TMS services).
+
+
+ continuousWorld
+ Boolean
+ false
+ If set to true , the tile coordinates won't be wrapped by world width (-180 to 180 longitude) or clamped to lie within world height (-90 to 90). Use this if you use Leaflet for maps that don't reflect the real world (e.g. game, indoor or photo maps).
+
+
+ noWrap
+ Boolean
+ false
+ If set to true , the tiles just won't load outside the world width (-180 to 180 longitude) instead of repeating.
+
+
+ zoomOffset
+ Number
+ 0
+ The zoom number used in tile URLs will be offset with this value.
+
+
+ zoomReverse
+ Boolean
+ false
+ If set to true , the zoom number used in tile URLs will be reversed (maxZoom - zoom instead of zoom).
+
+
+ opacity
+ Number
+ 1.0
+ The opacity of the tile layer.
+
+
+ zIndex
+ Number
+ null
+ The explicit zIndex of the tile layer. Not set by default.
+
+
+ unloadInvisibleTiles
+ Boolean
+ depends
+ If true , all the tiles that are not visible after panning are removed (for better performance). true by default on mobile WebKit, otherwise false .
+
+
+ updateWhenIdle
+ Boolean
+ depends
+ If false , new tiles are loaded during panning, otherwise only after it (for better performance). true by default on mobile WebKit, otherwise false .
+
+
+ detectRetina
+ Boolean
+ false
+ If true and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.
+
+
+ reuseTiles
+ Boolean
+ false
+ If true , all the tiles that are not visible after panning are placed in a reuse queue from which they will be fetched when new tiles become visible (as opposed to dynamically creating new ones). This will in theory keep memory usage low and eliminate the need for reserving new memory whenever a new tile is needed.
+
+
+ bounds
+ LatLngBounds
+ null
+ When this option is set, the TileLayer only loads tiles that are in the given geographical bounds.
+
+
+
+
Events
+
+
You can subscribe to the following events using these methods .
+
+
+
+ Event
+ Data
+ Description
+
+
+ loading
+ Event
+ Fired when the tile layer starts loading tiles.
+
+
+ load
+ Event
+ Fired when the tile layer loaded all visible tiles.
+
+
+ tileloadstart
+ TileEvent
+ Fired when a tile is requested and starts loading.
+
+
+ tileload
+ TileEvent
+ Fired when a tile loads.
+
+
+ tileunload
+ TileEvent
+ Fired when a tile is removed (e.g. when you have unloadInvisibleTiles on).
+
+
+ tileerror
+ TileEvent
+ Fired when there is an error loading a tile.
+
+
+
+
Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ addTo (
+ <Map > map )
+
+
+ this
+ Adds the layer to the map.
+
+
+ bringToFront ()
+ this
+ Brings the tile layer to the top of all tile layers.
+
+
+ bringToBack ()
+ this
+ Brings the tile layer to the bottom of all tile layers.
+
+
+ setOpacity (
+ <Number> opacity )
+
+
+ this
+ Changes the opacity of the tile layer.
+
+
+ setZIndex (
+ <Number> zIndex )
+
+
+ this
+ Sets the zIndex of the tile layer.
+
+
+ redraw ()
+ this
+ Causes the layer to clear all the tiles and request them again.
+
+
+ setUrl (
+ <String> urlTemplate )
+
+ this
+ Updates the layer's URL template and redraws it.
+
+
+ getContainer ()
+
+ HTMLElement
+ Returns the HTML element that contains the tiles for this layer.
+
+
+
+
+
+
TileLayer.WMS
+
+
Used to display WMS services as tile layers on the map. Extends TileLayer .
+
+
Usage example
+
+
var nexrad = L.tileLayer.wms("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi", {
+ layers: 'nexrad-n0r-900913',
+ format: 'image/png',
+ transparent: true,
+ attribution: "Weather data © 2012 IEM Nexrad"
+});
+
+
Creation
+
+
+
+ Factory
+
+ Description
+
+
+ L.tileLayer.wms (
+ <String> baseUrl ,
+ <TileLayer.WMS options > options )
+
+
+ Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object.
+
+
+
+
Options
+
+
Includes all TileLayer options and additionally:
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+ layers
+ String
+ ''
+ (required) Comma-separated list of WMS layers to show.
+
+
+ styles
+ String
+ ''
+ Comma-separated list of WMS styles.
+
+
+ format
+ String
+ 'image/jpeg'
+ WMS image format (use 'image/png' for layers with transparency).
+
+
+ transparent
+ Boolean
+ false
+ If true , the WMS service will return images with transparency.
+
+
+ version
+ String
+ '1.1.1'
+ Version of the WMS service to use.
+
+
+ crs
+ CRS
+ null
+ Coordinate Reference System to use for the WMS requests, defaults to map CRS. Don't change this if you're not sure what it means.
+
+
+
+
Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ setParams (
+ <WMS parameters > params ,
+ <Boolean> noRedraw? )
+
+ this
+ Merges an object with the new parameters and re-requests tiles on the current screen (unless noRedraw was set to true ).
+
+
+
+
+
TileLayer.Canvas
+
+
Used to create Canvas-based tile layers where tiles get drawn on the browser side. Extends TileLayer .
+
+
Usage example
+
+
var canvasTiles = L.tileLayer.canvas();
+
+canvasTiles.drawTile = function(canvas, tilePoint, zoom) {
+ var ctx = canvas.getContext('2d');
+ // draw something on the tile canvas
+}
+
+
Creation
+
+
+
+ Factory
+
+ Description
+
+
+ L.tileLayer.canvas (
+ <TileLayer options > options? )
+
+
+ Instantiates a Canvas tile layer object given an options object (optionally).
+
+
+
+
Options
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+ async
+ Boolean
+ false
+ Indicates that tiles will be drawn asynchronously. tileDrawn method should be called for each tile after drawing completion.
+
+
+
+
Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ drawTile (
+ <HTMLCanvasElement> canvas ,
+ <Point > tilePoint ,
+ <Number> zoom )
+
+ this
+ You need to define this method after creating the instance to draw tiles; canvas is the actual canvas tile on which you can draw, tilePoint represents the tile numbers, and zoom is the current zoom.
+
+
+ tileDrawn ( <HTMLCanvasElement> canvas )
+ -
+ If async option is defined, this function should be called for each tile after drawing completion. canvas is the same canvas element, that was passed to drawTile .
+
+
+
+
+
ImageOverlay
+
+
Used to load and display a single image over specific bounds of the map, implements ILayer interface.
+
+
Usage example
+
+
var imageUrl = 'http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg',
+ imageBounds = [[40.712216, -74.22655], [40.773941, -74.12544]];
+
+L.imageOverlay(imageUrl, imageBounds).addTo(map);
+
+
Creation
+
+
+
+ Factory
+
+ Description
+
+
+ L.ImageOverlay (
+ <String> imageUrl ,
+ <LatLngBounds > bounds ,
+ <ImageOverlay options > options? )
+
+
+
+ Instantiates an image overlay object given the URL of the image and the geographical bounds it is tied to.
+
+
+
+
Options
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+ opacity
+ Number
+ 1.0
+ The opacity of the image overlay.
+
+
+ attribution
+ String
+ ''
+ The attribution text of the image overlay.
+
+
+
+
Methods
+
+
+ Method
+ Returns
+ Description
+
+
+ addTo (
+ <Map > map )
+
+
+ this
+ Adds the overlay to the map.
+
+
+ setOpacity (
+ <Number> opacity )
+
+
+ this
+ Sets the opacity of the overlay.
+
+
+ setUrl (
+ <String> imageUrl )
+
+
+ this
+ Changes the URL of the image.
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all overlays.
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all overlays.
+
+
+
+
+
Path
+
An abstract class that contains options and constants shared between vector overlays (Polygon, Polyline, Circle). Do not use it directly.
+
+
Options
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#03f'
+ Stroke color.
+
+
+ weight
+ Number
+ 5
+ Stroke width in pixels.
+
+
+ opacity
+ Number
+ 0.5
+ Stroke opacity.
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ same as color
+ Fill color.
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on canvas-powered layers (e.g. Android 2).
+
+
+ lineCap
+ String
+ null
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ null
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ clickable
+ Boolean
+ true
+ If false , the vector will not emit mouse events and will act as a part of the underlying map.
+
+
+ pointerEvents
+ String
+ null
+ Sets the pointer-events attribute on the path if SVG backend is used.
+
+
+ className
+ String
+ ''
+ Custom class name set on an element.
+
+
+
+
Events
+
+
You can subscribe to the following events using these methods .
+
+
+
+ Event
+ Data
+ Description
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the object.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the object.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the object.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the object.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the object.
+
+
+ contextmenu
+ MouseEvent
+ Fired when the user pushes the right mouse button on the object, prevents default browser context menu from showing if there are listeners on this event.
+
+
+ add
+ Event
+ Fired when the path is added to the map.
+
+
+ remove
+ Event
+ Fired when the path is removed from the map.
+
+
+ popupopen
+ PopupEvent
+ Fired when a popup bound to the path is open.
+
+
+ popupclose
+ PopupEvent
+ Fired when a popup bound to the path is closed.
+
+
+
+
Methods
+
+
+ Method
+ Returns
+ Description
+
+
+ addTo (
+ <Map > map )
+
+
+ this
+ Adds the layer to the map.
+
+
+
+ bindPopup (
+ <Popup > popup ,
+ <Popup options > options? )
+
+
+ this
+ Binds a given popup object to the path.
+
+
+
+
+
+ setStyle (
+ <Path options > object )
+
+
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the path.
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+
Static properties
+
+
+ Constant
+ Type
+ Value
+ Description
+
+
+ SVG
+ Boolean
+ depends
+ True if SVG is used for vector rendering (true for most modern browsers).
+
+
+ VML
+ Boolean
+ depends
+ True if VML is used for vector rendering (IE 6-8).
+
+
+ CANVAS
+ Boolean
+ depends
+ True if Canvas is used for vector rendering (Android 2). You can also force this by setting global variable L_PREFER_CANVAS to true before the Leaflet include on your page — sometimes it can increase performance dramatically when rendering thousands of circle markers, but currently suffers from a bug that causes removing such layers to be extremely slow.
+
+
+ CLIP_PADDING
+ Number
+ 0.5 for SVG0.02 for VML
+ How much to extend the clip area around the map view (relative to its size, e.g. 0.5 is half the screen in each direction). Smaller values mean that you will see clipped ends of paths while you're dragging the map, and bigger values decrease drawing performance.
+
+
+
+
+
Polyline
+
+
A class for drawing polyline overlays on a map. Extends Path . Use Map#addLayer to add it to the map.
+
+
Usage example
+
// create a red polyline from an array of LatLng points
+var polyline = L.polyline(latlngs, {color: 'red'}).addTo(map);
+
+// zoom the map to the polyline
+map.fitBounds(polyline.getBounds());
+
+
Creation
+
+
+
+ Factory
+
+ Description
+
+
+ L.polyline (
+ <LatLng []> latlngs ,
+ <Polyline options > options? )
+
+
+
+ Instantiates a polyline object given an array of geographical points and optionally an options object.
+
+
+
+
Options
+
+
You can use Path options and additionally the following options:
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+ smoothFactor
+ Number
+ 1.0
+ How much to simplify the polyline on each zoom level. More means better performance and smoother look, and less means more accurate representation.
+
+
+ noClip
+ Boolean
+ false
+ Disabled polyline clipping.
+
+
+
+
Methods
+
+
You can use Path methods and additionally the following methods:
+
+
+
+ Method
+ Returns
+ Description
+
+
+ addLatLng (
+ <LatLng > latlng )
+
+
+ this
+ Adds a given point to the polyline.
+
+
+ setLatLngs (
+ <LatLng []> latlngs )
+
+
+ this
+ Replaces all the points in the polyline with the given array of geographical points.
+
+
+ getLatLngs ()
+ LatLng []
+ Returns an array of the points in the path.
+
+
+ spliceLatLngs (
+ <Number> index ,
+ <Number> pointsToRemove ,
+ <LatLng > latlng? , … )
+
+
+ LatLng []
+ Allows adding, removing or replacing points in the polyline. Syntax is the same as in Array#splice . Returns the array of removed points (if any).
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the polyline.
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the polyline (GeoJSON LineString Feature).
+
+
+
+
+
+
MultiPolyline
+
+
Extends FeatureGroup to allow creating multi-polylines (single layer that consists of several polylines that share styling/popup).
+
+
Creation
+
+
+
+ Factory
+
+ Description
+
+
+ L.multiPolyline (
+ <LatLng [][]> latlngs ,
+ <Polyline options > options? )
+
+
+
+
+ Instantiates a multi-polyline object given an array of arrays of geographical points (one for each individual polyline) and optionally an options object.
+
+
+
+
+
Methods
+
+
MultiPolylines accept all Polyline methods but
+have different behavior around their coordinate contents since they can contain
+multiple line features:
+
+
+
+ Method
+ Returns
+ Description
+
+
+ setLatLngs (
+ <LatLng [][]> latlngs )
+
+
+ this
+ Replace all lines and their paths with the given array of arrays of
+ geographical points.
+
+
+ getLatLngs ()
+
+ <LatLng [][]> latlngs
+
+ Returns an array of arrays of geographical points in each line.
+
+
+ openPopup ()
+
+ this
+ Opens the popup previously bound by bindPopup .
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the multipolyline (GeoJSON MultiLineString Feature).
+
+
+
+
+
+
Polygon
+
+
A class for drawing polygon overlays on a map. Extends Polyline . Use Map#addLayer to add it to the map.
+
+
Note that points you pass when creating a polygon shouldn't have an additional last point equal to the first one — it's better to filter out such points.
+
+
Creation
+
+
+
+ Factory
+
+ Description
+
+
+ L.polygon (
+ <LatLng []> latlngs ,
+ <Polyline options > options? )
+
+
+
+ Instantiates a polygon object given an array of geographical points and optionally an options object (the same as for Polyline). You can also create a polygon with holes by passing an array of arrays of latlngs, with the first latlngs array representing the exterior ring while the remaining represent the holes inside.
+
+
+
+
Methods
+
+
Polygon has the same options and methods as Polyline, with the following differences:
+
+
+
+ Method
+ Returns
+ Description
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the polygon (GeoJSON Polygon Feature).
+
+
+
+
+
MultiPolygon
+
+
Extends FeatureGroup to allow creating multi-polygons (single layer that consists of several polygons that share styling/popup).
+
+
Creation
+
+
+
+ Factory
+
+ Description
+
+
+ L.multiPolygon (
+ <LatLng [][]> latlngs ,
+ <Polyline options > options? )
+
+
+
+ Instantiates a multi-polygon object given an array of latlngs arrays (one for each individual polygon) and optionally an options object (the same as for MultiPolyline).
+
+
+
+
Methods
+
+
MultiPolygons accept all Polyline methods but
+have different behavior around their coordinate contents since they can contain
+multiple polygon features:
+
+
+
+ Method
+ Returns
+ Description
+
+
+ setLatLngs (
+ <LatLng [][]> latlngs )
+
+
+ this
+ Replace all polygons and their paths with the given array of arrays of
+ geographical points.
+
+
+ getLatLngs ()
+
+ <LatLng [][]> latlngs
+
+ Returns an array of arrays of geographical points in each polygon.
+
+
+ openPopup ()
+
+ this
+ Opens the popup previously bound by bindPopup .
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the multipolygon (GeoJSON MultiPolygon Feature).
+
+
+
+
Rectangle
+
+
A class for drawing rectangle overlays on a map. Extends Polygon . Use Map#addLayer to add it to the map.
+
+
Usage example
+
// define rectangle geographical bounds
+var bounds = [[54.559322, -5.767822], [56.1210604, -3.021240]];
+
+// create an orange rectangle
+L.rectangle(bounds, {color: "#ff7800", weight: 1}).addTo(map);
+
+// zoom the map to the rectangle bounds
+map.fitBounds(bounds);
+
+
Creation
+
+
+
+ Factory
+
+ Description
+
+
+ L.rectangle (
+ <LatLngBounds > bounds ,
+ <Path options > options? )
+
+
+
+ Instantiates a rectangle object with the given geographical bounds and optionally an options object.
+
+
+
+
Methods
+
+
You can use Path methods and additionally the following methods:
+
+
+
+ Method
+ Returns
+ Description
+
+
+ setBounds (
+ <LatLngBounds > bounds )
+
+
+ this
+ Redraws the rectangle with the passed bounds.
+
+
+
+
+
Circle
+
+
A class for drawing circle overlays on a map. Extends Path . Use Map#addLayer to add it to the map.
+
+
L.circle([50.5, 30.5], 200).addTo(map);
+
+
Creation
+
+
+
+ Factory
+
+ Description
+
+
+ L.circle (
+ <LatLng > latlng ,
+ <Number> radius ,
+ <Path options > options? )
+
+
+
+ Instantiates a circle object given a geographical point, a radius in meters and optionally an options object.
+
+
+
+
Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ getLatLng ()
+ LatLng
+ Returns the current geographical position of the circle.
+
+
+ getRadius ()
+ Number
+ Returns the current radius of a circle. Units are in meters.
+
+
+ setLatLng (
+ <LatLng > latlng )
+
+
+ this
+ Sets the position of a circle to a new location.
+
+
+ setRadius (
+ <Number> radius )
+
+
+ this
+ Sets the radius of a circle. Units are in meters.
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the circle (GeoJSON Point Feature).
+
+
+
+
+
+
CircleMarker
+
+
A circle of a fixed size with radius specified in pixels. Extends Circle . Use Map#addLayer to add it to the map.
+
+
Creation
+
+
+
+ Factory
+
+ Description
+
+
+ L.circleMarker (
+ <LatLng > latlng ,
+ <Path options > options? )
+
+
+
+ Instantiates a circle marker given a geographical point and optionally an options object. The default radius is 10 and can be altered by passing a "radius" member in the path options object.
+
+
+
+
Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ setLatLng (
+ <LatLng > latlng )
+
+
+ this
+ Sets the position of a circle marker to a new location.
+
+
+ setRadius (
+ <Number> radius )
+
+
+ this
+ Sets the radius of a circle marker. Units are in pixels.
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the circle marker (GeoJSON Point Feature).
+
+
+
+
+
+
LayerGroup
+
+
Used to group several layers and handle them as one. If you add it to the map, any layers added or removed from the group will be added/removed on the map as well. Implements ILayer interface.
+
+
L.layerGroup([marker1, marker2])
+ .addLayer(polyline)
+ .addTo(map);
+
+
Creation
+
+
+
+ Factory
+ Description
+
+
+ L.layerGroup (
+ <ILayer []> layers? )
+
+
+
+ Create a layer group, optionally given an initial set of layers.
+
+
+
+
Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ addTo (
+ <Map > map )
+
+
+ this
+ Adds the group of layers to the map.
+
+
+ addLayer (
+ <ILayer > layer )
+
+
+ this
+ Adds a given layer to the group.
+
+
+ removeLayer (
+ <ILayer > layer )
+
+
+ this
+ Removes a given layer from the group.
+
+
+ removeLayer (
+ <String> id )
+
+
+ this
+ Removes a given layer of the given id from the group.
+
+
+ hasLayer (
+ <ILayer > layer )
+
+
+ Boolean
+ Returns true if the given layer is currently added to the group.
+
+
+ getLayer (
+ <String> id )
+
+
+ ILayer
+ Returns the layer with the given id.
+
+
+ getLayers ()
+ Array
+ Returns an array of all the layers added to the group.
+
+
+ clearLayers ()
+ this
+ Removes all the layers from the group.
+
+
+ eachLayer (
+ <Function> fn ,
+ <Object> context? )
+
+ this
+ Iterates over the layers of the group, optionally specifying context of the iterator function.
+group.eachLayer(function (layer) {
+ layer.bindPopup('Hello');
+});
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the layer group (GeoJSON FeatureCollection).
+
+
+
+
+
+
FeatureGroup
+
+
Extended layerGroup that also has mouse events (propagated from members of the group) and a shared bindPopup method. Implements ILayer interface.
+
+
L.featureGroup([marker1, marker2, polyline])
+ .bindPopup('Hello world!')
+ .on('click', function() { alert('Clicked on a group!'); })
+ .addTo(map);
+
+
Creation
+
+
+
+ Factory
+
+ Description
+
+
+ L.featureGroup (
+ <ILayer []> layers? )
+
+
+
+
+ Create a layer group, optionally given an initial set of layers.
+
+
+
+
Methods
+
+
Has all layerGroup methods and additionally:
+
+
+
+ Method
+ Returns
+ Description
+
+
+ bindPopup (
+ <String> htmlContent ,
+ <Popup options > options? )
+
+
+ this
+ Binds a popup with a particular HTML content to a click on any layer from the group that has a bindPopup method.
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).
+
+
+ setStyle (
+ <Path options > style )
+
+ this
+ Sets the given path options to each layer of the group that has a setStyle method.
+
+
+ bringToFront ()
+ this
+ Brings the layer group to the top of all other layers.
+
+
+ bringToBack ()
+ this
+ Brings the layer group to the bottom of all other layers.
+
+
+
+
Events
+
+
You can subscribe to the following events using these methods .
+
+
+
+ Event
+ Data
+ Description
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the group.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the group.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the group.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the group.
+
+
+ mousemove
+ MouseEvent
+ Fired while the mouse moves over the layers of the group.
+
+
+ contextmenu
+ MouseEvent
+ Fired when the user right-clicks on one of the layers.
+
+
+ layeradd
+ LayerEvent
+ Fired when a layer is added to the group.
+
+
+ layerremove
+ LayerEvent
+ Fired when a layer is removed from the map.
+
+
+
+
+
GeoJson
+
+
Represents a GeoJSON object or an array of GeoJSON objects. Allows you to parse GeoJSON data and display it on the map. Extends FeatureGroup .
+
+
L.geoJson(data, {
+ style: function (feature) {
+ return {color: feature.properties.color};
+ },
+ onEachFeature: function (feature, layer) {
+ layer.bindPopup(feature.properties.description);
+ }
+}).addTo(map);
+
+
Each feature layer created by it gets a feature property that links to the GeoJSON feature data the layer was created from (so that you can access its properties later).
+
+
Creation
+
+
+
+ Factory
+ Description
+
+
+ L.geoJson (
+ <Object> geojson? ,
+ <GeoJSON options > options? )
+
+
+ Creates a GeoJSON layer. Optionally accepts an object in GeoJSON format to display on the map (you can alternatively add it later with addData method) and an options object.
+
+
+
+
Options
+
+
+
+ Option
+ Description
+
+
+ pointToLayer (
+ <GeoJSON> featureData ,
+ <LatLng > latlng )
+
+
+ Function that will be used for creating layers for GeoJSON points (if not specified, simple markers will be created).
+
+
+ style (
+ <GeoJSON> featureData )
+
+
+ Function that will be used to get style options for vector layers created for GeoJSON features.
+
+
+ onEachFeature (
+ <GeoJSON> featureData ,
+ <ILayer > layer )
+
+
+ Function that will be called on each created feature layer. Useful for attaching events and popups to features.
+
+
+ filter (
+ <GeoJSON> featureData ,
+ <ILayer > layer )
+
+
+ Function that will be used to decide whether to show a feature or not.
+
+
+ coordsToLatLng (
+ <Array> coords )
+
+
+ Function that will be used for converting GeoJSON coordinates to LatLng points (if not specified, coords will be assumed to be WGS84 — standard [longitude, latitude] values in degrees).
+
+
+
+
Additionally accepts all Path options for polylines and polygons.
+
+
Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ addData (
+ <GeoJSON> data )
+
+
+ this
+ Adds a GeoJSON object to the layer.
+
+
+ setStyle (
+ <Function> style )
+
+
+ this
+ Changes styles of GeoJSON vector layers with the given style function.
+
+
+ resetStyle (
+ <Path > layer )
+
+
+ this
+ Resets the given vector layer's style to the original GeoJSON style, useful for resetting style after hover events.
+
+
+
+
Static methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ geometryToLayer (
+ <GeoJSON> featureData ,
+ <Function > pointToLayer? )
+
+
+ ILayer
+ Creates a layer from a given GeoJSON feature.
+
+
+ coordsToLatLng (
+ <Array> coords ,
+ <Boolean> reverse? )
+
+
+ LatLng
+ Creates a LatLng object from an array of 2 numbers (latitude, longitude) used in GeoJSON for points. If reverse is set to true , the numbers will be interpreted as (longitude, latitude).
+
+
+ coordsToLatLngs (
+ <Array> coords ,
+ <Number> levelsDeep? ,
+ <Boolean> reverse? )
+
+
+ Array
+ Creates a multidimensional array of LatLng objects from a GeoJSON coordinates array. levelsDeep specifies the nesting level (0 is for an array of points, 1 for an array of arrays of points, etc., 0 by default). If reverse is set to true , the numbers will be interpreted as (longitude, latitude).
+
+
+
+
+
+
+
LatLng
+
+
Represents a geographical point with a certain latitude and longitude.
+
var latlng = L.latLng(50.5, 30.5);
+
+
All Leaflet methods that accept LatLng objects also accept them in a simple Array form and simple object form (unless noted otherwise), so these lines are equivalent:
+
+
map.panTo([50, 30]);
+map.panTo({lon: 30, lat: 50});
+map.panTo({lat: 50, lng: 30});
+map.panTo(L.latLng(50, 30));
+
+
Creation
+
+
+
+ Factory
+
+ Description
+
+
+ L.latLng (
+ <Number> latitude ,
+ <Number> longitude ,
+ <Number> altitude? )
+
+
+
+ Creates an object representing a geographical point with the given latitude and longitude (and optionally altitude).
+
+
+
+
Properties
+
+
+
+ Property
+ Type
+ Description
+
+
+ lat
+ Number
+ Latitude in degrees.
+
+
+ lng
+ Number
+ Longitude in degrees.
+
+
+
+
Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ distanceTo (
+ <LatLng > otherLatlng )
+
+
+ Number
+ Returns the distance (in meters) to the given LatLng calculated using the Haversine formula. See description on wikipedia .
+
+
+ equals (
+ <LatLng > otherLatlng )
+
+
+ Boolean
+ Returns true if the given LatLng point is at the same position (within a small margin of error).
+
+
+ toString ()
+ String
+ Returns a string representation of the point (for debugging purposes).
+
+
+ wrap (
+ <Number> left ,
+ <Number> right )
+
+
+ LatLng
+ Returns a new LatLng object with the longitude wrapped around left and right boundaries (-180 to 180 by default).
+
+
+
+
Constants
+
+
+
+ Constant
+ Type
+ Value
+ Description
+
+
+ DEG_TO_RAD
+ Number
+ Math.PI / 180
+ A multiplier for converting degrees into radians.
+
+
+ RAD_TO_DEG
+ Number
+ 180 / Math.PI
+ A multiplier for converting radians into degrees.
+
+
+ MAX_MARGIN
+ Number
+ 1.0E-9
+ Max margin of error for the equality check.
+
+
+
+
+
+
+
LatLngBounds
+
+
Represents a rectangular geographical area on a map.
+
var southWest = L.latLng(40.712, -74.227),
+ northEast = L.latLng(40.774, -74.125),
+ bounds = L.latLngBounds(southWest, northEast);
+
+
All Leaflet methods that accept LatLngBounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:
+
+
map.fitBounds([
+ [40.712, -74.227],
+ [40.774, -74.125]
+]);
+
+
Creation
+
+
+
+ Factory
+ Description
+
+
+
+ L.latLngBounds (
+ <LatLng > southWest ,
+ <LatLng > northEast )
+
+
+
+
+ Creates a latLngBounds object by defining south-west and north-east corners of the rectangle.
+
+
+ L.latLngBounds (
+ <LatLng []> latlngs )
+
+
+ Creates a LatLngBounds object defined by the geographical points it contains. Very useful for zooming the map to fit a particular set of locations with fitBounds .
+
+
+
+
Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ extend (
+ <LatLng |LatLngBounds > latlng )
+
+
+ this
+ Extends the bounds to contain the given point or bounds.
+
+
+ getSouthWest ()
+ LatLng
+ Returns the south-west point of the bounds.
+
+
+ getNorthEast ()
+ LatLng
+ Returns the north-east point of the bounds.
+
+
+ getNorthWest ()
+ LatLng
+ Returns the north-west point of the bounds.
+
+
+ getSouthEast ()
+ LatLng
+ Returns the south-east point of the bounds.
+
+
+ getWest ()
+ Number
+ Returns the west longitude of the bounds.
+
+
+ getSouth ()
+ Number
+ Returns the south latitude of the bounds.
+
+
+ getEast ()
+ Number
+ Returns the east longitude of the bounds.
+
+
+ getNorth ()
+ Number
+ Returns the north latitude of the bounds.
+
+
+ getCenter ()
+ LatLng
+ Returns the center point of the bounds.
+
+
+ contains (
+ <LatLngBounds > otherBounds )
+
+
+ Boolean
+ Returns true if the rectangle contains the given one.
+
+
+ contains (
+ <LatLng > latlng )
+
+
+ Boolean
+ Returns true if the rectangle contains the given point.
+
+
+ intersects (
+ <LatLngBounds > otherBounds )
+
+
+ Boolean
+ Returns true if the rectangle intersects the given bounds.
+
+
+ equals (
+ <LatLngBounds > otherBounds )
+
+
+ Boolean
+ Returns true if the rectangle is equivalent (within a small margin of error) to the given bounds.
+
+
+ toBBoxString ()
+ String
+ Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format. Useful for sending requests to web services that return geo data.
+
+
+ pad (
+ <Number> bufferRatio )
+
+
+ LatLngBounds
+ Returns bigger bounds created by extending the current bounds by a given percentage in each direction.
+
+
+ isValid ()
+
+
+ Boolean
+ Returns true if the bounds are properly initialized.
+
+
+
+
+
+
+
Point
+
+
Represents a point with x and y coordinates in pixels.
+
+
var point = L.point(200, 300);
+
+
All Leaflet methods and options that accept Point objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent:
+
+
map.panBy([200, 300]);
+map.panBy(L.point(200, 300));
+
+
Creation
+
+
+
+ Factory
+ Description
+
+
+ L.point (
+ <Number> x , <Number> y ,
+ <Boolean> round? )
+
+
+ Creates a Point object with the given x and y coordinates. If optional round is set to true , rounds the x and y values.
+
+
+
+
Properties
+
+
+
+ Property
+ Type
+ Description
+
+
+ x
+ Number
+ The x coordinate.
+
+
+ y
+ Number
+ The y coordinate.
+
+
+
+
Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ add (
+ <Point > otherPoint )
+
+
+ Point
+ Returns the result of addition of the current and the given points.
+
+
+ subtract (
+ <Point > otherPoint )
+
+
+ Point
+ Returns the result of subtraction of the given point from the current.
+
+
+ multiplyBy (
+ <Number> number )
+
+
+ Point
+ Returns the result of multiplication of the current point by the given number.
+
+
+ divideBy (
+ <Number> number ,
+ <Boolean> round? )
+
+
+ Point
+ Returns the result of division of the current point by the given number. If optional round is set to true , returns a rounded result.
+
+
+ distanceTo (
+ <Point > otherPoint )
+
+
+ Number
+ Returns the distance between the current and the given points.
+
+
+ clone ()
+ Point
+ Returns a copy of the current point.
+
+
+ round ()
+ Point
+ Returns a copy of the current point with rounded coordinates.
+
+
+ floor ()
+ Point
+ Returns a copy of the current point with floored coordinates (rounded down).
+
+
+ equals (
+ <Point > otherPoint )
+
+
+ Boolean
+ Returns true if the given point has the same coordinates.
+
+
+ contains (
+ <Point > otherPoint )
+
+
+ Boolean
+ Returns true if the both coordinates of the given point are less than the corresponding current point coordinates (in absolute values).
+
+
+ toString ()
+ String
+ Returns a string representation of the point for debugging purposes.
+
+
+
+
+
+
Bounds
+
+
Represents a rectangular area in pixel coordinates.
+
var p1 = L.point(10, 10),
+ p2 = L.point(40, 60),
+ bounds = L.bounds(p1, p2);
+
+
All Leaflet methods that accept Bounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:
+
+
otherBounds.intersects([[10, 10], [40, 60]]);
+
+
Creation
+
+
+
+ Factory
+
+ Description
+
+
+ L.bounds (
+ <Point > topLeft ,
+ <Point > bottomRight )
+
+
+
+ Creates a Bounds object from two coordinates (usually top-left and bottom-right corners).
+
+
+ L.bounds (
+ <Point []> points )
+
+
+
+
+ Creates a Bounds object defined by the points it contains.
+
+
+
+
Properties
+
+
+
+ Property
+ Type
+ Description
+
+
+ min
+ Point
+ The top left corner of the rectangle.
+
+
+ max
+ Point
+ The bottom right corner of the rectangle.
+
+
+
+
Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ extend (
+ <Point > point )
+
+
+ -
+ Extends the bounds to contain the given point.
+
+
+ getCenter ()
+ Point
+ Returns the center point of the bounds.
+
+
+ contains (
+ <Bounds > otherBounds )
+
+
+ Boolean
+ Returns true if the rectangle contains the given one.
+
+
+ contains (
+ <Point > point )
+
+
+ Boolean
+ Returns true if the rectangle contains the given point.
+
+
+ intersects (
+ <Bounds > otherBounds )
+
+
+ Boolean
+ Returns true if the rectangle intersects the given bounds.
+
+
+ isValid ()
+
+ Boolean
+ Returns true if the bounds are properly initialized.
+
+
+ getSize ()
+
+ Point
+ Returns the size of the given bounds.
+
+
+
+
+
Icon
+
+
Represents an icon to provide when creating a marker.
+
+
var myIcon = L.icon({
+ iconUrl: 'my-icon.png',
+ iconRetinaUrl: 'my-icon@2x.png',
+ iconSize: [38, 95],
+ iconAnchor: [22, 94],
+ popupAnchor: [-3, -76],
+ shadowUrl: 'my-icon-shadow.png',
+ shadowRetinaUrl: 'my-icon-shadow@2x.png',
+ shadowSize: [68, 95],
+ shadowAnchor: [22, 94]
+});
+
+L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
+
+
L.Icon.Default extends L.Icon and is the blue icon Leaflet uses for markers by default.
+
+
Creation
+
+
+
+ Factory
+
+ Description
+
+
+ L.icon (
+ <Icon options > options )
+
+
+
+ Creates an icon instance with the given options.
+
+
+
+
Options
+
+
+
+ Option
+ Type
+ Description
+
+
+ iconUrl
+ String
+ (required) The URL to the icon image (absolute or relative to your script path).
+
+
+ iconRetinaUrl
+ String
+ The URL to a retina sized version of the icon image (absolute or relative to your script path). Used for Retina screen devices.
+
+
+ iconSize
+ Point
+ Size of the icon image in pixels.
+
+
+ iconAnchor
+ Point
+ The coordinates of the "tip" of the icon (relative to its top left corner). The icon will be aligned so that this point is at the marker's geographical location. Centered by default if size is specified, also can be set in CSS with negative margins.
+
+
+ shadowUrl
+ String
+ The URL to the icon shadow image. If not specified, no shadow image will be created.
+
+
+ shadowRetinaUrl
+ String
+ The URL to the retina sized version of the icon shadow image. If not specified, no shadow image will be created. Used for Retina screen devices.
+
+
+ shadowSize
+ Point
+ Size of the shadow image in pixels.
+
+
+ shadowAnchor
+ Point
+ The coordinates of the "tip" of the shadow (relative to its top left corner) (the same as iconAnchor if not specified).
+
+
+ popupAnchor
+ Point
+ The coordinates of the point from which popups will "open", relative to the icon anchor.
+
+
+ className
+ String
+ A custom class name to assign to both icon and shadow images. Empty by default.
+
+
+
+
+
DivIcon
+
+
Represents a lightweight icon for markers that uses a simple div element instead of an image.
+
+
var myIcon = L.divIcon({className: 'my-div-icon'});
+// you can set .my-div-icon styles in CSS
+
+L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
+
+
By default, it has a 'leaflet-div-icon' class and is styled as a little white square with a shadow.
+
+
Creation
+
+
+
+ Factory
+
+ Description
+
+
+ L.divIcon (
+ <DivIcon options > options )
+
+
+
+
+ Creates a div icon instance with the given options.
+
+
+
+
Options
+
+
+
+ Option
+ Type
+ Description
+
+
+ iconSize
+ Point
+ Size of the icon in pixels. Can be also set through CSS.
+
+
+ iconAnchor
+ Point
+ The coordinates of the "tip" of the icon (relative to its top left corner). The icon will be aligned so that this point is at the marker's geographical location. Centered by default if size is specified, also can be set in CSS with negative margins.
+
+
+ popupAnchor
+ Point
+ The coordinates of the point from which popups will "open", relative to the icon anchor.
+
+
+ className
+ String
+ A custom class name to assign to the icon. 'leaflet-div-icon' by default.
+
+
+ html
+ String
+ A custom HTML code to put inside the div element, empty by default.
+
+
+
+
+
+
+
Control
+
+
The base class for all Leaflet controls. Implements IControl interface. You can add controls to the map like this:
+
+
control.addTo(map);
+// the same as
+map.addControl(control);
+
+
Creation
+
+
+ Factory
+
+ Description
+
+
+ L.control (
+ <Control options > options? )
+
+
+
+
+ Creates a control with the given options.
+
+
+
+
Options
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+ position
+ String
+ 'topright'
+ The initial position of the control (one of the map corners). See control positions .
+
+
+
+
Methods
+
+
+ Method
+ Returns
+ Description
+
+
+ setPosition (
+ <String> position )
+
+
+ this
+ Sets the position of the control. See control positions .
+
+
+ getPosition ()
+ String
+ Returns the current position of the control.
+
+
+ addTo (
+ <Map > map )
+
+
+ this
+ Adds the control to the map.
+
+
+ removeFrom (
+ <Map > map )
+
+
+ this
+ Removes the control from the map.
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTML container of the control.
+
+
+
+
Control Positions
+
+
Control positions (map corner to put a control to) are set using strings. Margins between controls and the map border are set with CSS, so that you can easily override them.
+
+
+
+ Position
+ Description
+
+
+ 'topleft'
+ Top left of the map.
+
+
+ 'topright'
+ Top right of the map.
+
+
+ 'bottomleft'
+ Bottom left of the map.
+
+
+ 'bottomright'
+ Bottom right of the map.
+
+
+
+
+
Control.zoom
+
+
A basic zoom control with two buttons (zoom in and zoom out). It is put on the map by default unless you set its zoomControl option to false . Extends Control .
+
+
Creation
+
+
+ Factory
+
+ Description
+
+
+ L.control.zoom (
+ <Control.Zoom options > options? )
+
+
+
+ Creates a zoom control.
+
+
+
+
Options
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+ position
+ String
+ 'topleft'
+ The position of the control (one of the map corners). See control positions .
+
+
+ zoomInText
+ String
+ '+'
+ The text set on the zoom in button.
+
+
+ zoomOutText
+ String
+ '-'
+ The text set on the zoom out button.
+
+
+ zoomInTitle
+ String
+ 'Zoom in'
+ The title set on the zoom in button.
+
+
+ zoomOutTitle
+ String
+ 'Zoom out'
+ The title set on the zoom out button.
+
+
+
+
+
+
Control.Attribution
+
+
The attribution control allows you to display attribution data in a small text box on a map. It is put on the map by default unless you set its attributionControl option to false , and it fetches attribution texts from layers with getAttribution method automatically. Extends Control .
+
+
Creation
+
+
+ Factory
+
+ Description
+
+
+ L.control.attribution (
+ <Control.Attribution options > options? )
+
+
+
+
+ Creates an attribution control.
+
+
+
+
Options
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+ position
+ String
+ 'bottomright'
+ The position of the control (one of the map corners). See control positions .
+
+
+ prefix
+ String
+ 'Leaflet'
+ The HTML text shown before the attributions. Pass false to disable.
+
+
+
+
Methods
+
+
+ Method
+ Returns
+ Description
+
+
+ setPrefix (
+ <String> prefix )
+
+ this
+ Sets the text before the attributions.
+
+
+ addAttribution (
+ <String> text )
+
+ this
+ Adds an attribution text (e.g. 'Vector data © Mapbox' ).
+
+
+ removeAttribution (
+ <String> text )
+
+ this
+ Removes an attribution text.
+
+
+
+
+
Control.Layers
+
+
The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the detailed example ). Extends Control .
+
+
var baseLayers = {
+ "Mapbox": mapbox,
+ "OpenStreetMap": osm
+};
+
+var overlays = {
+ "Marker": marker,
+ "Roads": roadsLayer
+};
+
+L.control.layers(baseLayers, overlays).addTo(map);
+
+
Creation
+
+
+ Factory
+
+ Description
+
+
+ L.control.layers (
+ <Layer Config > baseLayers? ,
+ <Layer Config > overlays? ,
+ <Control.Layers options > options? )
+
+ Creates an attribution control with the given layers. Base layers will be switched with radio buttons, while overlays will be switched with checkboxes. Note that all base layers should be passed in the base layers object, but only one should be added to the map during map instantiation.
+
+
+
+
Methods
+
+
+ Method
+ Returns
+ Description
+
+
+ addBaseLayer (
+ <ILayer > layer ,
+ <String> name )
+
+ this
+ Adds a base layer (radio button entry) with the given name to the control.
+
+
+ addOverlay (
+ <ILayer > layer ,
+ <String> name )
+
+ this
+ Adds an overlay (checkbox entry) with the given name to the control.
+
+
+ removeLayer (
+ <ILayer > layer )
+
+ this
+ Remove the given layer from the control.
+
+
+
+
Options
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). See control positions .
+
+
+ collapsed
+ Boolean
+ true
+ If true , the control will be collapsed into an icon and expanded on mouse hover or touch.
+
+
+ autoZIndex
+ Boolean
+ true
+ If true , the control will assign zIndexes in increasing order to all of its layers so that the order is preserved when switching them on/off.
+
+
+
+
+
Layer Config
+
+
An object literal with layer names as keys and layer objects as values:
+
+
{
+ "<someName1>": layer1,
+ "<someName2>": layer2
+}
+
+
The layer names can contain HTML, which allows you to add additional styling to the items:
+
+
{"<img src='my-layer-icon' /> <span class='my-layer-item'>My Layer</span>": myLayer}
+
+
+
Events
+
+
You can subscribe to the following events on the Map object using these methods .
+
+
+
+ Event
+ Data
+ Description
+
+
+ baselayerchange
+ LayersControlEvent
+ Fired when the base layer is changed through the control.
+
+
+ overlayadd
+ LayersControlEvent
+ Fired when an overlay is selected through the control.
+
+
+ overlayremove
+ LayersControlEvent
+ Fired when an overlay is deselected through the control.
+
+
+
+
+
Control.Scale
+
+
A simple scale control that shows the scale of the current center of screen in metric (m/km) and imperial (mi/ft) systems. Extends Control .
+
+
L.control.scale().addTo(map);
+
+
Creation
+
+
+ Factory
+
+ Description
+
+
+ L.control.scale (
+ <Control.Scale options > options? )
+
+
+
+
+ Creates an scale control with the given options.
+
+
+
+
Options
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+ position
+ String
+ 'bottomleft'
+ The position of the control (one of the map corners). See control positions .
+
+
+ maxWidth
+ Number
+ 100
+ Maximum width of the control in pixels. The width is set dynamically to show round values (e.g. 100, 200, 500).
+
+
+ metric
+ Boolean
+ true
+ Whether to show the metric scale line (m/km).
+
+
+ imperial
+ Boolean
+ true
+ Whether to show the imperial scale line (mi/ft).
+
+
+ updateWhenIdle
+ Boolean
+ false
+ If true , the control is updated on moveend, otherwise it's always up-to-date (updated on move).
+
+
+
+
+
+
Events methods
+
+
A set of methods shared between event-powered classes (like Map). Generally, events allow you to execute some function when something happens with an object (e.g. the user clicks on the map, causing the map 'click' event).
+
+
Example
+
+
map.on('click', function(e) {
+ alert(e.latlng);
+});
+
+
Leaflet deals with event listeners by reference, so if you want to add a listener and then remove it, define it as a function:
+
+
function onClick(e) { ... }
+
+map.on('click', onClick);
+map.off('click', onClick);
+
+
Methods
+
+
+ Method
+ Returns
+ Description
+
+
+ addEventListener (
+ <String> type ,
+ <Function> fn ,
+ <Object> context? )
+
+
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick' ).
+
+
+ addOneTimeEventListener (
+ <String> type ,
+ <Function> fn ,
+ <Object> context? )
+
+
+ this
+ The same as above except the listener will only get fired once and then removed.
+
+
+ addEventListener (
+ <Object> eventMap ,
+ <Object> context? )
+
+
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+ removeEventListener (
+ <String> type ,
+ <Function> fn? ,
+ <Object> context? )
+
+
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to addEventListener, you must pass the same context to removeEventListener in order to remove the listener.
+
+
+ removeEventListener (
+ <Object> eventMap ,
+ <Object> context? )
+
+
+ this
+ Removes a set of type/listener pairs.
+
+
+ removeEventListener ()
+
+ this
+ Removes all listeners. An alias to clearAllEventListeners when you use it without arguments.
+
+
+ hasEventListeners (
+ <String> type )
+
+
+ Boolean
+ Returns true if a particular event type has some listeners attached to it.
+
+
+ fireEvent (
+ <String> type ,
+ <Object> data? )
+
+
+ this
+ Fires an event of the specified type. You can optionally provide an data object — the first argument of the listener function will contain its properties.
+
+
+ clearAllEventListeners ()
+
+ this
+ Removes all listeners to all events on the object.
+
+
+ on ( … )
+ this
+ Alias to addEventListener.
+
+
+ once ( … )
+ this
+ Alias to addOneTimeEventListener.
+
+
+ off ( … )
+ this
+ Alias to removeEventListener.
+
+
+ fire ( … )
+ this
+ Alias to fireEvent.
+
+
+
+
+
Event objects
+
+
Event object is an object that you receive as an argument in a listener function when some event is fired, containing useful information about that event. For example:
+
+
map.on('click', function(e) {
+ alert(e.latlng); // e is an event object (MouseEvent in this case)
+});
+
+
Event
+
+
The base event object. All other event objects contain these properties too.
+
+
+
+ property
+ type
+ description
+
+
+ type
+ String
+ The event type (e.g. 'click' ).
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
MouseEvent
+
+
+
+ property
+ type
+ description
+
+
+ latlng
+ LatLng
+ The geographical point where the mouse event occurred.
+
+
+ layerPoint
+ Point
+ Pixel coordinates of the point where the mouse event occurred relative to the map layer.
+
+
+ containerPoint
+ Point
+ Pixel coordinates of the point where the mouse event occurred relative to the map сontainer.
+
+
+ originalEvent
+ DOMMouseEvent
+ The original DOM mouse event fired by the browser.
+
+
+
+
LocationEvent
+
+
+
+ property
+ type
+ description
+
+
+ latlng
+ LatLng
+ Detected geographical location of the user.
+
+
+ bounds
+ LatLngBounds
+ Geographical bounds of the area user is located in (with respect to the accuracy of location).
+
+
+ accuracy
+ Number
+ Accuracy of location in meters.
+
+
+ altitude
+ Number
+ Height of the position above the WGS84 ellipsoid in meters.
+
+
+ altitudeAccuracy
+ Number
+ Accuracy of altitude in meters.
+
+
+ heading
+ Number
+ The direction of travel in degrees counting clockwise from true North.
+
+
+ speed
+ Number
+ Current velocity in meters per second.
+
+
+ timestamp
+ Number
+ The time when the position was acquired.
+
+
+
+
ErrorEvent
+
+
+
+ property
+ type
+ description
+
+
+ message
+ String
+ Error message.
+
+
+ code
+ Number
+ Error code (if applicable).
+
+
+
+
LayerEvent
+
+
+
+ property
+ type
+ description
+
+
+ layer
+ ILayer
+ The layer that was added or removed.
+
+
+
+
LayersControlEvent
+
+
+
+ property
+ type
+ description
+
+
+ layer
+ ILayer
+ The layer that was added or removed.
+
+
+ name
+ String
+ The name of the layer that was added or removed.
+
+
+
+
TileEvent
+
+
+
+ property
+ type
+ description
+
+
+ tile
+ HTMLElement
+ The tile element (image).
+
+
+ url
+ String
+ The source URL of the tile.
+
+
+
+
TileErrorEvent
+
+
+
+ property
+ type
+ description
+
+
+ tile
+ HTMLElement
+ The tile element (image).
+
+
+ url
+ String
+ The src attribute of the tile element.
+
+
+
+
ResizeEvent
+
+
+
+ property
+ type
+ description
+
+
+ oldSize
+ Point
+ The old size before resize event.
+
+
+ newSize
+ Point
+ The new size after the resize event.
+
+
+
+
GeoJSON event
+
+
+
+ property
+ type
+ description
+
+
+ layer
+ ILayer
+ The layer for the GeoJSON feature that is being added to the map.
+
+
+ properties
+ Object
+ GeoJSON properties of the feature.
+
+
+ geometryType
+ String
+ GeoJSON geometry type of the feature.
+
+
+ id
+ String
+ GeoJSON ID of the feature (if present).
+
+
+
+
+
+
+
+ property
+ type
+ description
+
+
+ popup
+ Popup
+ The popup that was opened or closed.
+
+
+
+
DragEndEvent
+
+
+
+ property
+ type
+ description
+
+
+ distance
+ Number
+ The distance in pixels the draggable element was moved by.
+
+
+
+
+
+
+
+
+
Class
+
+
L.Class powers the OOP facilities of Leaflet and is used to create almost all of the Leaflet classes documented here.
+
In addition to implementing a simple classical inheritance model, it introduces several special properties for convenient code organization — options, includes and statics.
+
+
var MyClass = L.Class.extend({
+ initialize: function (greeter) {
+ this.greeter = greeter;
+ // class constructor
+ },
+
+ greet: function (name) {
+ alert(this.greeter + ', ' + name)
+ }
+});
+
+// create instance of MyClass, passing "Hello" to the constructor
+var a = new MyClass("Hello");
+
+// call greet method, alerting "Hello, World"
+a.greet("World");
+
+
+
The initialize method is your class's constructor function, meaning that it gets called when you do new MyClass(...).
+
+
+
Class Factories
+
+
You may have noticed that Leaflet objects are created without using the new keyword. This is achieved by complementing each class with a lowercase factory method:
+
+
new L.Map('map'); // becomes:
+L.map('map');
+
+
The factories are implemented very easily, and you can do this for your own classes:
+
+
L.map = function (id, options) {
+ return new L.Map(id, options);
+};
+
+
+
Inheritance
+
+
You use L.Class.extend to define new classes, but you can use the same method on any class to inherit from it:
+
+
var MyChildClass = MyClass.extend({
+ // ... new properties and methods
+});
+
+
This will create a class that inherits all methods and properties of the parent class (through a proper prototype chain), adding or overriding the ones you pass to extend. It will also properly react to instanceof:
+
+
var a = new MyChildClass();
+a instanceof MyChildClass; // true
+a instanceof MyClass; // true
+
+
+
You can call parent methods (including constructor) from corresponding child ones (as you do with super calls in other languages) by accessing parent class prototype and using JavaScript's call or apply:
+
+
var MyChildClass = MyClass.extend({
+ initialize: function () {
+ MyClass.prototype.initialize.call(this, "Yo");
+ },
+
+ greet: function (name) {
+ MyClass.prototype.greet.call(this, 'bro ' + name + '!');
+ }
+});
+
+var a = new MyChildClass();
+a.greet('Jason'); // alerts "Yo, bro Jason!"
+
+
Options
+
+
options is a special property that unlike other objects that you pass to extend will be merged with the parent one instead of overriding it completely, which makes managing configuration of objects and default values convenient:
+
+
var MyClass = L.Class.extend({
+ options: {
+ myOption1: 'foo',
+ myOption2: 'bar'
+ }
+});
+
+var MyChildClass = MyClass.extend({
+ options: {
+ myOption1: 'baz',
+ myOption3: 5
+ }
+});
+
+var a = new MyChildClass();
+a.options.myOption1; // 'baz'
+a.options.myOption2; // 'bar'
+a.options.myOption3; // 5
+
+
There's also L.Util.setOptions, a method for conveniently merging options passed to constructor with the defaults defined in the class:
+
+
var MyClass = L.Class.extend({
+ options: {
+ foo: 'bar',
+ bla: 5
+ },
+
+ initialize: function (options) {
+ L.Util.setOptions(this, options);
+ ...
+ }
+});
+
+var a = new MyClass({bla: 10});
+a.options; // {foo: 'bar', bla: 10}
+
+
Includes
+
+
includes is a special class property that merges all specified objects into the class (such objects are called mixins). A good example of this is L.Mixin.Events that event-related methods like on, off and fire to the class.
+
+
var MyMixin = {
+ foo: function () { ... },
+ bar: 5
+};
+
+var MyClass = L.Class.extend({
+ includes: MyMixin
+});
+
+var a = new MyClass();
+a.foo();
+
+
You can also do such includes in runtime with the include method:
+
+
MyClass.include (MyMixin);
+
+
Statics
+
+
statics is just a convenience property that injects specified object properties as the static properties of the class, useful for defining constants:
+
+
var MyClass = L.Class.extend({
+ statics: {
+ FOO: 'bar',
+ BLA: 5
+ }
+});
+
+MyClass.FOO; // 'bar'
+
+
+
Constructor Hooks
+
+
If you're a plugin developer, you often need to add additional initialization code to existing classes (e.g. editing hooks for L.Polyline). Leaflet comes with a way to do it easily using the addInitHook method:
+
+
MyClass.addInitHook(function () {
+ // ... do something in constructor additionally
+ // e.g. add event listeners, set custom properties etc.
+});
+
+
You can also use the following shortcut when you just need to make one additional method call:
+
+
MyClass.addInitHook('methodName', arg1, arg2, …);
+
+
+
Browser
+
+
A namespace with properties for browser/feature detection used by Leaflet internally.
+
+
if (L.Browser.ie6) {
+ alert('Upgrade your browser, dude!');
+}
+
+
+
+ property
+ type
+ description
+
+
+ ie
+ Boolean
+ true for all Internet Explorer versions.
+
+
+ ie6
+ Boolean
+ true for Internet Explorer 6.
+
+
+ ie7
+ Boolean
+ true for Internet Explorer 7.
+
+
+ ielt9
+ Boolean
+ true for Internet Explorer versions less than 9.
+
+
+ webkit
+ Boolean
+ true for webkit-based browsers like Chrome and Safari (including mobile versions).
+
+
+ webkit3d
+ Boolean
+ true for webkit-based browsers that support CSS 3D transformations.
+
+
+
+ android
+ Boolean
+ true for Android mobile browser.
+
+
+ android23
+ Boolean
+ true for old Android stock browsers (2 and 3).
+
+
+ mobile
+ Boolean
+ true for modern mobile browsers (including iOS Safari and different Android browsers).
+
+
+ mobileWebkit
+ Boolean
+ true for mobile webkit-based browsers.
+
+
+ mobileOpera
+ Boolean
+ true for mobile Opera.
+
+
+ touch
+ Boolean
+ true for all browsers on touch devices.
+
+
+ msTouch
+ Boolean
+ true for browsers with Microsoft touch model (e.g. IE10).
+
+
+ retina
+ Boolean
+ true for devices with Retina screens.
+
+
+
+
+
Util
+
+
Various utility functions, used by Leaflet internally.
+
+
Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ extend (
+ <Object> dest ,
+ <Object> src?.. )
+
+
+ Object
+ Merges the properties of the src object (or multiple objects) into dest object and returns the latter. Has an L.extend shortcut.
+
+
+ bind (
+ <Function> fn ,
+ <Object> obj )
+
+
+ Function
+ Returns a function which executes function fn with the given scope obj (so that this keyword refers to obj inside the function code). Has an L.bind shortcut. Not a polyfill for ES 5 bind (compare L.bind to the MDN-recommended polyfill for Function.prototype.bind).
+
+
+ stamp ( <Object> obj )
+ String
+ Applies a unique key to the object and returns that key. Has an L.stamp shortcut.
+
+
+ requestAnimFrame (
+ <Function> fn ,
+ <Object> context? ,
+ <Boolean> immediate? ,
+ <HTMLElement> element? )
+
+ Number
+ Schedules fn to be executed when the browser repaints. When immediate is set, fn is called immediately if the browser doesn't have native support for requestAnimationFrame, otherwise it's delayed. Returns an id that can be used to cancel the request.
+
+
+ cancelAnimFrame (
+ <Number> id )
+
+ -
+ Cancels a previous request to requestAnimFrame.
+
+
+ limitExecByInterval (
+ <Function> fn ,
+ <Number> time ,
+ <Object> context? )
+
+
+ Function
+ Returns a wrapper around the function fn that makes sure it's called not more often than a certain time interval time, but as fast as possible otherwise (for example, it is used for checking and requesting new tiles while dragging the map), optionally passing the scope (context) in which the function will be called.
+
+
+
+ falseFn ()
+ Function
+ Always returns false .
+
+
+ formatNum (
+ <Number> num ,
+ <Number> digits )
+
+
+ Number
+ Returns the number num rounded to digits decimals.
+
+
+ splitWords (
+ <String> str )
+
+
+ String[]
+ Trims and splits the string on whitespace and returns the array of parts.
+
+
+ setOptions (
+ <Object> obj ,
+ <Object> options )
+
+
+ Object
+ Merges the given properties to the options of the obj object, returning the resulting options. See Class options . Has an L.setOptions shortcut.
+
+
+ getParamString (
+ <Object> obj )
+
+
+ String
+ Converts an object into a parameter URL string, e.g. {a: "foo", b: "bar"} translates to '?a=foo&b=bar' .
+
+
+ template (
+ <String> str , <Object> data )
+
+
+ String
+ Simple templating facility, accepts a template string of the form 'Hello {a}, {b}' and a data object like {a: 'foo', b: 'bar'}, returns evaluated string ('Hello foo, bar' ). You can also specify functions instead of strings for data values — they will be evaluated passing data as an argument.
+
+
+ isArray (
+ <Object> obj )
+
+
+ Boolean
+ Returns true if the given object is an array.
+
+
+ trim (
+ <String> str )
+
+
+ String
+ Trims the whitespace from both ends of the string and returns the result.
+
+
+
+
Properties
+
+
+
+ Property
+ Type
+ Description
+
+
+ emptyImageUrl
+ String
+ Data URI string containing a base64-encoded empty GIF image. Used as a hack to free memory from unused images on WebKit-powered mobile devices (by setting image src to this string).
+
+
+
+
+
+
+
+
Represents an affine transformation: a set of coefficients a, b, c, d for transforming a point of a form (x, y) into (a*x + b, c*y + d) and doing the reverse. Used by Leaflet in its projections code.
+
+
var transformation = new L.Transformation(2, 5, -1, 10),
+ p = L.point(1, 2),
+ p2 = transformation.transform(p), // L.point(7, 8)
+ p3 = transformation.untransform(p2); // L.point(1, 2)
+
+
+
Creation
+
+
+
+ Creation
+ Description
+
+
+ new L.Transformation (
+ <Number> a ,
+ <Number> b ,
+ <Number> c ,
+ <Number> d )
+
+
+ Creates a transformation object with the given coefficients.
+
+
+
+
Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ transform (
+ <Point > point ,
+ <Number> scale? )
+
+
+ Point
+ Returns a transformed point, optionally multiplied by the given scale. Only accepts real L.Point instances, not arrays.
+
+
+ untransform (
+ <Point > point ,
+ <Number> scale? )
+
+
+ Point
+ Returns the reverse transformation of the given point, optionally divided by the given scale. Only accepts real L.Point instances, not arrays.
+
+
+
+
+
+
+
LineUtil
+
+
Various utility functions for polyline points processing, used by Leaflet internally to make polylines lightning-fast.
+
+
Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ simplify (
+ <Point []> points ,
+ <Number> tolerance )
+
+
+ Point []
+
+ Dramatically reduces the number of points in a polyline while retaining its shape and returns a new array of simplified points. Used for a huge performance boost when processing/displaying Leaflet polylines for each zoom level and also reducing visual noise. tolerance affects the amount of simplification (lesser value means higher quality but slower and with more points). Also released as a separated micro-library Simplify.js .
+
+
+ pointToSegmentDistance (
+ <Point > p ,
+ <Point > p1 ,
+ <Point > p2 )
+
+
+ Number
+
+ Returns the distance between point p and segment p1 to p2.
+
+
+ closestPointOnSegment (
+ <Point > p ,
+ <Point > p1 ,
+ <Point > p2 )
+
+
+ Point
+
+ Returns the closest point from a point p on a segment p1 to p2.
+
+
+ clipSegment (
+ <Point > a ,
+ <Point > b ,
+ <Bounds > bounds )
+
+
+ Point []
+
+ Clips the segment a to b by rectangular bounds. Returns either false or an array of clipped points. Used by Leaflet to only show polyline points that are on the screen or near, increasing performance.
+
+
+
+
+
+
PolyUtil
+
+
Various utility functions for polygon geometries.
+
+
Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ clipPolygon (
+ <Point []> points ,
+ <Bounds > bounds )
+
+
+ Point []
+
+ Clips the polygon geometry defined by the given points by rectangular bounds. Used by Leaflet to only show polygon points that are on the screen or near, increasing performance. Note that polygon points needs different algorithm for clipping than polyline, so there's a separate method for it.
+
+
+
+
+
+
+
DomEvent
+
+
Utility functions to work with the DOM events, used by Leaflet internally.
+
+
Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ addListener (
+ <HTMLElement> el ,
+ <String> type ,
+ <Function> fn ,
+ <Object> context? )
+
+
+ this
+ Adds a listener fn to the element's DOM event of the specified type. this keyword inside the listener will point to context, or to the element if not specified.
+
+
+ removeListener (
+ <HTMLElement> el ,
+ <String> type ,
+ <Function> fn )
+
+
+ this
+ Removes an event listener from the element.
+
+
+ stopPropagation (
+ <DOMEvent> e )
+
+
+ this
+ Stop the given event from propagation to parent elements. Used inside the listener functions:
+L.DomEvent.addListener(div, 'click', function (e) {
+ L.DomEvent.stopPropagation(e);
+});
+
+
+
+ preventDefault (
+ <DOMEvent> e )
+
+
+ this
+ Prevents the default action of the event from happening (such as following a link in the href of the a element, or doing a POST request with page reload when form is submitted). Use it inside listener functions.
+
+
+
+ stop (
+ <DOMEvent> e )
+
+
+ this
+ Does stopPropagation and preventDefault at the same time.
+
+
+ disableClickPropagation (
+ <HTMLElement> el )
+
+
+ this
+ Adds stopPropagation to the element's 'click' , 'doubleclick' , 'mousedown' and 'touchstart' events.
+
+
+ getMousePosition (
+ <DOMEvent> e ,
+ <HTMLElement> container? )
+
+
+ Point
+ Gets normalized mouse position from a DOM event relative to the container or to the whole page if not specified.
+
+
+ getWheelDelta (
+ <DOMEvent> e )
+
+
+ Number
+ Gets normalized wheel delta from a mousewheel DOM event.
+
+
+
+
+
+
+
DomUtil
+
+
Utility functions to work with the DOM tree, used by Leaflet internally.
+
+
Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ get (
+ <String or HTMLElement> id )
+
+
+ HTMLElement
+ Returns an element with the given id if a string was passed, or just returns the element if it was passed directly.
+
+
+ getStyle (
+ <HTMLElement> el ,
+ <String> style )
+
+
+ String
+ Returns the value for a certain style attribute on an element, including computed values or values set through CSS.
+
+
+ getViewportOffset (
+ <HTMLElement> el )
+
+
+ Point
+ Returns the offset to the viewport for the requested element.
+
+
+ create (
+ <String> tagName ,
+ <String> className ,
+ <HTMLElement> container? )
+
+
+ HTMLElement
+
+ Creates an element with tagName, sets the className, and optionally appends it to container element.
+
+
+ disableTextSelection ()
+ -
+ Makes sure text cannot be selected, for example during dragging.
+
+
+ enableTextSelection ()
+ -
+ Makes text selection possible again.
+
+
+ hasClass (
+ <HTMLElement> el ,
+ <String> name )
+
+
+ Boolean
+
+ Returns true if the element class attribute contains name.
+
+
+ addClass (
+ <HTMLElement> el ,
+ <String> name )
+
+
+ -
+
+ Adds name to the element's class attribute.
+
+
+ removeClass (
+ <HTMLElement> el ,
+ <String> name )
+
+
+ -
+
+ Removes name from the element's class attribute.
+
+
+ setOpacity (
+ <HTMLElement> el ,
+ <Number> value )
+
+
+ -
+ Set the opacity of an element (including old IE support). Value must be from 0 to 1.
+
+
+ testProp (
+ <String[]> props )
+
+
+ String or false
+ Goes through the array of style names and returns the first name that is a valid style name for an element. If no such name is found, it returns false . Useful for vendor-prefixed styles like transform.
+
+
+ getTranslateString (
+ <Point > point )
+
+
+ String
+ Returns a CSS transform string to move an element by the offset provided in the given point. Uses 3D translate on WebKit for hardware-accelerated transforms and 2D on other browsers.
+
+
+ getScaleString (
+ <Number> scale ,
+ <Point > origin )
+
+
+ String
+ Returns a CSS transform string to scale an element (with the given scale origin).
+
+
+ setPosition (
+ <HTMLElement> el ,
+ <Point > point ,
+ <Boolean> disable3D? )
+
+
+ -
+ Sets the position of an element to coordinates specified by point, using CSS translate or top/left positioning depending on the browser (used by Leaflet internally to position its layers). Forces top/left positioning if disable3D is true .
+
+
+ getPosition (
+ <HTMLElement> el )
+
+
+ Point
+ Returns the coordinates of an element previously positioned with setPosition.
+
+
+
+
Properties
+
+
+
+ Property
+ Type
+ Description
+
+
+ TRANSITION
+
+ String
+ Vendor-prefixed transition style name (e.g. 'webkitTransition' for WebKit).
+
+
+ TRANSFORM
+
+ String
+ Vendor-prefixed transform style name.
+
+
+
+
+
+
PosAnimation
+
+
Used internally for panning animations, utilizing CSS3 Transitions for modern browsers and a timer fallback for IE6-9.
+
+
var fx = new L.PosAnimation();
+fx.run(el, [300, 500], 0.5);
+
+
Creation
+
+
+
+ Creation
+ Description
+
+
+ new L.PosAnimation ()
+
+ Creates a PosAnimation object.
+
+
+
+
Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ run (
+ <HTMLElement> element ,
+ <Point > newPos ,
+ <Number> duration? ,
+ <Number> easeLinearity? )
+
+
+ this
+ Runs an animation of a given element to a new position, optionally setting duration in seconds (0.25 by default) and easing linearity factor (3rd argument of the cubic bezier curve , 0.5 by default).
+
+
+
+
Events
+
+
You can subscribe to the following events using these methods .
+
+
+
+ Event
+ Data
+ Description
+
+
+ start
+ Event
+ Fired when the animation starts.
+
+
+ step
+ Event
+ Fired continuously during the animation.
+
+
+ end
+ Event
+ Fired when the animation ends.
+
+
+
+
+
+
Draggable
+
+
A class for making DOM elements draggable (including touch support). Used internally for map and marker dragging. Only works for elements that were positioned with DomUtil#setPosition .
+
+
var draggable = new L.Draggable(elementToDrag);
+draggable.enable();
+
+
+
Creation
+
+
+
+ Creation
+ Description
+
+
+ new L.Draggable (
+ <HTMLElement> element ,
+ <HTMLElement> dragHandle? )
+
+
+ Creates a Draggable object for moving the given element when you start dragging the dragHandle element (equals the element itself by default).
+
+
+
+
Events
+
+
You can subscribe to the following events using these methods .
+
+
+
+ Event
+ Data
+ Description
+
+
+ dragstart
+ Event
+ Fired when the dragging starts.
+
+
+ predrag
+ Event
+ Fired continuously during dragging before each corresponding update of the element position.
+
+
+ drag
+ Event
+ Fired continuously during dragging.
+
+
+ dragend
+ Event
+ Fired when the dragging ends.
+
+
+
+
Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ enable ()
+ -
+ Enables the dragging ability.
+
+
+ disable ()
+ -
+ Disables the dragging ability.
+
+
+
+
+
+
+
+
IHandler
+
An interface implemented by interaction handlers .
+
+
+
+ Method
+ Returns
+ Description
+
+
+ enable ()
+ -
+ Enables the handler.
+
+
+ disable ()
+ -
+ Disables the handler.
+
+
+ enabled ()
+ Boolean
+ Returns true if the handler is enabled.
+
+
+
+
+
ILayer
+
+
Represents an object attached to a particular location (or a set of locations) on a map. Implemented by tile layers , markers , popups , image overlays , vector layers and layer groups .
+
+
Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ onAdd (
+ <Map > map )
+
+
+ -
+ Should contain code that creates DOM elements for the overlay, adds them to map panes where they should belong and puts listeners on relevant map events. Called on map.addLayer(layer).
+
+
+ onRemove (
+ <Map > map )
+
+
+ -
+ Should contain all clean up code that removes the overlay's elements from the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer).
+
+
+
+
Implementing Custom Layers
+
+
The most important things know about when implementing custom layers are Map viewreset event and latLngToLayerPoint method. viewreset is fired when the map needs to reposition its layers (e.g. on zoom), and latLngToLayerPoint is used to get coordinates for the layer's new position.
+
+
Another event often used in layer implementations is moveend which fires after any movement of the map (panning, zooming, etc.).
+
+
Another thing to note is that you'll usually need to add leaflet-zoom-hide class to the DOM elements you create for the layer so that it hides during zoom animation. Implementing zoom animation for custom layers is a complex topic and will be documented separately in future, but meanwhile you can take a look at how it's done for Leaflet layers (e.g. ImageOverlay) in the source.
+
+
Custom Layer Example
+
+
Here's how a custom layer implementation usually looks:
+
+
var MyCustomLayer = L.Class.extend({
+
+ initialize: function (latlng) {
+ // save position of the layer or any options from the constructor
+ this._latlng = latlng;
+ },
+
+ onAdd: function (map) {
+ this._map = map;
+
+ // create a DOM element and put it into one of the map panes
+ this._el = L.DomUtil.create('div', 'my-custom-layer leaflet-zoom-hide');
+ map.getPanes().overlayPane.appendChild(this._el);
+
+ // add a viewreset event listener for updating layer's position, do the latter
+ map.on('viewreset', this._reset, this);
+ this._reset();
+ },
+
+ onRemove: function (map) {
+ // remove layer's DOM elements and listeners
+ map.getPanes().overlayPane.removeChild(this._el);
+ map.off('viewreset', this._reset, this);
+ },
+
+ _reset: function () {
+ // update layer's position
+ var pos = this._map.latLngToLayerPoint(this._latlng);
+ L.DomUtil.setPosition(this._el, pos);
+ }
+});
+
+map.addLayer(new MyCustomLayer(latlng));
+
+
+
+
+
IControl
+
+
Represents a UI element in one of the corners of the map. Implemented by zoom , attribution , scale and layers controls.
+
+
Methods
+
+
Every control in Leaflet should extend from Control class and additionally have the following methods:
+
+
+
+ Method
+ Returns
+ Description
+
+
+ onAdd (
+ <Map > map )
+
+
+ HTMLElement
+ Should contain code that creates all the necessary DOM elements for the control, adds listeners on relevant map events, and returns the element containing the control. Called on map.addControl(control) or control.addTo(map).
+
+
+ onRemove (
+ <Map > map )
+
+
+ -
+ Optional, should contain all clean up code (e.g. removes control's event listeners). Called on map.removeControl(control) or control.removeFrom(map). The control's DOM container is removed automatically.
+
+
+
+
Custom Control Example
+
+
var MyControl = L.Control.extend({
+ options: {
+ position: 'topright'
+ },
+
+ onAdd: function (map) {
+ // create the control container with a particular class name
+ var container = L.DomUtil.create('div', 'my-custom-control');
+
+ // ... initialize other DOM elements, add listeners, etc.
+
+ return container;
+ }
+});
+
+map.addControl(new MyControl());
+
+
+
If specify your own constructor for the control, you'll also probably want to process options properly:
+
+
var MyControl = L.Control.extend({
+ initialize: function (foo, options) {
+ // ...
+ L.Util.setOptions(this, options);
+ },
+ // ...
+});
+
+
This will allow you to pass options like position when creating the control instances:
+
+
map.addControl(new MyControl('bar', {position: 'bottomleft'}));
+
+
+
+
+
IProjection
+
+
An object with methods for projecting geographical coordinates of the world onto a flat surface (and back). See Map projection .
+
+
Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ project (
+ <LatLng > latlng )
+
+
+ Point
+ Projects geographical coordinates into a 2D point.
+
+
+ unproject (
+ <Point > point )
+
+
+ LatLng
+ The inverse of project. Projects a 2D point into geographical location.
+
+
+
+
Defined Projections
+
+
Leaflet comes with a set of already defined projections out of the box:
+
+
+
+ Projection
+ Description
+
+
+ L.Projection.SphericalMercator
+
+ Spherical Mercator projection — the most common projection for online maps, used by almost all free and commercial tile providers. Assumes that Earth is a sphere. Used by the EPSG:3857 CRS.
+
+
+ L.Projection.Mercator
+
+ Elliptical Mercator projection — more complex than Spherical Mercator. Takes into account that Earth is a geoid, not a perfect sphere. Used by the EPSG:3395 CRS.
+
+
+ L.Projection.LonLat
+
+ Equirectangular, or Plate Carree projection — the most simple projection, mostly used by GIS enthusiasts. Directly maps x as longitude, and y as latitude. Also suitable for flat worlds, e.g. game maps. Used by the EPSG:3395 and Simple CRS.
+
+
+
+
+
+
+
ICRS
+
+
Defines coordinate reference systems for projecting geographical points into pixel (screen) coordinates and back (and to coordinates in other units for WMS services). See Spatial reference system .
+
+
Methods
+
+
+
+ Method
+ Returns
+ Description
+
+
+ latLngToPoint (
+ <LatLng > latlng ,
+ <Number> zoom )
+
+
+ Point
+ Projects geographical coordinates on a given zoom into pixel coordinates.
+
+
+ pointToLatLng (
+ <Point > point ,
+ <Number> zoom )
+
+
+ LatLng
+ The inverse of latLngToPoint. Projects pixel coordinates on a given zoom into geographical coordinates.
+
+
+ project (
+ <LatLng > latlng )
+
+
+ Point
+ Projects geographical coordinates into coordinates in units accepted for this CRS (e.g. meters for EPSG:3857, for passing it to WMS services).
+
+
+ scale (
+ <Number> zoom )
+
+
+ Number
+ Returns the scale used when transforming projected coordinates into pixel coordinates for a particular zoom. For example, it returns 256 * 2^zoom for Mercator-based CRS.
+
+
+ getSize (
+ <Number> zoom )
+
+
+ Point
+ Returns the size of the world in pixels for a particular zoom.
+
+
+
+
Properties
+
+
+
+ Property
+ Type
+ Description
+
+
+ projection
+
+ IProjection
+ Projection that this CRS uses.
+
+
+ transformation
+
+ Transformation
+ Transformation that this CRS uses to turn projected coordinates into screen coordinates for a particular tile service.
+
+
+
+ code
+
+ String
+ Standard code name of the CRS passed into WMS services (e.g. 'EPSG:3857' ).
+
+
+
+
Defined CRS
+
+
Leaflet comes with a set of already defined CRS to use out of the box:
+
+
+
+ Projection
+ Description
+
+
+ L.CRS.EPSG3857
+
+ The most common CRS for online maps, used by almost all free and commercial tile providers. Uses Spherical Mercator projection. Set in by default in Map's crs option.
+
+
+ L.CRS.EPSG4326
+
+ A common CRS among GIS enthusiasts. Uses simple Equirectangular projection.
+
+
+ L.CRS.EPSG3395
+
+ Rarely used by some commercial tile providers. Uses Elliptical Mercator projection.
+
+
+ L.CRS.Simple
+
+ A simple CRS that maps longitude and latitude into x and y directly. May be used for maps of flat surfaces (e.g. game maps). Note that the y axis should still be inverted (going from bottom to top).
+
+
+
+
If you want to use some obscure CRS not listed here, take a look at the Proj4Leaflet plugin.
+
+
+
Global Switches
+
+
Global switches are created for rare cases and generally make Leaflet to not detect a particular browser feature even if it's there. You need to set the switch as a global variable to true before including Leaflet on the page, like this:
+
+
<script>L_PREFER_CANVAS = true;</script>
+<script src="leaflet.js"></script>
+
+
+
+ Switch
+ Description
+
+
+ L_PREFER_CANVAS
+ Forces Leaflet to use the Canvas back-end (if available) for vector layers instead of SVG. This can increase performance considerably in some cases (e.g. many thousands of circle markers on the map).
+
+
+ L_NO_TOUCH
+ Forces Leaflet to not use touch events even if it detects them.
+
+
+ L_DISABLE_3D
+ Forces Leaflet to not use hardware-accelerated CSS 3D transforms for positioning (which may cause glitches in some rare environments) even if they're supported.
+
+
+
+
noConflict
+
+
This method restores the L global variable to the original value it had before Leaflet inclusion, and returns the real Leaflet namespace so you can put it elsewhere, like this:
+
+
// L points to some other library
+...
+// you include Leaflet, it replaces the L variable to Leaflet namespace
+
+var Leaflet = L.noConflict();
+// now L points to that other library again, and you can use Leaflet.Map etc.
+
+
+
version
+
+
A constant that represents the Leaflet version in use.
+
+
L.version // contains "0.5" (or whatever version is currently in use)
+
+
diff --git a/src/public/Leaflet-1.7.1/docs/reference-1.0.3.html b/src/public/Leaflet-1.7.1/docs/reference-1.0.3.html
new file mode 100644
index 0000000..61fdbdc
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/reference-1.0.3.html
@@ -0,0 +1,23315 @@
+---
+layout: v2
+title: Documentation
+bodyclass: api-page
+---
+
+
API Reference
+
+
This reference reflects Leaflet 1.0.3 . Check this list if you are using a different version of Leaflet.
+
+
+
+
+
Map
+
+
Map Methods
+
+
Map Misc
+
+
+
+
UI Layers
+
+
Raster Layers
+
+
Vector Layers
+
+
+
+
Other Layers
+
+
Basic Types
+
+
Controls
+
+
+
+
+
+
+
+
+
+
Utility
+
+
DOM Utility
+
+
+
+
Base Classes
+
+
+
Misc
+
+
+
+
+
Map The central class of the API — it is used to create a map on a page and manipulate it.
+
+
+Usage example
+
+
+
+
+
+
+
+// initialize the map on the "map" div with a given center and zoom
+var map = L.map('map', {
+ center: [51.505, -0.09],
+ zoom: 13
+});
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.map (<String> id , <Map options> options? )
+ Instantiates a map object given the DOM ID of a <div> element
+and optionally an object literal with Map options.
+
+
+ L.map (<HTMLElement> el , <Map options> options? )
+ Instantiates a map object given an instance of a <div> HTML element
+and optionally an object literal with Map options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ preferCanvas
+ Boolean
+ false
+ Whether Path s should be rendered on a Canvas renderer.
+By default, all Paths are rendered in a SVG renderer.
+
+
+
+
+
+Control options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attributionControl
+ Boolean
+ true
+ Whether a attribution control is added to the map by default.
+
+
+ zoomControl
+ Boolean
+ true
+ Whether a zoom control is added to the map by default.
+
+
+
+
+
+Interaction Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+
+ zoomSnap
+ Number
+ 1
+ Forces the map's zoom level to always be a multiple of this, particularly
+right after a fitBounds() or a pinch-zoom.
+By default, the zoom level snaps to the nearest integer; lower values
+(e.g. 0.5 or 0.1) allow for greater granularity. A value of 0
+means the zoom level will not be snapped after fitBounds or a pinch-zoom.
+
+
+ zoomDelta
+ Number
+ 1
+ Controls how much the map's zoom level will change after a
+zoomIn() , zoomOut() , pressing +
+or - on the keyboard, or using the zoom controls .
+Values smaller than 1 (e.g. 0.5) allow for greater granularity.
+
+
+ trackResize
+ Boolean
+ true
+ Whether the map automatically handles browser window resize to update itself.
+
+
+ boxZoom
+ Boolean
+ true
+ Whether the map can be zoomed to a rectangular area specified by
+dragging the mouse while pressing the shift key.
+
+
+ doubleClickZoom
+ Boolean|String
+ true
+ Whether the map can be zoomed in by double clicking on it and
+zoomed out by double clicking while holding shift. If passed
+'center', double-click zoom will zoom to the center of the
+ view regardless of where the mouse was.
+
+
+ dragging
+ Boolean
+ true
+ Whether the map be draggable with mouse/touch or not.
+
+
+
+
+
+Map State Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ crs
+ CRS
+ L.CRS.EPSG3857
+ The Coordinate Reference System to use. Don't change this if you're not
+sure what it means.
+
+
+ center
+ LatLng
+ undefined
+ Initial geographic center of the map
+
+
+ zoom
+ Number
+ undefined
+ Initial map zoom level
+
+
+ minZoom
+ Number
+ undefined
+ Minimum zoom level of the map. Overrides any minZoom option set on map layers.
+
+
+ maxZoom
+ Number
+ undefined
+ Maximum zoom level of the map. Overrides any maxZoom option set on map layers.
+
+
+ layers
+ Layer[]
+ []
+ Array of layers that will be added to the map initially
+
+
+ maxBounds
+ LatLngBounds
+ null
+ When this option is set, the map restricts the view to the given
+geographical bounds, bouncing the user back if the user tries to pan
+outside the view. To set the restriction dynamically, use
+setMaxBounds method.
+
+
+ renderer
+ Renderer
+ *
+ The default method for drawing vector layers on the map. L.SVG
+or L.Canvas by default depending on browser support.
+
+
+
+
+
+Animation Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ zoomAnimation
+ Boolean
+ true
+ Whether the map zoom animation is enabled. By default it's enabled
+in all browsers that support CSS3 Transitions except Android.
+
+
+ zoomAnimationThreshold
+ Number
+ 4
+ Won't animate zoom if the zoom difference exceeds this value.
+
+
+ fadeAnimation
+ Boolean
+ true
+ Whether the tile fade animation is enabled. By default it's enabled
+in all browsers that support CSS3 Transitions except Android.
+
+
+ markerZoomAnimation
+ Boolean
+ true
+ Whether markers animate their zoom with the zoom animation, if disabled
+they will disappear for the length of the animation. By default it's
+enabled in all browsers that support CSS3 Transitions except Android.
+
+
+ transform3DLimit
+ Number
+ 2^23
+ Defines the maximum size of a CSS translation transform. The default
+value should not be changed unless a web browser positions layers in
+the wrong place after doing a large panBy.
+
+
+
+
+
+Panning Inertia Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ inertia
+ Boolean
+ *
+ If enabled, panning of the map will have an inertia effect where
+the map builds momentum while dragging and continues moving in
+the same direction for some time. Feels especially nice on touch
+devices. Enabled by default unless running on old Android devices.
+
+
+ inertiaDeceleration
+ Number
+ 3000
+ The rate with which the inertial movement slows down, in pixels/second².
+
+
+ inertiaMaxSpeed
+ Number
+ Infinity
+ Max speed of the inertial movement, in pixels/second.
+
+
+ easeLinearity
+ Number
+ 0.2
+
+
+
+ worldCopyJump
+ Boolean
+ false
+ With this option enabled, the map tracks when you pan to another "copy"
+of the world and seamlessly jumps to the original one so that all overlays
+like markers and vector layers are still visible.
+
+
+ maxBoundsViscosity
+ Number
+ 0.0
+ If maxBounds is set, this option will control how solid the bounds
+are when dragging the map around. The default value of 0.0 allows the
+user to drag outside the bounds at normal speed, higher values will
+slow down map dragging outside bounds, and 1.0 makes the bounds fully
+solid, preventing the user from dragging outside the bounds.
+
+
+
+
+
+Keyboard Navigation Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ keyboard
+ Boolean
+ true
+ Makes the map focusable and allows users to navigate the map with keyboard
+arrows and +/- keys.
+
+
+ keyboardPanDelta
+ Number
+ 80
+ Amount of pixels to pan when pressing an arrow key.
+
+
+
+
+
+Mousewheel options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ scrollWheelZoom
+ Boolean|String
+ true
+ Whether the map can be zoomed by using the mouse wheel. If passed 'center',
+it will zoom to the center of the view regardless of where the mouse was.
+
+
+ wheelDebounceTime
+ Number
+ 40
+ Limits the rate at which a wheel can fire (in milliseconds). By default
+user can't zoom via wheel more often than once per 40 ms.
+
+
+ wheelPxPerZoomLevel
+ Number
+ 60
+ How many scroll pixels (as reported by L.DomEvent.getWheelDelta )
+mean a change of one full zoom level. Smaller values will make wheel-zooming
+faster (and vice versa).
+
+
+
+
+
+Touch interaction options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ tap
+ Boolean
+ true
+ Enables mobile hacks for supporting instant taps (fixing 200ms click
+delay on iOS/Android) and touch holds (fired as contextmenu events).
+
+
+ tapTolerance
+ Number
+ 15
+ The max number of pixels a user can shift his finger during touch
+for it to be considered a valid tap.
+
+
+ touchZoom
+ Boolean|String
+ *
+ Whether the map can be zoomed by touch-dragging with two fingers. If
+passed 'center', it will zoom to the center of the view regardless of
+where the touch events (fingers) were. Enabled for touch-capable web
+browsers except for old Androids.
+
+
+ bounceAtZoomLimits
+ Boolean
+ true
+ Set it to false if you don't want the map to zoom beyond min/max zoom
+and then bounce back when pinch-zooming.
+
+
+
+
+
+
+
+Events
+
+
+
+Layer events
+
+
+
+
+
+
+Map state change events
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ zoomlevelschange
+ Event
+ Fired when the number of zoomlevels on the map is changed due
+to adding or removing a layer.
+
+
+ resize
+ ResizeEvent
+ Fired when the map is resized.
+
+
+ unload
+ Event
+ Fired when the map is destroyed with remove method.
+
+
+ viewreset
+ Event
+ Fired when the map needs to redraw its content (this usually happens
+on map zoom or load). Very useful for creating custom overlays.
+
+
+ load
+ Event
+ Fired when the map is initialized (when its center and zoom are set
+for the first time).
+
+
+ zoomstart
+ Event
+ Fired when the map zoom is about to change (e.g. before zoom animation).
+
+
+ movestart
+ Event
+ Fired when the view of the map starts changing (e.g. user starts dragging the map).
+
+
+ zoom
+ Event
+ Fired repeatedly during any change in zoom level, including zoom
+and fly animations.
+
+
+ move
+ Event
+ Fired repeatedly during any movement of the map, including pan and
+fly animations.
+
+
+ zoomend
+ Event
+ Fired when the map has changed, after any animations.
+
+
+ moveend
+ Event
+ Fired when the center of the map stops changing (e.g. user stopped
+dragging the map).
+
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+ autopanstart
+ Event
+ Fired when the map starts autopanning when opening a popup.
+
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip is opened in the map.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip in the map is closed.
+
+
+
+
+
+Location events
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ locationerror
+ ErrorEvent
+ Fired when geolocation (using the locate method) failed.
+
+
+ locationfound
+ LocationEvent
+ Fired when geolocation (using the locate method)
+went successfully.
+
+
+
+
+
+Interaction events
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the map.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the map.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the map.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button on the map.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the map.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the map.
+
+
+ mousemove
+ MouseEvent
+ Fired while the mouse moves over the map.
+
+
+
+ keypress
+ KeyboardEvent
+ Fired when the user presses a key from the keyboard while the map is focused.
+
+
+ preclick
+ MouseEvent
+ Fired before mouse click on the map (sometimes useful when you
+want something to happen on click before any existing click
+handlers start running).
+
+
+
+
+
+Other Methods
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ zoomanim
+ ZoomAnimEvent
+ Fired on every frame of a zoom animation
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getRenderer (<Path > layer )
+ Renderer
+ Returns the instance of Renderer that should be used to render the given
+Path . It will ensure that the renderer options of the map and paths
+are respected, and that the renderers do exist on the map.
+
+
+
+
+
+
+Methods for Layers and Controls
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addControl (<Control > control )
+ this
+ Adds the given control to the map
+
+
+
+ removeControl (<Control > control )
+ this
+ Removes the given control from the map
+
+
+
+ addLayer (<Layer > layer )
+ this
+ Adds the given layer to the map
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Removes the given layer from the map.
+
+
+
+ hasLayer (<Layer > layer )
+ Boolean
+ Returns true if the given layer is currently added to the map
+
+
+
+ eachLayer (<Function> fn , <Object> context? )
+ this
+ Iterates over the layers of the map, optionally specifying context of the iterator function.
+map.eachLayer(function(layer){
+ layer.bindPopup('Hello');
+});
+
+
+
+
+
+
+ openTooltip (<Tooltip > tooltip )
+ this
+ Opens the specified tooltip.
+
+
+
+ openTooltip (<String|HTMLElement> content , <LatLng > latlng , <Tooltip options > options? )
+ this
+ Creates a tooltip with the specified content and options and open it.
+
+
+
+ closeTooltip (<Tooltip > tooltip? )
+ this
+ Closes the tooltip given as parameter.
+
+
+
+
+
+
+Methods for modifying map state
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setView (<LatLng > center , <Number> zoom , <Zoom/pan options > options? )
+ this
+ Sets the view of the map (geographical center and zoom) with the given
+animation options.
+
+
+
+ setZoom (<Number> zoom , <Zoom/pan options > options )
+ this
+ Sets the zoom of the map.
+
+
+
+ zoomIn (<Number> delta? , <Zoom options > options? )
+ this
+ Increases the zoom of the map by delta (zoomDelta by default).
+
+
+
+ zoomOut (<Number> delta? , <Zoom options > options? )
+ this
+ Decreases the zoom of the map by delta (zoomDelta by default).
+
+
+
+ setZoomAround (<LatLng > latlng , <Number> zoom , <Zoom options > options )
+ this
+ Zooms the map while keeping a specified geographical point on the map
+stationary (e.g. used internally for scroll zoom and double-click zoom).
+
+
+
+ setZoomAround (<Point > offset , <Number> zoom , <Zoom options > options )
+ this
+ Zooms the map while keeping a specified pixel on the map (relative to the top-left corner) stationary.
+
+
+
+ fitBounds (<LatLngBounds > bounds , <fitBounds options > options? )
+ this
+ Sets a map view that contains the given geographical bounds with the
+maximum zoom level possible.
+
+
+
+ fitWorld (<fitBounds options > options? )
+ this
+ Sets a map view that mostly contains the whole world with the maximum
+zoom level possible.
+
+
+
+ panTo (<LatLng > latlng , <Pan options > options? )
+ this
+ Pans the map to a given center.
+
+
+
+ panBy (<Point > offset )
+ this
+ Pans the map by a given number of pixels (animated).
+
+
+
+ flyTo (<LatLng > latlng , <Number> zoom? , <Zoom/pan options > options? )
+ this
+ Sets the view of the map (geographical center and zoom) performing a smooth
+pan-zoom animation.
+
+
+
+ flyToBounds (<LatLngBounds > bounds , <fitBounds options > options? )
+ this
+ Sets the view of the map with a smooth animation like flyTo ,
+but takes a bounds parameter like fitBounds .
+
+
+
+ setMaxBounds (<Bounds > bounds )
+ this
+ Restricts the map view to the given bounds (see the maxBounds option).
+
+
+
+ setMinZoom (<Number> zoom )
+ this
+ Sets the lower limit for the available zoom levels (see the minZoom option).
+
+
+
+ setMaxZoom (<Number> zoom )
+ this
+ Sets the upper limit for the available zoom levels (see the maxZoom option).
+
+
+
+ panInsideBounds (<LatLngBounds > bounds , <Pan options > options? )
+ this
+ Pans the map to the closest view that would lie inside the given bounds (if it's not already), controlling the animation using the options specific, if any.
+
+
+
+ invalidateSize (<Zoom/Pan options> options )
+ this
+ Checks if the map container size changed and updates the map if so —
+call it after you've changed the map size dynamically, also animating
+pan by default. If options.pan is false, panning will not occur.
+If options.debounceMoveend is true, it will delay moveend event so
+that it doesn't happen often even if the method is called many
+times in a row.
+
+
+
+ invalidateSize (<Boolean> animate )
+ this
+ Checks if the map container size changed and updates the map if so —
+call it after you've changed the map size dynamically, also animating
+pan by default.
+
+
+
+ stop ()
+ this
+ Stops the currently running panTo or flyTo animation, if any.
+
+
+
+
+
+
+Geolocation methods
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ locate (<Locate options > options? )
+ this
+ Tries to locate the user using the Geolocation API, firing a locationfound
+event with location data on success or a locationerror event on failure,
+and optionally sets the map view to the user's location with respect to
+detection accuracy (or to the world view if geolocation failed).
+Note that, if your page doesn't use HTTPS, this method will fail in
+modern browsers (Chrome 50 and newer )
+See Locate options for more details.
+
+
+
+ stopLocate ()
+ this
+ Stops watching location previously initiated by map.locate({watch: true})
+and aborts resetting the map view if map.locate was called with
+{setView: true}.
+
+
+
+
+
+
+Other Methods
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addHandler (<String> name , <Function> HandlerClass )
+ this
+ Adds a new Handler to the map, given its name and constructor function.
+
+
+
+ remove ()
+ this
+ Destroys the map and clears all related event listeners.
+
+
+
+ createPane (<String> name , <HTMLElement> container? )
+ HTMLElement
+ Creates a new map pane with the given name if it doesn't exist already,
+then returns it. The pane is created as a children of container, or
+as a children of the main map pane if not set.
+
+
+
+ getPane (<String|HTMLElement> pane )
+ HTMLElement
+ Returns a map pane , given its name or its HTML element (its identity).
+
+
+
+ getPanes ()
+ Object
+ Returns a plain object containing the names of all panes as keys and
+the panes as values.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTML element that contains the map.
+
+
+
+ whenReady (<Function> fn , <Object> context? )
+ this
+ Runs the given function fn when the map gets initialized with
+a view (center and zoom) and at least one layer, or immediately
+if it's already initialized, optionally passing a function context.
+
+
+
+
+
+
+Methods for Getting Map State
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getCenter ()
+ LatLng
+ Returns the geographical center of the map view
+
+
+
+ getZoom ()
+ Number
+ Returns the current zoom level of the map view
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the geographical bounds visible in the current map view
+
+
+
+ getMinZoom ()
+ Number
+ Returns the minimum zoom level of the map (if set in the minZoom option of the map or of any layers), or 0 by default.
+
+
+
+ getMaxZoom ()
+ Number
+ Returns the maximum zoom level of the map (if set in the maxZoom option of the map or of any layers).
+
+
+
+ getBoundsZoom (<LatLngBounds > bounds , <Boolean> inside? )
+ Number
+ Returns the maximum zoom level on which the given bounds fit to the map
+view in its entirety. If inside (optional) is set to true, the method
+instead returns the minimum zoom level on which the map view fits into
+the given bounds in its entirety.
+
+
+
+ getSize ()
+ Point
+ Returns the current size of the map container (in pixels).
+
+
+
+ getPixelBounds ()
+ Bounds
+ Returns the bounds of the current map view in projected pixel
+coordinates (sometimes useful in layer and overlay implementations).
+
+
+
+ getPixelOrigin ()
+ Point
+ Returns the projected pixel coordinates of the top left point of
+the map layer (useful in custom layer and overlay implementations).
+
+
+
+ getPixelWorldBounds (<Number> zoom? )
+ Bounds
+ Returns the world's bounds in pixel coordinates for zoom level zoom.
+If zoom is omitted, the map's current zoom level is used.
+
+
+
+
+
+
+Conversion Methods
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getZoomScale (<Number> toZoom , <Number> fromZoom )
+ Number
+ Returns the scale factor to be applied to a map transition from zoom level
+fromZoom to toZoom. Used internally to help with zoom animations.
+
+
+
+ getScaleZoom (<Number> scale , <Number> fromZoom )
+ Number
+ Returns the zoom level that the map would end up at, if it is at fromZoom
+level and everything is scaled by a factor of scale. Inverse of
+getZoomScale .
+
+
+
+ project (<LatLng > latlng , <Number> zoom )
+ Point
+ Projects a geographical coordinate LatLng according to the projection
+of the map's CRS, then scales it according to zoom and the CRS's
+Transformation . The result is pixel coordinate relative to
+the CRS origin.
+
+
+
+ unproject (<Point > point , <Number> zoom )
+ LatLng
+ Inverse of project .
+
+
+
+ layerPointToLatLng (<Point > point )
+ LatLng
+ Given a pixel coordinate relative to the origin pixel ,
+returns the corresponding geographical coordinate (for the current zoom level).
+
+
+
+ latLngToLayerPoint (<LatLng > latlng )
+ Point
+ Given a geographical coordinate, returns the corresponding pixel coordinate
+relative to the origin pixel .
+
+
+
+ wrapLatLng (<LatLng > latlng )
+ LatLng
+ Returns a LatLng where lat and lng has been wrapped according to the
+map's CRS's wrapLat and wrapLng properties, if they are outside the
+CRS's bounds.
+By default this means longitude is wrapped around the dateline so its
+value is between -180 and +180 degrees.
+
+
+
+ wrapLatLngBounds (<LatLngBounds > bounds )
+ LatLngBounds
+ Returns a LatLngBounds with the same size as the given one, ensuring that
+its center is within the CRS's bounds.
+By default this means the center longitude is wrapped around the dateline so its
+value is between -180 and +180 degrees, and the majority of the bounds
+overlaps the CRS's bounds.
+
+
+
+ distance (<LatLng > latlng1 , <LatLng > latlng2 )
+ Number
+ Returns the distance between two geographical coordinates according to
+the map's CRS. By default this measures distance in meters.
+
+
+
+ containerPointToLayerPoint (<Point > point )
+ Point
+ Given a pixel coordinate relative to the map container, returns the corresponding
+pixel coordinate relative to the origin pixel .
+
+
+
+ layerPointToContainerPoint (<Point > point )
+ Point
+ Given a pixel coordinate relative to the origin pixel ,
+returns the corresponding pixel coordinate relative to the map container.
+
+
+
+ containerPointToLatLng (<Point > point )
+ LatLng
+ Given a pixel coordinate relative to the map container, returns
+the corresponding geographical coordinate (for the current zoom level).
+
+
+
+ latLngToContainerPoint (<LatLng > latlng )
+ Point
+ Given a geographical coordinate, returns the corresponding pixel coordinate
+relative to the map container.
+
+
+
+ mouseEventToContainerPoint (<MouseEvent > ev )
+ Point
+ Given a MouseEvent object, returns the pixel coordinate relative to the
+map container where the event took place.
+
+
+
+ mouseEventToLayerPoint (<MouseEvent > ev )
+ Point
+ Given a MouseEvent object, returns the pixel coordinate relative to
+the origin pixel where the event took place.
+
+
+
+ mouseEventToLatLng (<MouseEvent > ev )
+ LatLng
+ Given a MouseEvent object, returns geographical coordinate where the
+event took place.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+
+Properties
+
+
+
+Handlers
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ boxZoom
+ Handler
+ Box (shift-drag with mouse) zoom handler.
+
+
+ doubleClickZoom
+ Handler
+ Double click zoom handler.
+
+
+ dragging
+ Handler
+ Map dragging handler (by both mouse and touch).
+
+
+ keyboard
+ Handler
+ Keyboard navigation handler.
+
+
+ scrollWheelZoom
+ Handler
+ Scroll wheel zoom handler.
+
+
+ tap
+ Handler
+ Mobile touch hacks (quick tap and touch hold) handler.
+
+
+ touchZoom
+ Handler
+ Touch zoom handler.
+
+
+
+
+
+
+
+Map panes
+
+
+
+
+
+
+
+
+
+ Pane
+ Type
+ Z-index
+ Description
+
+
+
+ mapPane
+ HTMLElement
+ 'auto'
+ Pane that contains all other map panes
+
+
+ tilePane
+ HTMLElement
+ 200
+ Pane for GridLayer s and TileLayer s
+
+
+ overlayPane
+ HTMLElement
+ 400
+ Pane for vector overlays (Path s), like Polyline s and Polygon s
+
+
+ shadowPane
+ HTMLElement
+ 500
+ Pane for overlay shadows (e.g. Marker shadows)
+
+
+ markerPane
+ HTMLElement
+ 600
+ Pane for Icon s of Marker s
+
+
+ tooltipPane
+ HTMLElement
+ 650
+ Pane for tooltip.
+
+
+
+
+
+
+
+
+
+
+Locate options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ watch
+ Boolean
+ false
+ If true, starts continuous watching of location changes (instead of detecting it
+once) using W3C watchPosition method. You can later stop watching using
+map.stopLocate() method.
+
+
+ setView
+ Boolean
+ false
+ If true, automatically sets the map view to the user location with respect to
+detection accuracy, or to world view if geolocation failed.
+
+
+ maxZoom
+ Number
+ Infinity
+ The maximum zoom for automatic view setting when using setView option.
+
+
+ timeout
+ Number
+ 10000
+ Number of milliseconds to wait for a response from geolocation before firing a
+locationerror event.
+
+
+ maximumAge
+ Number
+ 0
+ Maximum age of detected location. If less than this amount of milliseconds
+passed since last geolocation response, locate will return a cached location.
+
+
+ enableHighAccuracy
+ Boolean
+ false
+ Enables high accuracy, see description in the W3C spec .
+
+
+
+
+
+
+
+
+
+Zoom options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ animate
+ Boolean
+
+ If not specified, zoom animation will happen if the zoom origin is inside the
+current view. If true, the map will attempt animating zoom disregarding where
+zoom origin is. Setting false will make it always reset the view completely
+without animation.
+
+
+
+
+
+
+
+
+
+Pan options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ animate
+ Boolean
+
+ If true, panning will always be animated if possible. If false, it will
+not animate panning, either resetting the map view if panning more than a
+screen away, or just setting a new offset for the map pane (except for panBy
+which always does the latter).
+
+
+ duration
+ Number
+ 0.25
+ Duration of animated panning, in seconds.
+
+
+ easeLinearity
+ Number
+ 0.25
+ The curvature factor of panning animation easing (third parameter of the
+Cubic Bezier curve ). 1.0 means linear animation,
+and the smaller this number, the more bowed the curve.
+
+
+ noMoveStart
+ Boolean
+ false
+ If true, panning won't fire movestart event on start (used internally for
+panning inertia).
+
+
+
+
+
+
+
+
+
+Zoom/pan options
+
+
+
+
+
+
▶ Options inherited from Zoom options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ animate
+ Boolean
+
+ If not specified, zoom animation will happen if the zoom origin is inside the
+current view. If true, the map will attempt animating zoom disregarding where
+zoom origin is. Setting false will make it always reset the view completely
+without animation.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Pan options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ duration
+ Number
+ 0.25
+ Duration of animated panning, in seconds.
+
+
+ easeLinearity
+ Number
+ 0.25
+ The curvature factor of panning animation easing (third parameter of the
+Cubic Bezier curve ). 1.0 means linear animation,
+and the smaller this number, the more bowed the curve.
+
+
+ noMoveStart
+ Boolean
+ false
+ If true, panning won't fire movestart event on start (used internally for
+panning inertia).
+
+
+
+
+
+
+
+
+
+
+FitBounds options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ paddingTopLeft
+ Point
+ [0, 0]
+ Sets the amount of padding in the top left corner of a map container that
+shouldn't be accounted for when setting the view to fit bounds. Useful if you
+have some control overlays on the map like a sidebar and you don't want them
+to obscure objects you're zooming to.
+
+
+ paddingBottomRight
+ Point
+ [0, 0]
+ The same for the bottom right corner of the map.
+
+
+ padding
+ Point
+ [0, 0]
+ Equivalent of setting both top left and bottom right padding to the same value.
+
+
+ maxZoom
+ Number
+ null
+ The maximum possible zoom to use.
+
+
+
+
+
+
+
+
▶ Options inherited from Zoom options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ animate
+ Boolean
+
+ If not specified, zoom animation will happen if the zoom origin is inside the
+current view. If true, the map will attempt animating zoom disregarding where
+zoom origin is. Setting false will make it always reset the view completely
+without animation.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Pan options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ duration
+ Number
+ 0.25
+ Duration of animated panning, in seconds.
+
+
+ easeLinearity
+ Number
+ 0.25
+ The curvature factor of panning animation easing (third parameter of the
+Cubic Bezier curve ). 1.0 means linear animation,
+and the smaller this number, the more bowed the curve.
+
+
+ noMoveStart
+ Boolean
+ false
+ If true, panning won't fire movestart event on start (used internally for
+panning inertia).
+
+
+
+
+
+
+
+ Marker L.Marker is used to display clickable/draggable icons on the map. Extends Layer .
+
+
+Usage example
+
+
+
+
+
+
+
+L.marker([50.5, 30.5]).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.marker (<LatLng > latlng , <Marker options > options? )
+ Instantiates a Marker object given a geographical point and optionally an options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ icon
+ Icon
+ *
+ Icon class to use for rendering the marker. See Icon documentation for details on how to customize the marker icon. If not specified, a new L.Icon.Default is used.
+
+
+ draggable
+ Boolean
+ false
+ Whether the marker is draggable with mouse/touch or not.
+
+
+ keyboard
+ Boolean
+ true
+ Whether the marker can be tabbed to with a keyboard and clicked by pressing enter.
+
+
+ title
+ String
+ ''
+ Text for the browser tooltip that appear on marker hover (no tooltip by default).
+
+
+ alt
+ String
+ ''
+ Text for the alt attribute of the icon image (useful for accessibility).
+
+
+ zIndexOffset
+ Number
+ 0
+ By default, marker images zIndex is set automatically based on its latitude. Use this option if you want to put the marker on top of all others (or below), specifying a high value like 1000 (or high negative value, respectively).
+
+
+ opacity
+ Number
+ 1.0
+ The opacity of the marker.
+
+
+ riseOnHover
+ Boolean
+ false
+ If true, the marker will get on top of others when you hover the mouse over it.
+
+
+ riseOffset
+ Number
+ 250
+ The z-index offset used for the riseOnHover feature.
+
+
+ pane
+ String
+ 'markerPane'
+ Map pane where the markers icon will be added.
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ move
+ Event
+ Fired when the marker is moved via setLatLng or by dragging . Old and new coordinates are included in event arguments as oldLatLng, latlng .
+
+
+
+
+
+Dragging events
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ dragstart
+ Event
+ Fired when the user starts dragging the marker.
+
+
+ movestart
+ Event
+ Fired when the marker starts moving (because of dragging).
+
+
+ drag
+ Event
+ Fired repeatedly while the user drags the marker.
+
+
+ dragend
+ DragEndEvent
+ Fired when the user stops dragging the marker.
+
+
+ moveend
+ Event
+ Fired when the marker stops moving (because of dragging).
+
+
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the marker (as a GeoJSON Point Feature).
+
+
+
+ getLatLng ()
+ LatLng
+ Returns the current geographical position of the marker.
+
+
+
+ setLatLng (<LatLng > latlng )
+ this
+ Changes the marker position to the given point.
+
+
+
+ setZIndexOffset (<Number> offset )
+ this
+ Changes the zIndex offset of the marker.
+
+
+
+ setIcon (<Icon > icon )
+ this
+ Changes the marker icon.
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Changes the opacity of the marker.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+
+Properties
+
+
+
+Interaction handlers
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ dragging
+ Handler
+ Marker dragging handler (by both mouse and touch).
+
+
+
+
+
+
+ Used to open popups in certain places of the map. Use Map.openPopup to
+open popups while making sure that only one popup is open at one time
+(recommended for usability), or use Map.addLayer to open as many as you want.
+
+
+
+
+
+
+
+
+
+
+If you want to just bind a popup to marker click and then open it, it's really easy:
+marker.bindPopup(popupContent).openPopup();
+
+Path overlays like polylines also have a bindPopup method.
+Here's a more complicated way to open a popup on a map:
+var popup = L.popup()
+ .setLatLng(latlng)
+ .setContent('<p>Hello world!<br />This is a nice popup.</p>')
+ .openOn(map);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Options inherited from DivOverlay
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Used to display small texts on top of map layers.
+
+
+
+
+
+
+
+
+
+
+marker.bindTooltip("my tooltip text").openTooltip();
+
+Note about tooltip offset. Leaflet takes two options in consideration
+for computing tooltip offseting:
+
+the offset Tooltip option: it defaults to [0, 0], and it's specific to one tooltip.
+Add a positive x offset to move the tooltip to the right, and a positive y offset to
+move it to the bottom. Negatives will move to the left and top.
+the tooltipAnchor Icon option: this will only be considered for Marker. You
+should adapt this value if you use a custom icon.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.tooltip (<Tooltip options > options? , <Layer > source? )
+ Instantiates a Tooltip object given an optional options object that describes its appearance and location and an optional source object that is used to tag the tooltip with a reference to the Layer to which it refers.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'tooltipPane'
+ Map pane where the tooltip will be added.
+
+
+ offset
+ Point
+ Point(0, 0)
+ Optional offset of the tooltip position.
+
+
+ direction
+ String
+ 'auto'
+ Direction where to open the tooltip. Possible values are: right, left,
+top, bottom, center, auto.
+auto will dynamically switch between right and left according to the tooltip
+position on the map.
+
+
+ permanent
+ Boolean
+ false
+ Whether to open the tooltip permanently or only on mouseover.
+
+
+ sticky
+ Boolean
+ false
+ If true, the tooltip will follow the mouse instead of being fixed at the feature center.
+
+
+ interactive
+ Boolean
+ false
+ If true, the tooltip will listen to the feature events.
+
+
+ opacity
+ Number
+ 0.9
+ Tooltip container opacity.
+
+
+
+
+
+
+
+
▶ Options inherited from DivOverlay
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ className
+ String
+ ''
+ A custom CSS class name to assign to the popup.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ TileLayer Used to load and display tile layers on the map. Extends GridLayer .
+
+
+Usage example
+
+
+
+
+
+
+
+L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png?{foo}', {foo: 'bar'}).addTo(map);
+
+
+
+
+
+
+URL template
+
+
+
+A string of the following form:
+'http://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png'
+You can use custom keys in the template, which will be evaluated from TileLayer options, like this:
+L.tileLayer('http://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png', {foo: 'bar'});
+
+
+
+
+
+
+
+Creation
+
+
+
+Extension methods
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.tilelayer (<String> urlTemplate , <TileLayer options > options? )
+ Instantiates a tile layer object given a URL template and optionally an options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ minZoom
+ Number
+ 0
+ Minimum zoom number.
+
+
+ maxZoom
+ Number
+ 18
+ Maximum zoom number.
+
+
+ maxNativeZoom
+ Number
+ null
+ Maximum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels higher than maxNativeZoom will be loaded
+from maxNativeZoom level and auto-scaled.
+
+
+ minNativeZoom
+ Number
+ null
+ Minimum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels lower than minNativeZoom will be loaded
+from minNativeZoom level and auto-scaled.
+
+
+ subdomains
+ String|String[]
+ 'abc'
+ Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.
+
+
+ errorTileUrl
+ String
+ ''
+ URL to the tile image to show in place of the tile that failed to load.
+
+
+ zoomOffset
+ Number
+ 0
+ The zoom number used in tile URLs will be offset with this value.
+
+
+ tms
+ Boolean
+ false
+ If true, inverses Y axis numbering for tiles (turn this on for TMS services).
+
+
+ zoomReverse
+ Boolean
+ false
+ If set to true, the zoom number used in tile URLs will be reversed (maxZoom - zoom instead of zoom)
+
+
+ detectRetina
+ Boolean
+ false
+ If true and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.
+
+
+ crossOrigin
+ Boolean
+ false
+ If true, all tiles will have their crossOrigin attribute set to ''. This is needed if you want to access tile pixel data.
+
+
+
+
+
+
+
+
▶ Options inherited from GridLayer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ tileSize
+ Number|Point
+ 256
+ Width and height of tiles in the grid. Use a number if width and height are equal, or L.point(width, height) otherwise.
+
+
+ opacity
+ Number
+ 1.0
+ Opacity of the tiles. Can be used in the createTile() function.
+
+
+ updateWhenIdle
+ Boolean
+ depends
+ If false, new tiles are loaded during panning, otherwise only after it (for better performance). true by default on mobile browsers, otherwise false.
+
+
+ updateWhenZooming
+ Boolean
+ true
+ By default, a smooth zoom animation (during a touch zoom or a flyTo() ) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends.
+
+
+ updateInterval
+ Number
+ 200
+ Tiles will not update more than once every updateInterval milliseconds when panning.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the tile layer.
+
+
+ bounds
+ LatLngBounds
+ undefined
+ If set, tiles will only be loaded inside the set LatLngBounds .
+
+
+ noWrap
+ Boolean
+ false
+ Whether the layer is wrapped around the antimeridian. If true, the
+GridLayer will only be displayed once at low zoom levels. Has no
+effect when the map CRS doesn't wrap around. Can be used
+in combination with bounds to prevent requesting
+tiles outside the CRS limits.
+
+
+ pane
+ String
+ 'tilePane'
+ Map pane where the grid layer will be added.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the tile layer. Empty by default.
+
+
+ keepBuffer
+ Number
+ 2
+ When panning the map, keep this many rows and columns of tiles before unloading them.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from GridLayer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ loading
+ Event
+ Fired when the grid layer starts loading tiles.
+
+
+ tileunload
+ TileEvent
+ Fired when a tile is removed (e.g. when a tile goes off the screen).
+
+
+ tileloadstart
+ TileEvent
+ Fired when a tile is requested and starts loading.
+
+
+ tileerror
+ TileErrorEvent
+ Fired when there is an error loading a tile.
+
+
+ tileload
+ TileEvent
+ Fired when a tile loads.
+
+
+ load
+ Event
+ Fired when the grid layer loaded all visible tiles.
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setUrl (<String> url , <Boolean> noRedraw? )
+ this
+ Updates the layer's URL template and redraws it (unless noRedraw is set to true).
+
+
+
+ createTile (<Object> coords , <Function> done? )
+ HTMLElement
+ Called only internally, overrides GridLayer's createTile()
+to return an <img> HTML element with the appropriate image URL given coords. The done
+callback is called when the tile has been loaded.
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getTileUrl (<Object> coords )
+ String
+ Called only internally, returns the URL for a tile given its coordinates.
+Classes extending TileLayer can override this function to provide custom tile URL naming schemes.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from GridLayer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bringToFront ()
+ this
+ Brings the tile layer to the top of all tile layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the tile layer to the bottom of all tile layers.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTML element that contains the tiles for this layer.
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Changes the opacity of the grid layer.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Changes the zIndex of the grid layer.
+
+
+
+ isLoading ()
+ Boolean
+ Returns true if any tile in the grid layer has not finished loading.
+
+
+
+ redraw ()
+ this
+ Causes the layer to clear all the tiles and request them again.
+
+
+
+ getTileSize ()
+ Point
+ Normalizes the tileSize option into a point. Used by the createTile() method.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ TileLayer.WMS Used to display WMS services as tile layers on the map. Extends TileLayer .
+
+
+Usage example
+
+
+
+
+
+
+
+var nexrad = L.tileLayer.wms("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi", {
+ layers: 'nexrad-n0r-900913',
+ format: 'image/png',
+ transparent: true,
+ attribution: "Weather data © 2012 IEM Nexrad"
+});
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.tileLayer.wms (<String> baseUrl , <TileLayer.WMS options > options )
+ Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ layers
+ String
+ ''
+ (required) Comma-separated list of WMS layers to show.
+
+
+ styles
+ String
+ ''
+ Comma-separated list of WMS styles.
+
+
+ format
+ String
+ 'image/jpeg'
+ WMS image format (use 'image/png' for layers with transparency).
+
+
+ transparent
+ Boolean
+ false
+ If true, the WMS service will return images with transparency.
+
+
+ version
+ String
+ '1.1.1'
+ Version of the WMS service to use
+
+
+ crs
+ CRS
+ null
+ Coordinate Reference System to use for the WMS requests, defaults to
+map CRS. Don't change this if you're not sure what it means.
+
+
+ uppercase
+ Boolean
+ false
+ If true, WMS request parameter keys will be uppercase.
+
+
+
+
+
+
+
+
▶ Options inherited from TileLayer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ minZoom
+ Number
+ 0
+ Minimum zoom number.
+
+
+ maxZoom
+ Number
+ 18
+ Maximum zoom number.
+
+
+ maxNativeZoom
+ Number
+ null
+ Maximum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels higher than maxNativeZoom will be loaded
+from maxNativeZoom level and auto-scaled.
+
+
+ minNativeZoom
+ Number
+ null
+ Minimum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels lower than minNativeZoom will be loaded
+from minNativeZoom level and auto-scaled.
+
+
+ subdomains
+ String|String[]
+ 'abc'
+ Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.
+
+
+ errorTileUrl
+ String
+ ''
+ URL to the tile image to show in place of the tile that failed to load.
+
+
+ zoomOffset
+ Number
+ 0
+ The zoom number used in tile URLs will be offset with this value.
+
+
+ tms
+ Boolean
+ false
+ If true, inverses Y axis numbering for tiles (turn this on for TMS services).
+
+
+ zoomReverse
+ Boolean
+ false
+ If set to true, the zoom number used in tile URLs will be reversed (maxZoom - zoom instead of zoom)
+
+
+ detectRetina
+ Boolean
+ false
+ If true and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.
+
+
+ crossOrigin
+ Boolean
+ false
+ If true, all tiles will have their crossOrigin attribute set to ''. This is needed if you want to access tile pixel data.
+
+
+
+
+
+
+
+
+
▶ Options inherited from GridLayer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ tileSize
+ Number|Point
+ 256
+ Width and height of tiles in the grid. Use a number if width and height are equal, or L.point(width, height) otherwise.
+
+
+ opacity
+ Number
+ 1.0
+ Opacity of the tiles. Can be used in the createTile() function.
+
+
+ updateWhenIdle
+ Boolean
+ depends
+ If false, new tiles are loaded during panning, otherwise only after it (for better performance). true by default on mobile browsers, otherwise false.
+
+
+ updateWhenZooming
+ Boolean
+ true
+ By default, a smooth zoom animation (during a touch zoom or a flyTo() ) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends.
+
+
+ updateInterval
+ Number
+ 200
+ Tiles will not update more than once every updateInterval milliseconds when panning.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the tile layer.
+
+
+ bounds
+ LatLngBounds
+ undefined
+ If set, tiles will only be loaded inside the set LatLngBounds .
+
+
+ noWrap
+ Boolean
+ false
+ Whether the layer is wrapped around the antimeridian. If true, the
+GridLayer will only be displayed once at low zoom levels. Has no
+effect when the map CRS doesn't wrap around. Can be used
+in combination with bounds to prevent requesting
+tiles outside the CRS limits.
+
+
+ pane
+ String
+ 'tilePane'
+ Map pane where the grid layer will be added.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the tile layer. Empty by default.
+
+
+ keepBuffer
+ Number
+ 2
+ When panning the map, keep this many rows and columns of tiles before unloading them.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from GridLayer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ loading
+ Event
+ Fired when the grid layer starts loading tiles.
+
+
+ tileunload
+ TileEvent
+ Fired when a tile is removed (e.g. when a tile goes off the screen).
+
+
+ tileloadstart
+ TileEvent
+ Fired when a tile is requested and starts loading.
+
+
+ tileerror
+ TileErrorEvent
+ Fired when there is an error loading a tile.
+
+
+ tileload
+ TileEvent
+ Fired when a tile loads.
+
+
+ load
+ Event
+ Fired when the grid layer loaded all visible tiles.
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setParams (<Object> params , <Boolean> noRedraw? )
+ this
+ Merges an object with the new parameters and re-requests tiles on the current screen (unless noRedraw was set to true).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from TileLayer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setUrl (<String> url , <Boolean> noRedraw? )
+ this
+ Updates the layer's URL template and redraws it (unless noRedraw is set to true).
+
+
+
+ createTile (<Object> coords , <Function> done? )
+ HTMLElement
+ Called only internally, overrides GridLayer's createTile()
+to return an <img> HTML element with the appropriate image URL given coords. The done
+callback is called when the tile has been loaded.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from GridLayer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bringToFront ()
+ this
+ Brings the tile layer to the top of all tile layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the tile layer to the bottom of all tile layers.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTML element that contains the tiles for this layer.
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Changes the opacity of the grid layer.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Changes the zIndex of the grid layer.
+
+
+
+ isLoading ()
+ Boolean
+ Returns true if any tile in the grid layer has not finished loading.
+
+
+
+ redraw ()
+ this
+ Causes the layer to clear all the tiles and request them again.
+
+
+
+ getTileSize ()
+ Point
+ Normalizes the tileSize option into a point. Used by the createTile() method.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ ImageOverlay Used to load and display a single image over specific bounds of the map. Extends Layer .
+
+
+Usage example
+
+
+
+
+
+
+
+var imageUrl = 'http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg',
+ imageBounds = [[40.712216, -74.22655], [40.773941, -74.12544]];
+L.imageOverlay(imageUrl, imageBounds).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.imageOverlay (<String> imageUrl , <LatLngBounds > bounds , <ImageOverlay options > options? )
+ Instantiates an image overlay object given the URL of the image and the
+geographical bounds it is tied to.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ opacity
+ Number
+ 1.0
+ The opacity of the image overlay.
+
+
+ alt
+ String
+ ''
+ Text for the alt attribute of the image (useful for accessibility).
+
+
+ interactive
+ Boolean
+ false
+ If true, the image overlay will emit mouse events when clicked or hovered.
+
+
+ crossOrigin
+ Boolean
+ false
+ If true, the image will have its crossOrigin attribute set to ''. This is needed if you want to access image pixel data.
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Sets the opacity of the overlay.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all overlays.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all overlays.
+
+
+
+ setUrl (<String> url )
+ this
+ Changes the URL of the image.
+
+
+
+ setBounds (<LatLngBounds > bounds )
+ this
+ Update the bounds that this ImageOverlay covers
+
+
+
+ getBounds ()
+ LatLngBounds
+ Get the bounds that this ImageOverlay covers
+
+
+
+ getElement ()
+ HTMLElement
+ Get the img element that represents the ImageOverlay on the map
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Path An abstract class that contains options and constants shared between vector
+overlays (Polygon, Polyline, Circle). Do not use it directly. Extends Layer .
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Polyline A class for drawing polyline overlays on a map. Extends Path .
+
+
+Usage example
+
+
+
+
+
+
+
+// create a red polyline from an array of LatLng points
+var latlngs = [
+ [45.51, -122.68],
+ [37.77, -122.43],
+ [34.04, -118.2]
+];
+var polyline = L.polyline(latlngs, {color: 'red'}).addTo(map);
+// zoom the map to the polyline
+map.fitBounds(polyline.getBounds());
+
+You can also pass a multi-dimensional array to represent a MultiPolyline shape:
+// create a red polyline from an array of arrays of LatLng points
+var latlngs = [
+ [[45.51, -122.68],
+ [37.77, -122.43],
+ [34.04, -118.2]],
+ [[40.78, -73.91],
+ [41.83, -87.62],
+ [32.76, -96.72]]
+];
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.polyline (<LatLng[]> latlngs , <Polyline options > options? )
+ Instantiates a polyline object given an array of geographical points and
+optionally an options object. You can create a Polyline object with
+multiple separate lines (MultiPolyline) by passing an array of arrays
+of geographic points.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ smoothFactor
+ Number
+ 1.0
+ How much to simplify the polyline on each zoom level. More means
+better performance and smoother look, and less means more accurate representation.
+
+
+ noClip
+ Boolean
+ false
+ Disable polyline clipping.
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the polyline (as a GeoJSON LineString or MultiLineString Feature).
+
+
+
+ getLatLngs ()
+ LatLng[]
+ Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.
+
+
+
+ setLatLngs (<LatLng[]> latlngs )
+ this
+ Replaces all the points in the polyline with the given array of geographical points.
+
+
+
+ isEmpty ()
+ Boolean
+ Returns true if the Polyline has no LatLngs.
+
+
+
+ getCenter ()
+ LatLng
+ Returns the center (centroid ) of the polyline.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the path.
+
+
+
+ addLatLng (<LatLng > latlng )
+ this
+ Adds a given point to the polyline. By default, adds to the first ring of
+the polyline in case of a multi-polyline, but can be overridden by passing
+a specific ring as a LatLng array (that you can earlier access with getLatLngs ).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Polygon A class for drawing polygon overlays on a map. Extends Polyline .
+Note that points you pass when creating a polygon shouldn't have an additional last point equal to the first one — it's better to filter out such points.
+
+
+Usage example
+
+
+
+
+
+
+
+// create a red polygon from an array of LatLng points
+var latlngs = [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]];
+var polygon = L.polygon(latlngs, {color: 'red'}).addTo(map);
+// zoom the map to the polygon
+map.fitBounds(polygon.getBounds());
+
+You can also pass an array of arrays of latlngs, with the first array representing the outer shape and the other arrays representing holes in the outer shape:
+var latlngs = [
+ [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring
+ [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole
+];
+
+Additionally, you can pass a multi-dimensional array to represent a MultiPolygon shape.
+var latlngs = [
+ [ // first polygon
+ [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring
+ [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole
+ ],
+ [ // second polygon
+ [[41, -111.03],[45, -111.04],[45, -104.05],[41, -104.05]]
+ ]
+];
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.polygon (<LatLng[]> latlngs , <Polyline options > options? )
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Polyline
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ smoothFactor
+ Number
+ 1.0
+ How much to simplify the polyline on each zoom level. More means
+better performance and smoother look, and less means more accurate representation.
+
+
+ noClip
+ Boolean
+ false
+ Disable polyline clipping.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the polygon (as a GeoJSON Polygon or MultiPolygon Feature).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Polyline
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getLatLngs ()
+ LatLng[]
+ Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.
+
+
+
+ setLatLngs (<LatLng[]> latlngs )
+ this
+ Replaces all the points in the polyline with the given array of geographical points.
+
+
+
+ isEmpty ()
+ Boolean
+ Returns true if the Polyline has no LatLngs.
+
+
+
+ getCenter ()
+ LatLng
+ Returns the center (centroid ) of the polyline.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the path.
+
+
+
+ addLatLng (<LatLng > latlng )
+ this
+ Adds a given point to the polyline. By default, adds to the first ring of
+the polyline in case of a multi-polyline, but can be overridden by passing
+a specific ring as a LatLng array (that you can earlier access with getLatLngs ).
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Rectangle A class for drawing rectangle overlays on a map. Extends Polygon .
+
+
+Usage example
+
+
+
+
+
+
+
+// define rectangle geographical bounds
+var bounds = [[54.559322, -5.767822], [56.1210604, -3.021240]];
+// create an orange rectangle
+L.rectangle(bounds, {color: "#ff7800", weight: 1}).addTo(map);
+// zoom the map to the rectangle bounds
+map.fitBounds(bounds);
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Polyline
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ smoothFactor
+ Number
+ 1.0
+ How much to simplify the polyline on each zoom level. More means
+better performance and smoother look, and less means more accurate representation.
+
+
+ noClip
+ Boolean
+ false
+ Disable polyline clipping.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setBounds (<LatLngBounds > latLngBounds )
+ this
+ Redraws the rectangle with the passed bounds.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Polygon
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the polygon (as a GeoJSON Polygon or MultiPolygon Feature).
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Polyline
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getLatLngs ()
+ LatLng[]
+ Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.
+
+
+
+ setLatLngs (<LatLng[]> latlngs )
+ this
+ Replaces all the points in the polyline with the given array of geographical points.
+
+
+
+ isEmpty ()
+ Boolean
+ Returns true if the Polyline has no LatLngs.
+
+
+
+ getCenter ()
+ LatLng
+ Returns the center (centroid ) of the polyline.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the path.
+
+
+
+ addLatLng (<LatLng > latlng )
+ this
+ Adds a given point to the polyline. By default, adds to the first ring of
+the polyline in case of a multi-polyline, but can be overridden by passing
+a specific ring as a LatLng array (that you can earlier access with getLatLngs ).
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Circle A class for drawing circle overlays on a map. Extends CircleMarker .
+It's an approximation and starts to diverge from a real circle closer to poles (due to projection distortion).
+
+
+Usage example
+
+
+
+
+
+
+
+L.circle([50.5, 30.5], {radius: 200}).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.circle (<LatLng > latlng , <Circle options > options? )
+ Instantiates a circle object given a geographical point, and an options object
+which contains the circle radius.
+
+
+ L.circle (<LatLng > latlng , <Number> radius , <Circle options > options? )
+ Obsolete way of instantiating a circle, for compatibility with 0.7.x code.
+Do not use in new applications or plugins.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ radius
+ Number
+
+ Radius of the circle, in meters.
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setRadius (<Number> radius )
+ this
+ Sets the radius of a circle. Units are in meters.
+
+
+
+ getRadius ()
+ Number
+ Returns the current radius of a circle. Units are in meters.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the path.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from CircleMarker
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the circle marker (as a GeoJSON Point Feature).
+
+
+
+ setLatLng (<LatLng > latLng )
+ this
+ Sets the position of a circle marker to a new location.
+
+
+
+ getLatLng ()
+ LatLng
+ Returns the current geographical position of the circle marker
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ CircleMarker A circle of a fixed size with radius specified in pixels. Extends Path .
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.circleMarker (<LatLng > latlng , <CircleMarker options > options? )
+ Instantiates a circle marker object given a geographical point, and an optional options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ radius
+ Number
+ 10
+ Radius of the circle marker, in pixels
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the circle marker (as a GeoJSON Point Feature).
+
+
+
+ setLatLng (<LatLng > latLng )
+ this
+ Sets the position of a circle marker to a new location.
+
+
+
+ getLatLng ()
+ LatLng
+ Returns the current geographical position of the circle marker
+
+
+
+ setRadius (<Number> radius )
+ this
+ Sets the radius of a circle marker. Units are in pixels.
+
+
+
+ getRadius ()
+ Number
+ Returns the current radius of the circle
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ SVG Although SVG is not available on IE7 and IE8, these browsers support VML , and the SVG renderer will fall back to VML in this case.
+VML was deprecated in 2012, which means VML functionality exists only for backwards compatibility
+with old versions of Internet Explorer.
+
Allows vector layers to be displayed with SVG .
+Inherits Renderer .
+Due to technical limitations , SVG is not
+available in all web browsers, notably Android 2.x and 3.x.
+Although SVG is not available on IE7 and IE8, these browsers support
+VML
+(a now deprecated technology), and the SVG renderer will fall back to VML in
+this case.
+
+
+Usage example
+
+
+
+
+
+
+
+Use SVG by default for all paths in the map:
+var map = L.map('map', {
+ renderer: L.svg()
+});
+
+Use a SVG renderer with extra padding for specific vector geometries:
+var map = L.map('map');
+var myRenderer = L.svg({ padding: 0.5 });
+var line = L.polyline( coordinates, { renderer: myRenderer } );
+var circle = L.circle( center, { renderer: myRenderer } );
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.svg (<Renderer options > options? )
+ Creates a SVG renderer with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Renderer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ padding
+ Number
+ 0.1
+ How much to extend the clip area around the map view (relative to its size)
+e.g. 0.1 would be 10% of map view in each direction
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Renderer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ update
+ Event
+ Fired when the renderer updates its bounds, center and zoom, for example when
+its map has moved
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+
+Functions
+
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ create (<String> name )
+ SVGElement
+ Returns a instance of SVGElement ,
+corresponding to the class name passed. For example, using 'line' will return
+an instance of SVGLineElement .
+
+
+ pointsToPath (<Point[]> rings , <Boolean> closed )
+ String
+ Generates a SVG path string for multiple rings, with each ring turning
+into "M..L..L.." instructions
+
+
+
+
+
+
+ Canvas Allows vector layers to be displayed with <canvas> .
+Inherits Renderer .
+Due to technical limitations , Canvas is not
+available in all web browsers, notably IE8, and overlapping geometries might
+not display properly in some edge cases.
+
+
+Usage example
+
+
+
+
+
+
+
+Use Canvas by default for all paths in the map:
+var map = L.map('map', {
+ renderer: L.canvas()
+});
+
+Use a Canvas renderer with extra padding for specific vector geometries:
+var map = L.map('map');
+var myRenderer = L.canvas({ padding: 0.5 });
+var line = L.polyline( coordinates, { renderer: myRenderer } );
+var circle = L.circle( center, { renderer: myRenderer } );
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.canvas (<Renderer options > options? )
+ Creates a Canvas renderer with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Renderer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ padding
+ Number
+ 0.1
+ How much to extend the clip area around the map view (relative to its size)
+e.g. 0.1 would be 10% of map view in each direction
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Renderer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ update
+ Event
+ Fired when the renderer updates its bounds, center and zoom, for example when
+its map has moved
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ LayerGroup Used to group several layers and handle them as one. If you add it to the map,
+any layers added or removed from the group will be added/removed on the map as
+well. Extends Layer .
+
+
+Usage example
+
+
+
+
+
+
+
+L.layerGroup([marker1, marker2])
+ .addLayer(polyline)
+ .addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.layerGroup (<Layer[]> layers )
+ Create a layer group, optionally given an initial set of layers.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the layer group (as a GeoJSON GeometryCollection).
+
+
+
+ addLayer (<Layer > layer )
+ this
+ Adds the given layer to the group.
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Removes the given layer from the group.
+
+
+
+ removeLayer (<Number> id )
+ this
+ Removes the layer with the given internal ID from the group.
+
+
+
+ hasLayer (<Layer > layer )
+ Boolean
+ Returns true if the given layer is currently added to the group.
+
+
+
+ clearLayers ()
+ this
+ Removes all the layers from the group.
+
+
+
+ invoke (<String> methodName , … )
+ this
+ Calls methodName on every layer contained in this group, passing any
+additional parameters. Has no effect if the layers contained do not
+implement methodName.
+
+
+
+ eachLayer (<Function> fn , <Object> context? )
+ this
+ Iterates over the layers of the group, optionally specifying context of the iterator function.
+group.eachLayer(function (layer) {
+ layer.bindPopup('Hello');
+});
+
+
+
+
+ getLayer (<Number> id )
+ Layer
+ Returns the layer with the given internal ID.
+
+
+
+ getLayers ()
+ Layer[]
+ Returns an array of all the layers added to the group.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Calls setZIndex on every layer contained in this group, passing the z-index.
+
+
+
+ getLayerId (<Layer > layer )
+ Number
+ Returns the internal ID for a layer
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ FeatureGroup Extended LayerGroup that makes it easier to do the same thing to all its member layers:
+
+bindPopup binds a popup to all of the layers at once (likewise with bindTooltip )
+Events are propagated to the FeatureGroup , so if the group has an event
+handler, it will handle events from any of the layers. This includes mouse events
+and custom events.
+Has layeradd and layerremove events
+
+
+
+Usage example
+
+
+
+
+
+
+
+L.featureGroup([marker1, marker2, polyline])
+ .bindPopup('Hello world!')
+ .on('click', function() { alert('Clicked on a member of the group!'); })
+ .addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.featureGroup (<Layer[]> layers )
+ Create a feature group, optionally given an initial set of layers.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setStyle (<Path options > style )
+ this
+ Sets the given path options to each layer of the group that has a setStyle method.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer group to the top of all other layers
+
+
+
+ bringToBack ()
+ this
+ Brings the layer group to the back of all other layers
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from LayerGroup
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the layer group (as a GeoJSON GeometryCollection).
+
+
+
+ addLayer (<Layer > layer )
+ this
+ Adds the given layer to the group.
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Removes the given layer from the group.
+
+
+
+ removeLayer (<Number> id )
+ this
+ Removes the layer with the given internal ID from the group.
+
+
+
+ hasLayer (<Layer > layer )
+ Boolean
+ Returns true if the given layer is currently added to the group.
+
+
+
+ clearLayers ()
+ this
+ Removes all the layers from the group.
+
+
+
+ invoke (<String> methodName , … )
+ this
+ Calls methodName on every layer contained in this group, passing any
+additional parameters. Has no effect if the layers contained do not
+implement methodName.
+
+
+
+ eachLayer (<Function> fn , <Object> context? )
+ this
+ Iterates over the layers of the group, optionally specifying context of the iterator function.
+group.eachLayer(function (layer) {
+ layer.bindPopup('Hello');
+});
+
+
+
+
+ getLayer (<Number> id )
+ Layer
+ Returns the layer with the given internal ID.
+
+
+
+ getLayers ()
+ Layer[]
+ Returns an array of all the layers added to the group.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Calls setZIndex on every layer contained in this group, passing the z-index.
+
+
+
+ getLayerId (<Layer > layer )
+ Number
+ Returns the internal ID for a layer
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ GeoJSON Represents a GeoJSON object or an array of GeoJSON objects. Allows you to parse
+GeoJSON data and display it on the map. Extends FeatureGroup .
+
+
+Usage example
+
+
+
+
+
+
+
+L.geoJSON(data, {
+ style: function (feature) {
+ return {color: feature.properties.color};
+ }
+}).bindPopup(function (layer) {
+ return layer.feature.properties.description;
+}).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.geoJSON (<Object> geojson? , <GeoJSON options > options? )
+ Creates a GeoJSON layer. Optionally accepts an object in
+GeoJSON format to display on the map
+(you can alternatively add it later with addData method) and an options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pointToLayer
+ Function
+ *
+ A Function defining how GeoJSON points spawn Leaflet layers. It is internally
+called when data is added, passing the GeoJSON point feature and its LatLng .
+The default is to spawn a default Marker :
+function(geoJsonPoint, latlng) {
+ return L.marker(latlng);
+}
+
+
+
+ style
+ Function
+ *
+ A Function defining the Path options for styling GeoJSON lines and polygons,
+called internally when data is added.
+The default value is to not override any defaults:
+function (geoJsonFeature) {
+ return {}
+}
+
+
+
+ onEachFeature
+ Function
+ *
+ A Function that will be called once for each created Feature, after it has
+been created and styled. Useful for attaching events and popups to features.
+The default is to do nothing with the newly created layers:
+function (feature, layer) {}
+
+
+
+ filter
+ Function
+ *
+ A Function that will be used to decide whether to include a feature or not.
+The default is to include all features:
+function (geoJsonFeature) {
+ return true;
+}
+
+Note: dynamically changing the filter option will have effect only on newly
+added data. It will not re-evaluate already included features.
+
+
+ coordsToLatLng
+ Function
+ *
+ A Function that will be used for converting GeoJSON coordinates to LatLng s.
+The default is the coordsToLatLng static method.
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addData (data )
+ this
+ Adds a GeoJSON object to the layer.
+
+
+
+ resetStyle (layer )
+ this
+ Resets the given vector layer's style to the original GeoJSON style, useful for resetting style after hover events.
+
+
+
+ setStyle (style )
+ this
+ Changes styles of GeoJSON vector layers with the given style function.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from FeatureGroup
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bringToFront ()
+ this
+ Brings the layer group to the top of all other layers
+
+
+
+ bringToBack ()
+ this
+ Brings the layer group to the back of all other layers
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from LayerGroup
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the layer group (as a GeoJSON GeometryCollection).
+
+
+
+ addLayer (<Layer > layer )
+ this
+ Adds the given layer to the group.
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Removes the given layer from the group.
+
+
+
+ removeLayer (<Number> id )
+ this
+ Removes the layer with the given internal ID from the group.
+
+
+
+ hasLayer (<Layer > layer )
+ Boolean
+ Returns true if the given layer is currently added to the group.
+
+
+
+ clearLayers ()
+ this
+ Removes all the layers from the group.
+
+
+
+ invoke (<String> methodName , … )
+ this
+ Calls methodName on every layer contained in this group, passing any
+additional parameters. Has no effect if the layers contained do not
+implement methodName.
+
+
+
+ eachLayer (<Function> fn , <Object> context? )
+ this
+ Iterates over the layers of the group, optionally specifying context of the iterator function.
+group.eachLayer(function (layer) {
+ layer.bindPopup('Hello');
+});
+
+
+
+
+ getLayer (<Number> id )
+ Layer
+ Returns the layer with the given internal ID.
+
+
+
+ getLayers ()
+ Layer[]
+ Returns an array of all the layers added to the group.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Calls setZIndex on every layer contained in this group, passing the z-index.
+
+
+
+ getLayerId (<Layer > layer )
+ Number
+ Returns the internal ID for a layer
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+
+Functions
+
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ geometryToLayer (<Object> featureData , <GeoJSON options > options? )
+ Layer
+ Creates a Layer from a given GeoJSON feature. Can use a custom
+pointToLayer and/or coordsToLatLng
+functions if provided as options.
+
+
+ coordsToLatLng (<Array> coords )
+ LatLng
+ Creates a LatLng object from an array of 2 numbers (longitude, latitude)
+or 3 numbers (longitude, latitude, altitude) used in GeoJSON for points.
+
+
+ coordsToLatLngs (<Array> coords , <Number> levelsDeep? , <Function> coordsToLatLng? )
+ Array
+ Creates a multidimensional array of LatLng s from a GeoJSON coordinates array.
+levelsDeep specifies the nesting level (0 is for an array of points, 1 for an array of arrays of points, etc., 0 by default).
+Can use a custom coordsToLatLng function.
+
+
+ latLngToCoords (<LatLng > latlng )
+ Array
+ Reverse of coordsToLatLng
+
+
+ latLngsToCoords (<Array> latlngs , <Number> levelsDeep? , <Boolean> closed? )
+ Array
+ Reverse of coordsToLatLngs
+closed determines whether the first point should be appended to the end of the array to close the feature, only used when levelsDeep is 0. False by default.
+
+
+ asFeature (<Object> geojson )
+ Object
+ Normalize GeoJSON geometries/features into GeoJSON features.
+
+
+
+
+
+
+ GridLayer Generic class for handling a tiled grid of HTML elements. This is the base class for all tile layers and replaces TileLayer.Canvas.
+GridLayer can be extended to create a tiled grid of HTML elements like <canvas>, <img> or <div>. GridLayer will handle creating and animating these DOM elements for you.
+
+
+Usage example
+
+
+
+Synchronous usage
+
+
+
+To create a custom layer, extend GridLayer and implement the createTile() method, which will be passed a Point object with the x, y, and z (zoom level) coordinates to draw your tile.
+var CanvasLayer = L.GridLayer.extend({
+ createTile: function(coords){
+ // create a <canvas> element for drawing
+ var tile = L.DomUtil.create('canvas', 'leaflet-tile');
+ // setup tile width and height according to the options
+ var size = this.getTileSize();
+ tile.width = size.x;
+ tile.height = size.y;
+ // get a canvas context and draw something on it using coords.x, coords.y and coords.z
+ var ctx = tile.getContext('2d');
+ // return the tile so it can be rendered on screen
+ return tile;
+ }
+});
+
+
+
+
+
+
+Asynchronous usage
+
+
+
+Tile creation can also be asynchronous, this is useful when using a third-party drawing library. Once the tile is finished drawing it can be passed to the done() callback.
+var CanvasLayer = L.GridLayer.extend({
+ createTile: function(coords, done){
+ var error;
+ // create a <canvas> element for drawing
+ var tile = L.DomUtil.create('canvas', 'leaflet-tile');
+ // setup tile width and height according to the options
+ var size = this.getTileSize();
+ tile.width = size.x;
+ tile.height = size.y;
+ // draw something asynchronously and pass the tile to the done() callback
+ setTimeout(function() {
+ done(error, tile);
+ }, 1000);
+ return tile;
+ }
+});
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.gridLayer (<GridLayer options > options? )
+ Creates a new instance of GridLayer with the supplied options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ tileSize
+ Number|Point
+ 256
+ Width and height of tiles in the grid. Use a number if width and height are equal, or L.point(width, height) otherwise.
+
+
+ opacity
+ Number
+ 1.0
+ Opacity of the tiles. Can be used in the createTile() function.
+
+
+ updateWhenIdle
+ Boolean
+ depends
+ If false, new tiles are loaded during panning, otherwise only after it (for better performance). true by default on mobile browsers, otherwise false.
+
+
+ updateWhenZooming
+ Boolean
+ true
+ By default, a smooth zoom animation (during a touch zoom or a flyTo() ) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends.
+
+
+ updateInterval
+ Number
+ 200
+ Tiles will not update more than once every updateInterval milliseconds when panning.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the tile layer.
+
+
+ bounds
+ LatLngBounds
+ undefined
+ If set, tiles will only be loaded inside the set LatLngBounds .
+
+
+ minZoom
+ Number
+ 0
+ The minimum zoom level that tiles will be loaded at. By default the entire map.
+
+
+ maxZoom
+ Number
+ undefined
+ The maximum zoom level that tiles will be loaded at.
+
+
+ noWrap
+ Boolean
+ false
+ Whether the layer is wrapped around the antimeridian. If true, the
+GridLayer will only be displayed once at low zoom levels. Has no
+effect when the map CRS doesn't wrap around. Can be used
+in combination with bounds to prevent requesting
+tiles outside the CRS limits.
+
+
+ pane
+ String
+ 'tilePane'
+ Map pane where the grid layer will be added.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the tile layer. Empty by default.
+
+
+ keepBuffer
+ Number
+ 2
+ When panning the map, keep this many rows and columns of tiles before unloading them.
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ loading
+ Event
+ Fired when the grid layer starts loading tiles.
+
+
+ tileunload
+ TileEvent
+ Fired when a tile is removed (e.g. when a tile goes off the screen).
+
+
+ tileloadstart
+ TileEvent
+ Fired when a tile is requested and starts loading.
+
+
+ tileerror
+ TileErrorEvent
+ Fired when there is an error loading a tile.
+
+
+ tileload
+ TileEvent
+ Fired when a tile loads.
+
+
+ load
+ Event
+ Fired when the grid layer loaded all visible tiles.
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bringToFront ()
+ this
+ Brings the tile layer to the top of all tile layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the tile layer to the bottom of all tile layers.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTML element that contains the tiles for this layer.
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Changes the opacity of the grid layer.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Changes the zIndex of the grid layer.
+
+
+
+ isLoading ()
+ Boolean
+ Returns true if any tile in the grid layer has not finished loading.
+
+
+
+ redraw ()
+ this
+ Causes the layer to clear all the tiles and request them again.
+
+
+
+ getTileSize ()
+ Point
+ Normalizes the tileSize option into a point. Used by the createTile() method.
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ createTile (<Object> coords , <Function> done? )
+ HTMLElement
+ Called only internally, must be overridden by classes extending GridLayer .
+Returns the HTMLElement corresponding to the given coords. If the done callback
+is specified, it must be called when the tile has finished loading and drawing.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ LatLng Represents a geographical point with a certain latitude and longitude.
+
+
+Usage example
+
+
+
+
+
+
+
+var latlng = L.latLng(50.5, 30.5);
+All Leaflet methods that accept LatLng objects also accept them in a simple Array form and simple object form (unless noted otherwise), so these lines are equivalent:
+map.panTo([50, 30]);
+map.panTo({lon: 30, lat: 50});
+map.panTo({lat: 50, lng: 30});
+map.panTo(L.latLng(50, 30));
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.latLng (<Number> latitude , <Number> longitude , <Number> altitude? )
+ Creates an object representing a geographical point with the given latitude and longitude (and optionally altitude).
+
+
+ L.latLng (<Array> coords )
+ Expects an array of the form [Number, Number] or [Number, Number, Number] instead.
+
+
+ L.latLng (<Object> coords )
+ Expects an plain object of the form {lat: Number, lng: Number} or {lat: Number, lng: Number, alt: Number} instead.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ equals (<LatLng > otherLatLng , <Number> maxMargin? )
+ Boolean
+ Returns true if the given LatLng point is at the same position (within a small margin of error). The margin of error can be overridden by setting maxMargin to a small number.
+
+
+
+ toString ()
+ String
+ Returns a string representation of the point (for debugging purposes).
+
+
+
+ distanceTo (<LatLng > otherLatLng )
+ Number
+ Returns the distance (in meters) to the given LatLng calculated using the Haversine formula .
+
+
+
+ wrap ()
+ LatLng
+ Returns a new LatLng object with the longitude wrapped so it's always between -180 and +180 degrees.
+
+
+
+ toBounds (<Number> sizeInMeters )
+ LatLngBounds
+ Returns a new LatLngBounds object in which each boundary is sizeInMeters/2 meters apart from the LatLng .
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ lat
+ Number
+ Latitude in degrees
+
+
+ lng
+ Number
+ Longitude in degrees
+
+
+ alt
+ Number
+ Altitude in meters (optional)
+
+
+
+
+
+
+ LatLngBounds Represents a rectangular geographical area on a map.
+
+
+Usage example
+
+
+
+
+
+
+
+var corner1 = L.latLng(40.712, -74.227),
+corner2 = L.latLng(40.774, -74.125),
+bounds = L.latLngBounds(corner1, corner2);
+
+All Leaflet methods that accept LatLngBounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:
+map.fitBounds([
+ [40.712, -74.227],
+ [40.774, -74.125]
+]);
+
+Caution: if the area crosses the antimeridian (often confused with the International Date Line), you must specify corners outside the [-180, 180] degrees longitude range.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.latLngBounds (<LatLng > corner1 , <LatLng > corner2 )
+ Creates a LatLngBounds object by defining two diagonally opposite corners of the rectangle.
+
+
+ L.latLngBounds (<LatLng[]> latlngs )
+ Creates a LatLngBounds object defined by the geographical points it contains. Very useful for zooming the map to fit a particular set of locations with fitBounds .
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ extend (<LatLng > latlng )
+ this
+ Extend the bounds to contain the given point
+
+
+
+ extend (<LatLngBounds > otherBounds )
+ this
+ Extend the bounds to contain the given bounds
+
+
+
+ pad (<Number> bufferRatio )
+ LatLngBounds
+ Returns bigger bounds created by extending the current bounds by a given percentage in each direction.
+
+
+
+ getCenter ()
+ LatLng
+ Returns the center point of the bounds.
+
+
+
+ getSouthWest ()
+ LatLng
+ Returns the south-west point of the bounds.
+
+
+
+ getNorthEast ()
+ LatLng
+ Returns the north-east point of the bounds.
+
+
+
+ getNorthWest ()
+ LatLng
+ Returns the north-west point of the bounds.
+
+
+
+ getSouthEast ()
+ LatLng
+ Returns the south-east point of the bounds.
+
+
+
+ getWest ()
+ Number
+ Returns the west longitude of the bounds
+
+
+
+ getSouth ()
+ Number
+ Returns the south latitude of the bounds
+
+
+
+ getEast ()
+ Number
+ Returns the east longitude of the bounds
+
+
+
+ getNorth ()
+ Number
+ Returns the north latitude of the bounds
+
+
+
+ contains (<LatLngBounds > otherBounds )
+ Boolean
+ Returns true if the rectangle contains the given one.
+
+
+
+ contains (<LatLng > latlng )
+ Boolean
+ Returns true if the rectangle contains the given point.
+
+
+
+ intersects (<LatLngBounds > otherBounds )
+ Boolean
+ Returns true if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common.
+
+
+
+ overlaps (<Bounds > otherBounds )
+ Boolean
+ Returns true if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area.
+
+
+
+ toBBoxString ()
+ String
+ Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format. Useful for sending requests to web services that return geo data.
+
+
+
+ equals (<LatLngBounds > otherBounds )
+ Boolean
+ Returns true if the rectangle is equivalent (within a small margin of error) to the given bounds.
+
+
+
+ isValid ()
+ Boolean
+ Returns true if the bounds are properly initialized.
+
+
+
+
+
+
+
+ Point Represents a point with x and y coordinates in pixels.
+
+
+Usage example
+
+
+
+
+
+
+
+var point = L.point(200, 300);
+
+All Leaflet methods and options that accept Point objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent:
+map.panBy([200, 300]);
+map.panBy(L.point(200, 300));
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.point (<Number> x , <Number> y , <Boolean> round? )
+ Creates a Point object with the given x and y coordinates. If optional round is set to true, rounds the x and y values.
+
+
+ L.point (<Number[]> coords )
+ Expects an array of the form [x, y] instead.
+
+
+ L.point (<Object> coords )
+ Expects a plain object of the form {x: Number, y: Number} instead.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ clone ()
+ Point
+ Returns a copy of the current point.
+
+
+
+ add (<Point > otherPoint )
+ Point
+ Returns the result of addition of the current and the given points.
+
+
+
+ subtract (<Point > otherPoint )
+ Point
+ Returns the result of subtraction of the given point from the current.
+
+
+
+ divideBy (<Number> num )
+ Point
+ Returns the result of division of the current point by the given number.
+
+
+
+ multiplyBy (<Number> num )
+ Point
+ Returns the result of multiplication of the current point by the given number.
+
+
+
+ scaleBy (<Point > scale )
+ Point
+ Multiply each coordinate of the current point by each coordinate of
+scale. In linear algebra terms, multiply the point by the
+scaling matrix
+defined by scale.
+
+
+
+ unscaleBy (<Point > scale )
+ Point
+ Inverse of scaleBy. Divide each coordinate of the current point by
+each coordinate of scale.
+
+
+
+ round ()
+ Point
+ Returns a copy of the current point with rounded coordinates.
+
+
+
+ floor ()
+ Point
+ Returns a copy of the current point with floored coordinates (rounded down).
+
+
+
+ ceil ()
+ Point
+ Returns a copy of the current point with ceiled coordinates (rounded up).
+
+
+
+ distanceTo (<Point > otherPoint )
+ Number
+ Returns the cartesian distance between the current and the given points.
+
+
+
+ equals (<Point > otherPoint )
+ Boolean
+ Returns true if the given point has the same coordinates.
+
+
+
+ contains (<Point > otherPoint )
+ Boolean
+ Returns true if both coordinates of the given point are less than the corresponding current point coordinates (in absolute values).
+
+
+
+ toString ()
+ String
+ Returns a string representation of the point for debugging purposes.
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ x
+ Number
+ The x coordinate of the point
+
+
+ y
+ Number
+ The y coordinate of the point
+
+
+
+
+
+
+ Bounds Represents a rectangular area in pixel coordinates.
+
+
+Usage example
+
+
+
+
+
+
+
+var p1 = L.point(10, 10),
+p2 = L.point(40, 60),
+bounds = L.bounds(p1, p2);
+
+All Leaflet methods that accept Bounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:
+otherBounds.intersects([[10, 10], [40, 60]]);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.bounds (<Point > topLeft , <Point > bottomRight )
+ Creates a Bounds object from two coordinates (usually top-left and bottom-right corners).
+
+
+ L.bounds (<Point[]> points )
+ Creates a Bounds object from the points it contains
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ extend (<Point > point )
+ this
+ Extends the bounds to contain the given point.
+
+
+
+ getCenter (<Boolean> round? )
+ Point
+ Returns the center point of the bounds.
+
+
+
+ getBottomLeft ()
+ Point
+ Returns the bottom-left point of the bounds.
+
+
+
+ getTopRight ()
+ Point
+ Returns the top-right point of the bounds.
+
+
+
+ getSize ()
+ Point
+ Returns the size of the given bounds
+
+
+
+ contains (<Bounds > otherBounds )
+ Boolean
+ Returns true if the rectangle contains the given one.
+
+
+
+ contains (<Point > point )
+ Boolean
+ Returns true if the rectangle contains the given point.
+
+
+
+ intersects (<Bounds > otherBounds )
+ Boolean
+ Returns true if the rectangle intersects the given bounds. Two bounds
+intersect if they have at least one point in common.
+
+
+
+ overlaps (<Bounds > otherBounds )
+ Boolean
+ Returns true if the rectangle overlaps the given bounds. Two bounds
+overlap if their intersection is an area.
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ min
+ Point
+ The top left corner of the rectangle.
+
+
+ max
+ Point
+ The bottom right corner of the rectangle.
+
+
+
+
+
+
+ Icon Represents an icon to provide when creating a marker.
+
+
+Usage example
+
+
+
+
+
+
+
+var myIcon = L.icon({
+ iconUrl: 'my-icon.png',
+ iconSize: [38, 95],
+ iconAnchor: [22, 94],
+ popupAnchor: [-3, -76],
+ shadowUrl: 'my-icon-shadow.png',
+ shadowSize: [68, 95],
+ shadowAnchor: [22, 94]
+});
+L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
+
+L.Icon.Default extends L.Icon and is the blue icon Leaflet uses for markers by default.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.icon (<Icon options > options )
+ Creates an icon instance with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ iconUrl
+ String
+ null
+ (required) The URL to the icon image (absolute or relative to your script path).
+
+
+ iconRetinaUrl
+ String
+ null
+ The URL to a retina sized version of the icon image (absolute or relative to your
+script path). Used for Retina screen devices.
+
+
+ iconSize
+ Point
+ null
+ Size of the icon image in pixels.
+
+
+ iconAnchor
+ Point
+ null
+ The coordinates of the "tip" of the icon (relative to its top left corner). The icon
+will be aligned so that this point is at the marker's geographical location. Centered
+by default if size is specified, also can be set in CSS with negative margins.
+
+
+
+ shadowUrl
+ String
+ null
+ The URL to the icon shadow image. If not specified, no shadow image will be created.
+
+
+ shadowRetinaUrl
+ String
+ null
+
+
+
+ shadowSize
+ Point
+ null
+ Size of the shadow image in pixels.
+
+
+ shadowAnchor
+ Point
+ null
+ The coordinates of the "tip" of the shadow (relative to its top left corner) (the same
+as iconAnchor if not specified).
+
+
+ className
+ String
+ ''
+ A custom class name to assign to both icon and shadow images. Empty by default.
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ createIcon (<HTMLElement> oldIcon? )
+ HTMLElement
+ Called internally when the icon has to be shown, returns a <img> HTML element
+styled according to the options.
+
+
+
+ createShadow (<HTMLElement> oldIcon? )
+ HTMLElement
+ As createIcon, but for the shadow beneath it.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+
+
+
+Icon.Default
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ imagePath
+ String
+
+ L.Icon.Default will try to auto-detect the absolute location of the
+blue icon images. If you are placing these images in a non-standard
+way, set this option to point to the right absolute path.
+
+
+
+
+
+
+ DivIcon Represents a lightweight icon for markers that uses a simple <div>
+element instead of an image. Inherits from Icon but ignores the iconUrl and shadow options.
+
+
+Usage example
+
+
+
+
+
+
+
+var myIcon = L.divIcon({className: 'my-div-icon'});
+// you can set .my-div-icon styles in CSS
+L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
+
+By default, it has a 'leaflet-div-icon' CSS class and is styled as a little white square with a shadow.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.divIcon (<DivIcon options > options )
+ Creates a DivIcon instance with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ html
+ String
+ ''
+ Custom HTML code to put inside the div element, empty by default.
+
+
+ bgPos
+ Point
+ [0, 0]
+ Optional relative position of the background, in pixels
+
+
+
+
+
+
+
+
▶ Options inherited from Icon
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ iconUrl
+ String
+ null
+ (required) The URL to the icon image (absolute or relative to your script path).
+
+
+ iconRetinaUrl
+ String
+ null
+ The URL to a retina sized version of the icon image (absolute or relative to your
+script path). Used for Retina screen devices.
+
+
+ iconSize
+ Point
+ null
+ Size of the icon image in pixels.
+
+
+ iconAnchor
+ Point
+ null
+ The coordinates of the "tip" of the icon (relative to its top left corner). The icon
+will be aligned so that this point is at the marker's geographical location. Centered
+by default if size is specified, also can be set in CSS with negative margins.
+
+
+
+ shadowUrl
+ String
+ null
+ The URL to the icon shadow image. If not specified, no shadow image will be created.
+
+
+ shadowRetinaUrl
+ String
+ null
+
+
+
+ shadowSize
+ Point
+ null
+ Size of the shadow image in pixels.
+
+
+ shadowAnchor
+ Point
+ null
+ The coordinates of the "tip" of the shadow (relative to its top left corner) (the same
+as iconAnchor if not specified).
+
+
+ className
+ String
+ ''
+ A custom class name to assign to both icon and shadow images. Empty by default.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Icon
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ createIcon (<HTMLElement> oldIcon? )
+ HTMLElement
+ Called internally when the icon has to be shown, returns a <img> HTML element
+styled according to the options.
+
+
+
+ createShadow (<HTMLElement> oldIcon? )
+ HTMLElement
+ As createIcon, but for the shadow beneath it.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Control.Zoom A basic zoom control with two buttons (zoom in and zoom out). It is put on the map by default unless you set its zoomControl option to false. Extends Control .
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.control.zoom (<Control.Zoom options > options )
+ Creates a zoom control
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ zoomInText
+ String
+ '+'
+ The text set on the 'zoom in' button.
+
+
+ zoomInTitle
+ String
+ 'Zoom in'
+ The title set on the 'zoom in' button.
+
+
+ zoomOutText
+ String
+ '-'
+ The text set on the 'zoom out' button.
+
+
+ zoomOutTitle
+ String
+ 'Zoom out'
+ The title set on the 'zoom out' button.
+
+
+
+
+
+
+
+
▶ Options inherited from Control
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Control
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+
+
+ Control.Attribution The attribution control allows you to display attribution data in a small text box on a map. It is put on the map by default unless you set its attributionControl option to false, and it fetches attribution texts from layers with the getAttribution method automatically. Extends Control.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ prefix
+ String
+ 'Leaflet'
+ The HTML text shown before the attributions. Pass false to disable.
+
+
+
+
+
+
+
+
▶ Options inherited from Control
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setPrefix (<String> prefix )
+ this
+ Sets the text before the attributions.
+
+
+
+ addAttribution (<String> text )
+ this
+ Adds an attribution text (e.g. 'Vector data © Mapbox').
+
+
+
+ removeAttribution (<String> text )
+ this
+ Removes an attribution text.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Control
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+
+
+ Control.Layers The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the detailed example ). Extends Control .
+
+
+Usage example
+
+
+
+
+
+
+
+var baseLayers = {
+ "Mapbox": mapbox,
+ "OpenStreetMap": osm
+};
+var overlays = {
+ "Marker": marker,
+ "Roads": roadsLayer
+};
+L.control.layers(baseLayers, overlays).addTo(map);
+
+The baseLayers and overlays parameters are object literals with layer names as keys and Layer objects as values:
+{
+ "<someName1>": layer1,
+ "<someName2>": layer2
+}
+
+The layer names can contain HTML, which allows you to add additional styling to the items:
+{"<img src='my-layer-icon' /> <span class='my-layer-item'>My Layer</span>": myLayer}
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.control.layers (<Object> baselayers? , <Object> overlays? , <Control.Layers options > options? )
+ Creates an attribution control with the given layers. Base layers will be switched with radio buttons, while overlays will be switched with checkboxes. Note that all base layers should be passed in the base layers object, but only one should be added to the map during map instantiation.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ collapsed
+ Boolean
+ true
+ If true, the control will be collapsed into an icon and expanded on mouse hover or touch.
+
+
+ autoZIndex
+ Boolean
+ true
+ If true, the control will assign zIndexes in increasing order to all of its layers so that the order is preserved when switching them on/off.
+
+
+ hideSingleBase
+ Boolean
+ false
+ If true, the base layers in the control will be hidden when there is only one.
+
+
+ sortLayers
+ Boolean
+ false
+ Whether to sort the layers. When false, layers will keep the order
+in which they were added to the control.
+
+
+ sortFunction
+ Function
+ *
+ A compare function
+that will be used for sorting the layers, when sortLayers is true.
+The function receives both the L.Layer instances and their names, as in
+sortFunction(layerA, layerB, nameA, nameB).
+By default, it sorts layers alphabetically by their name.
+
+
+
+
+
+
+
+
▶ Options inherited from Control
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addBaseLayer (<Layer > layer , <String> name )
+ this
+ Adds a base layer (radio button entry) with the given name to the control.
+
+
+
+ addOverlay (<Layer > layer , <String> name )
+ this
+ Adds an overlay (checkbox entry) with the given name to the control.
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Remove the given layer from the control.
+
+
+
+ expand ()
+ this
+ Expand the control container if collapsed.
+
+
+
+ collapse ()
+ this
+ Collapse the control container if expanded.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Control
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+
+
+ Control.Scale A simple scale control that shows the scale of the current center of screen in metric (m/km) and imperial (mi/ft) systems. Extends Control .
+
+
+Usage example
+
+
+
+
+
+
+
+L.control.scale().addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.control.scale (<Control.Scale options > options? )
+ Creates an scale control with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ maxWidth
+ Number
+ 100
+ Maximum width of the control in pixels. The width is set dynamically to show round values (e.g. 100, 200, 500).
+
+
+ metric
+ Boolean
+ True
+ Whether to show the metric scale line (m/km).
+
+
+ imperial
+ Boolean
+ True
+ Whether to show the imperial scale line (mi/ft).
+
+
+ updateWhenIdle
+ Boolean
+ false
+ If true, the control is updated on moveend , otherwise it's always up-to-date (updated on move ).
+
+
+
+
+
+
+
+
▶ Options inherited from Control
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Control
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+
+
+ Browser A namespace with static properties for browser/feature detection used by Leaflet internally.
+
+
+Usage example
+
+
+
+
+
+
+
+if (L.Browser.ielt9) {
+ alert('Upgrade your browser, dude!');
+}
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ ie
+ Boolean
+ true for all Internet Explorer versions (not Edge).
+
+
+ ielt9
+ Boolean
+ true for Internet Explorer versions less than 9.
+
+
+ edge
+ Boolean
+ true for the Edge web browser.
+
+
+ webkit
+ Boolean
+ true for webkit-based browsers like Chrome and Safari (including mobile versions).
+
+
+ gecko
+ Boolean
+ true for gecko-based browsers like Firefox.
+
+
+ android
+ Boolean
+ true for any browser running on an Android platform.
+
+
+ android23
+ Boolean
+ true for browsers running on Android 2 or Android 3.
+
+
+ chrome
+ Boolean
+ true for the Chrome browser.
+
+
+ safari
+ Boolean
+ true for the Safari browser.
+
+
+ win
+ Boolean
+ true when the browser is running in a Windows platform
+
+
+ ie3d
+ Boolean
+ true for all Internet Explorer versions supporting CSS transforms.
+
+
+ webkit3d
+ Boolean
+ true for webkit-based browsers supporting CSS transforms.
+
+
+ gecko3d
+ Boolean
+ true for gecko-based browsers supporting CSS transforms.
+
+
+ opera12
+ Boolean
+ true for the Opera browser supporting CSS transforms (version 12 or later).
+
+
+ any3d
+ Boolean
+ true for all browsers supporting CSS transforms.
+
+
+ mobile
+ Boolean
+ true for all browsers running in a mobile device.
+
+
+ mobileWebkit
+ Boolean
+ true for all webkit-based browsers in a mobile device.
+
+
+ mobileWebkit3d
+ Boolean
+ true for all webkit-based browsers in a mobile device supporting CSS transforms.
+
+
+ mobileOpera
+ Boolean
+ true for the Opera browser in a mobile device.
+
+
+ mobileGecko
+ Boolean
+ true for gecko-based browsers running in a mobile device.
+
+
+ touch
+ Boolean
+ true for all browsers supporting touch events .
+This does not necessarily mean that the browser is running in a computer with
+a touchscreen, it only means that the browser is capable of understanding
+touch events.
+
+
+ msPointer
+ Boolean
+ true for browsers implementing the Microsoft touch events model (notably IE10).
+
+
+ pointer
+ Boolean
+ true for all browsers supporting pointer events .
+
+
+ retina
+ Boolean
+ true for browsers on a high-resolution "retina" screen.
+
+
+ canvas
+ Boolean
+ true when the browser supports <canvas> .
+
+
+ vml
+ Boolean
+ true if the browser supports VML .
+
+
+ svg
+ Boolean
+ true when the browser supports SVG .
+
+
+
+
+
+
+ Util Various utility functions, used by Leaflet internally.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ extend (<Object> dest , <Object> src? )
+ Object
+ Merges the properties of the src object (or multiple objects) into dest object and returns the latter. Has an L.extend shortcut.
+
+
+ create (<Object> proto , <Object> properties? )
+ Object
+ Compatibility polyfill for Object.create
+
+
+ bind (<Function> fn , … )
+ Function
+ Returns a new function bound to the arguments passed, like Function.prototype.bind .
+Has a L.bind() shortcut.
+
+
+ stamp (<Object> obj )
+ Number
+ Returns the unique ID of an object, assigning it one if it doesn't have it.
+
+
+ throttle (<Function> fn , <Number> time , <Object> context )
+ Function
+ Returns a function which executes function fn with the given scope context
+(so that the this keyword refers to context inside fn's code). The function
+fn will be called no more than one time per given amount of time. The arguments
+received by the bound function will be any arguments passed when binding the
+function, followed by any arguments passed when invoking the bound function.
+Has an L.bind shortcut.
+
+
+ wrapNum (<Number> num , <Number[]> range , <Boolean> includeMax? )
+ Number
+ Returns the number num modulo range in such a way so it lies within
+range[0] and range[1]. The returned value will be always smaller than
+range[1] unless includeMax is set to true.
+
+
+ falseFn ()
+ Function
+ Returns a function which always returns false.
+
+
+ formatNum (<Number> num , <Number> digits? )
+ Number
+ Returns the number num rounded to digits decimals, or to 5 decimals by default.
+
+
+ trim (<String> str )
+ String
+ Compatibility polyfill for String.prototype.trim
+
+
+ splitWords (<String> str )
+ String[]
+ Trims and splits the string on whitespace and returns the array of parts.
+
+
+ setOptions (<Object> obj , <Object> options )
+ Object
+ Merges the given properties to the options of the obj object, returning the resulting options. See Class options. Has an L.setOptions shortcut.
+
+
+ getParamString (<Object> obj , <String> existingUrl? , <Boolean> uppercase? )
+ String
+ Converts an object into a parameter URL string, e.g. {a: "foo", b: "bar"}
+translates to '?a=foo&b=bar'. If existingUrl is set, the parameters will
+be appended at the end. If uppercase is true, the parameter names will
+be uppercased (e.g. '?A=foo&B=bar')
+
+
+ template (<String> str , <Object> data )
+ String
+ Simple templating facility, accepts a template string of the form 'Hello {a}, {b}'
+and a data object like {a: 'foo', b: 'bar'}, returns evaluated string
+('Hello foo, bar'). You can also specify functions instead of strings for
+data values — they will be evaluated passing data as an argument.
+
+
+ isArray (obj )
+ Boolean
+ Compatibility polyfill for Array.isArray
+
+
+ indexOf (<Array> array , <Object> el )
+ Number
+ Compatibility polyfill for Array.prototype.indexOf
+
+
+ requestAnimFrame (<Function> fn , <Object> context? , <Boolean> immediate? )
+ Number
+ Schedules fn to be executed when the browser repaints. fn is bound to
+context if given. When immediate is set, fn is called immediately if
+the browser doesn't have native support for
+window.requestAnimationFrame ,
+otherwise it's delayed. Returns a request ID that can be used to cancel the request.
+
+
+ cancelAnimFrame (<Number> id )
+ undefined
+ Cancels a previous requestAnimFrame. See also window.cancelAnimationFrame .
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ lastId
+ Number
+ Last unique ID used by stamp()
+
+
+ emptyImageUrl
+ String
+ Data URI string containing a base64-encoded empty GIF image.
+Used as a hack to free memory from unused images on WebKit-powered
+mobile devices (by setting image src to this string).
+
+
+
+
+
+
+ Represents an affine transformation: a set of coefficients a, b, c, d
+for transforming a point of a form (x, y) into (a*x + b, c*y + d) and doing
+the reverse. Used by Leaflet in its projections code.
+
+
+
+
+
+
+
+
+
+
+var transformation = new L.Transformation(2, 5, -1, 10),
+ p = L.point(1, 2),
+ p2 = transformation.transform(p), // L.point(7, 8)
+ p3 = transformation.untransform(p2); // L.point(1, 2)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ transform (<Point > point , <Number> scale? )
+ Point
+ Returns a transformed point, optionally multiplied by the given scale.
+Only accepts actual L.Point instances, not arrays.
+
+
+
+ untransform (<Point > point , <Number> scale? )
+ Point
+ Returns the reverse transformation of the given point, optionally divided
+by the given scale. Only accepts actual L.Point instances, not arrays.
+
+
+
+
+
+
+
+ LineUtil Various utility functions for polyline points processing, used by Leaflet internally to make polylines lightning-fast.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ simplify (<Point[]> points , <Number> tolerance )
+ Point[]
+ Dramatically reduces the number of points in a polyline while retaining
+its shape and returns a new array of simplified points, using the
+Douglas-Peucker algorithm .
+Used for a huge performance boost when processing/displaying Leaflet polylines for
+each zoom level and also reducing visual noise. tolerance affects the amount of
+simplification (lesser value means higher quality but slower and with more points).
+Also released as a separated micro-library Simplify.js .
+
+
+ pointToSegmentDistance (<Point > p , <Point > p1 , <Point > p2 )
+ Number
+ Returns the distance between point p and segment p1 to p2.
+
+
+ closestPointOnSegment (<Point > p , <Point > p1 , <Point > p2 )
+ Number
+ Returns the closest point from a point p on a segment p1 to p2.
+
+
+ clipSegment (<Point > a , <Point > b , <Bounds > bounds , <Boolean> useLastCode? , <Boolean> round? )
+ Point[]|Boolean
+ Clips the segment a to b by rectangular bounds with the
+Cohen-Sutherland algorithm
+(modifying the segment points directly!). Used by Leaflet to only show polyline
+points that are on the screen or near, increasing performance.
+
+
+
+
+
+
+ PolyUtil Various utility functions for polygon geometries.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ clipPolygon (<Point[]> points , <Bounds > bounds , <Boolean> round? )
+ Point[]
+ Clips the polygon geometry defined by the given points by the given bounds (using the Sutherland-Hodgeman algorithm ).
+Used by Leaflet to only show polygon points that are on the screen or near, increasing
+performance. Note that polygon points needs different algorithm for clipping
+than polyline, so there's a separate method for it.
+
+
+
+
+
+
+ DomEvent Utility functions to work with the DOM events , used by Leaflet internally.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ on (<HTMLElement> el , <String> types , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular DOM event type of the
+element el. You can optionally specify the context of the listener
+(object the this keyword will point to). You can also pass several
+space-separated types (e.g. 'click dblclick').
+
+
+ on (<HTMLElement> el , <Object> eventMap , <Object> context? )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+ off (<HTMLElement> el , <String> types , <Function> fn , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified,
+it will remove all the listeners of that particular DOM event from the element.
+Note that if you passed a custom context to on, you must pass the same
+context to off in order to remove the listener.
+
+
+ off (<HTMLElement> el , <Object> eventMap , <Object> context? )
+ this
+ Removes a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+ stopPropagation (<DOMEvent> ev )
+ this
+ Stop the given event from propagation to parent elements. Used inside the listener functions:
+L.DomEvent.on(div, 'click', function (ev) {
+ L.DomEvent.stopPropagation(ev);
+});
+
+
+
+ disableScrollPropagation (<HTMLElement> el )
+ this
+ Adds stopPropagation to the element's 'mousewheel' events (plus browser variants).
+
+
+ disableClickPropagation (<HTMLElement> el )
+ this
+ Adds stopPropagation to the element's 'click', 'doubleclick',
+'mousedown' and 'touchstart' events (plus browser variants).
+
+
+ preventDefault (<DOMEvent> ev )
+ this
+ Prevents the default action of the DOM Event ev from happening (such as
+following a link in the href of the a element, or doing a POST request
+with page reload when a <form> is submitted).
+Use it inside listener functions.
+
+
+ stop (ev )
+ this
+ Does stopPropagation and preventDefault at the same time.
+
+
+ getMousePosition (<DOMEvent> ev , <HTMLElement> container? )
+ Point
+ Gets normalized mouse position from a DOM event relative to the
+container or to the whole page if not specified.
+
+
+ getWheelDelta (<DOMEvent> ev )
+ Number
+ Gets normalized wheel delta from a mousewheel DOM event, in vertical
+pixels scrolled (negative if scrolling down).
+Events from pointing devices without precise scrolling are mapped to
+a best guess of 60 pixels.
+
+
+ addListener (… )
+ this
+ Alias to L.DomEvent.on
+
+
+ removeListener (… )
+ this
+ Alias to L.DomEvent.off
+
+
+
+
+
+
+ DomUtil Utility functions to work with the DOM
+tree, used by Leaflet internally.
+Most functions expecting or returning a HTMLElement also work for
+SVG elements. The only difference is that classes refer to CSS classes
+in HTML and SVG classes in SVG.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ get (<String|HTMLElement> id )
+ HTMLElement
+ Returns an element given its DOM id, or returns the element itself
+if it was passed directly.
+
+
+ getStyle (<HTMLElement> el , <String> styleAttrib )
+ String
+ Returns the value for a certain style attribute on an element,
+including computed values or values set through CSS.
+
+
+ create (<String> tagName , <String> className? , <HTMLElement> container? )
+ HTMLElement
+ Creates an HTML element with tagName, sets its class to className, and optionally appends it to container element.
+
+
+ remove (<HTMLElement> el )
+
+ Removes el from its parent element
+
+
+ empty (<HTMLElement> el )
+
+ Removes all of el's children elements from el
+
+
+ toFront (<HTMLElement> el )
+
+ Makes el the last children of its parent, so it renders in front of the other children.
+
+
+ toBack (<HTMLElement> el )
+
+ Makes el the first children of its parent, so it renders back from the other children.
+
+
+ hasClass (<HTMLElement> el , <String> name )
+ Boolean
+ Returns true if the element's class attribute contains name.
+
+
+ addClass (<HTMLElement> el , <String> name )
+
+ Adds name to the element's class attribute.
+
+
+ removeClass (<HTMLElement> el , <String> name )
+
+ Removes name from the element's class attribute.
+
+
+ setClass (<HTMLElement> el , <String> name )
+
+ Sets the element's class.
+
+
+ getClass (<HTMLElement> el )
+ String
+ Returns the element's class.
+
+
+ setOpacity (<HTMLElement> el , <Number> opacity )
+
+ Set the opacity of an element (including old IE support).
+opacity must be a number from 0 to 1.
+
+
+ testProp (<String[]> props )
+ String|false
+ Goes through the array of style names and returns the first name
+that is a valid style name for an element. If no such name is found,
+it returns false. Useful for vendor-prefixed styles like transform.
+
+
+ setTransform (<HTMLElement> el , <Point > offset , <Number> scale? )
+
+ Resets the 3D CSS transform of el so it is translated by offset pixels
+and optionally scaled by scale. Does not have an effect if the
+browser doesn't support 3D CSS transforms.
+
+
+ setPosition (<HTMLElement> el , <Point > position )
+
+ Sets the position of el to coordinates specified by position,
+using CSS translate or top/left positioning depending on the browser
+(used by Leaflet internally to position its layers).
+
+
+ getPosition (<HTMLElement> el )
+ Point
+ Returns the coordinates of an element previously positioned with setPosition.
+
+
+ disableTextSelection ()
+
+ Prevents the user from generating selectstart DOM events, usually generated
+when the user drags the mouse through a page with text. Used internally
+by Leaflet to override the behaviour of any click-and-drag interaction on
+the map. Affects drag interactions on the whole document.
+
+
+ enableTextSelection ()
+
+ Cancels the effects of a previous L.DomUtil.disableTextSelection .
+
+
+ disableImageDrag ()
+
+ As L.DomUtil.disableTextSelection , but
+for dragstart DOM events, usually generated when the user drags an image.
+
+
+ enableImageDrag ()
+
+ Cancels the effects of a previous L.DomUtil.disableImageDrag .
+
+
+ preventOutline (<HTMLElement> el )
+
+ Makes the outline
+of the element el invisible. Used internally by Leaflet to prevent
+focusable elements from displaying an outline when the user performs a
+drag interaction on them.
+
+
+ restoreOutline ()
+
+ Cancels the effects of a previous L.DomUtil.preventOutline .
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ TRANSFORM
+ String
+ Vendor-prefixed fransform style name (e.g. 'webkitTransform' for WebKit).
+
+
+ TRANSITION
+ String
+ Vendor-prefixed transform style name.
+
+
+
+
+
+
+ PosAnimation Used internally for panning animations, utilizing CSS3 Transitions for modern browsers and a timer fallback for IE6-9.
+
+
+Usage example
+
+
+
+
+
+
+
+var fx = new L.PosAnimation();
+fx.run(el, [300, 500], 0.5);
+
+
+
+
+
+
+
+
+Constructor
+
+
+
+
+
+
+
+
+ Constructor
+ Description
+
+
+
+ L.PosAnimation ()
+ Creates a PosAnimation object.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ start
+ Event
+ Fired when the animation starts
+
+
+ step
+ Event
+ Fired continuously during the animation.
+
+
+ end
+ Event
+ Fired when the animation ends.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ run (<HTMLElement> el , <Point > newPos , <Number> duration? , <Number> easeLinearity? )
+
+ Run an animation of a given element to a new position, optionally setting
+duration in seconds (0.25 by default) and easing linearity factor (3rd
+argument of the cubic bezier curve ,
+0.5 by default).
+
+
+
+ stop ()
+
+ Stops the animation (if currently running).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Draggable A class for making DOM elements draggable (including touch support).
+Used internally for map and marker dragging. Only works for elements
+that were positioned with L.DomUtil.setPosition .
+
+
+Usage example
+
+
+
+
+
+
+
+var draggable = new L.Draggable(elementToDrag);
+draggable.enable();
+
+
+
+
+
+
+
+
+Constructor
+
+
+
+
+
+
+
+
+ Constructor
+ Description
+
+
+
+ L.Draggable (<HTMLElement> el , <HTMLElement> dragHandle? , <Boolean> preventOutline )
+ Creates a Draggable object for moving el when you start dragging the dragHandle element (equals el itself by default).
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ clickTolerance
+ Number
+ 3
+ The max number of pixels a user can shift the mouse pointer during a click
+for it to be considered a valid click (as opposed to a mouse drag).
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ down
+ Event
+ Fired when a drag is about to start.
+
+
+ dragstart
+ Event
+ Fired when a drag starts
+
+
+ predrag
+ Event
+ Fired continuously during dragging before each corresponding
+update of the element's position.
+
+
+ drag
+ Event
+ Fired continuously during dragging.
+
+
+ dragend
+ DragEndEvent
+ Fired when the drag ends.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ enable ()
+
+ Enables the dragging ability
+
+
+
+ disable ()
+
+ Disables the dragging ability
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Class L.Class powers the OOP facilities of Leaflet and is used to create almost all of the Leaflet classes documented here.
+In addition to implementing a simple classical inheritance model, it introduces several special properties for convenient code organization — options, includes and statics.
+
+
+Usage example
+
+
+
+
+
+
+
+var MyClass = L.Class.extend({
+initialize: function (greeter) {
+ this.greeter = greeter;
+ // class constructor
+},
+greet: function (name) {
+ alert(this.greeter + ', ' + name)
+ }
+});
+// create instance of MyClass, passing "Hello" to the constructor
+var a = new MyClass("Hello");
+// call greet method, alerting "Hello, World"
+a.greet("World");
+
+
+
+
+
+
+Class Factories
+
+
+
+You may have noticed that Leaflet objects are created without using
+the new keyword. This is achieved by complementing each class with a
+lowercase factory method:
+new L.Map('map'); // becomes:
+L.map('map');
+
+The factories are implemented very easily, and you can do this for your own classes:
+L.map = function (id, options) {
+ return new L.Map(id, options);
+};
+
+
+
+
+
+
+Inheritance
+
+
+
+You use L.Class.extend to define new classes, but you can use the same method on any class to inherit from it:
+var MyChildClass = MyClass.extend({
+ // ... new properties and methods
+});
+
+This will create a class that inherits all methods and properties of the parent class (through a proper prototype chain), adding or overriding the ones you pass to extend. It will also properly react to instanceof:
+var a = new MyChildClass();
+a instanceof MyChildClass; // true
+a instanceof MyClass; // true
+
+You can call parent methods (including constructor) from corresponding child ones (as you do with super calls in other languages) by accessing parent class prototype and using JavaScript's call or apply:
+var MyChildClass = MyClass.extend({
+ initialize: function () {
+ MyClass.prototype.initialize.call(this, "Yo");
+ },
+ greet: function (name) {
+ MyClass.prototype.greet.call(this, 'bro ' + name + '!');
+ }
+});
+var a = new MyChildClass();
+a.greet('Jason'); // alerts "Yo, bro Jason!"
+
+
+
+
+
+Options
+
+
+
+options is a special property that unlike other objects that you pass
+to extend will be merged with the parent one instead of overriding it
+completely, which makes managing configuration of objects and default
+values convenient:
+var MyClass = L.Class.extend({
+ options: {
+ myOption1: 'foo',
+ myOption2: 'bar'
+ }
+});
+var MyChildClass = MyClass.extend({
+ options: {
+ myOption1: 'baz',
+ myOption3: 5
+ }
+});
+var a = new MyChildClass();
+a.options.myOption1; // 'baz'
+a.options.myOption2; // 'bar'
+a.options.myOption3; // 5
+
+There's also L.Util.setOptions , a method for
+conveniently merging options passed to constructor with the defaults
+defines in the class:
+var MyClass = L.Class.extend({
+ options: {
+ foo: 'bar',
+ bla: 5
+ },
+ initialize: function (options) {
+ L.Util.setOptions(this, options);
+ ...
+ }
+});
+var a = new MyClass({bla: 10});
+a.options; // {foo: 'bar', bla: 10}
+
+
+
+
+
+
+Includes
+
+
+
+includes is a special class property that merges all specified objects into the class (such objects are called mixins).
+ var MyMixin = {
+ foo: function () { ... },
+ bar: 5
+};
+var MyClass = L.Class.extend({
+ includes: MyMixin
+});
+var a = new MyClass();
+a.foo();
+
+You can also do such includes in runtime with the include method:
+MyClass.include(MyMixin);
+
+statics is just a convenience property that injects specified object properties as the static properties of the class, useful for defining constants:
+var MyClass = L.Class.extend({
+ statics: {
+ FOO: 'bar',
+ BLA: 5
+ }
+});
+MyClass.FOO; // 'bar'
+
+
+
+
+
+
+Constructor hooks
+
+
+
+If you're a plugin developer, you often need to add additional initialization code to existing classes (e.g. editing hooks for L.Polyline ). Leaflet comes with a way to do it easily using the addInitHook method:
+MyClass.addInitHook(function () {
+ // ... do something in constructor additionally
+ // e.g. add event listeners, set custom properties etc.
+});
+
+You can also use the following shortcut when you just need to make one additional method call:
+MyClass.addInitHook('methodName', arg1, arg2, …);
+
+
+
+
+
+
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ extend (<Object> props )
+ Function
+ Extends the current class given the properties to be included.
+Returns a Javascript function that is a class constructor (to be called with new).
+
+
+ include (<Object> properties )
+ this
+ Includes a mixin into the current class.
+
+
+ mergeOptions (<Object> options )
+ this
+ Merges options into the defaults of the class.
+
+
+ addInitHook (<Function> fn )
+ this
+ Adds a constructor hook to the class.
+
+
+
+
+
+
+ Evented A set of methods shared between event-powered classes (like Map and Marker ). Generally, events allow you to execute some function when something happens with an object (e.g. the user clicks on the map, causing the map to fire 'click' event).
+
+
+Usage example
+
+
+
+
+
+
+
+map.on('click', function(e) {
+ alert(e.latlng);
+} );
+
+Leaflet deals with event listeners by reference, so if you want to add a listener and then remove it, define it as a function:
+function onClick(e) { ... }
+map.on('click', onClick);
+map.off('click', onClick);
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+ Layer A set of methods from the Layer base class that all Leaflet layers use.
+Inherits all methods, options and events from L.Evented .
+
+
+Usage example
+
+
+
+
+
+
+
+var layer = L.Marker(latlng).addTo(map);
+layer.addTo(map);
+layer.remove();
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ onAdd (<Map > map )
+ this
+ Should contain code that creates DOM elements for the layer, adds them to map panes where they should belong and puts listeners on relevant map events. Called on map.addLayer(layer) .
+
+
+
+ onRemove (<Map > map )
+ this
+ Should contain all clean up code that removes the layer's elements from the DOM and removes listeners previously added in onAdd . Called on map.removeLayer(layer) .
+
+
+
+ getEvents ()
+ Object
+ This optional method should return an object like { viewreset: this._reset } for addEventListener . The event handlers in this object will be automatically added and removed from the map with your layer.
+
+
+
+ getAttribution ()
+ String
+ This optional method should return a string containing HTML to be shown on the Attribution control whenever the layer is visible.
+
+
+
+ beforeAdd (<Map > map )
+ this
+ Optional method. Called on map.addLayer(layer) , before the layer is added to the map, before events are initialized, without waiting until the map is in a usable state. Use for early initialization only.
+
+
+
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Interactive layer Some Layer s can be made interactive - when the user interacts
+with such a layer, mouse events like click and mouseover can be handled.
+Use the event handling methods to handle these events.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+Mouse events
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Control L.Control is a base class for implementing map controls. Handles positioning.
+All other controls extend from this class.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ onAdd (<Map > map )
+ HTMLElement
+ Should return the container DOM element for the control and add listeners on relevant map events. Called on control.addTo(map) .
+
+
+
+ onRemove (<Map > map )
+
+ Optional method. Should contain all clean up code that removes the listeners previously added in onAdd . Called on control.remove() .
+
+
+
+
+
+
+
+ Handler Abstract class for map interaction handlers
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ enable ()
+ this
+ Enables the handler
+
+
+
+ disable ()
+ this
+ Disables the handler
+
+
+
+ enabled ()
+ Boolean
+ Returns true if the handler is enabled
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addHooks ()
+
+ Called when the handler is enabled, should add event hooks.
+
+
+
+ removeHooks ()
+
+ Called when the handler is disabled, should remove the event hooks added previously.
+
+
+
+
+
+
+
+ Projection An object with methods for projecting geographical coordinates of the world onto
+a flat surface (and back). See Map projection .
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ project (<LatLng > latlng )
+ Point
+ Projects geographical coordinates into a 2D point. Only accepts actual L.LatLng instances, not arrays.
+
+
+
+ unproject (<Point > point )
+ LatLng
+ The inverse of project. Projects a 2D point into a geographical location. Only accepts actual L.Point instances, not arrays.
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ bounds
+ Bounds
+ The bounds (specified in CRS units) where the projection is valid
+
+
+
+
+
+
+
+Defined projections
+
+
+
+
+
+
+
+
+
+ Projection
+ Description
+
+
+
+ L.Projection.LonLat
+ Equirectangular, or Plate Carree projection — the most simple projection,
+mostly used by GIS enthusiasts. Directly maps x as longitude, and y as
+latitude. Also suitable for flat worlds, e.g. game maps. Used by the
+EPSG:3395 and Simple CRS.
+
+
+ L.Projection.Mercator
+ Elliptical Mercator projection — more complex than Spherical Mercator. Takes into account that Earth is a geoid, not a perfect sphere. Used by the EPSG:3395 CRS.
+
+
+ L.Projection.SphericalMercator
+ Spherical Mercator projection — the most common projection for online maps,
+used by almost all free and commercial tile providers. Assumes that Earth is
+a sphere. Used by the EPSG:3857 CRS.
+
+
+
+
+
+
+ CRS Abstract class that defines coordinate reference systems for projecting
+geographical points into pixel (screen) coordinates and back (and to
+coordinates in other units for WMS services). See
+spatial reference system .
+Leaflet defines the most usual CRSs by default. If you want to use a
+CRS not defined by default, take a look at the
+Proj4Leaflet plugin.
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ latLngToPoint (<LatLng > latlng , <Number> zoom )
+ Point
+ Projects geographical coordinates into pixel coordinates for a given zoom.
+
+
+
+ pointToLatLng (<Point > point , <Number> zoom )
+ LatLng
+ The inverse of latLngToPoint. Projects pixel coordinates on a given
+zoom into geographical coordinates.
+
+
+
+ project (<LatLng > latlng )
+ Point
+ Projects geographical coordinates into coordinates in units accepted for
+this CRS (e.g. meters for EPSG:3857, for passing it to WMS services).
+
+
+
+ unproject (<Point > point )
+ LatLng
+ Given a projected coordinate returns the corresponding LatLng.
+The inverse of project.
+
+
+
+ scale (<Number> zoom )
+ Number
+ Returns the scale used when transforming projected coordinates into
+pixel coordinates for a particular zoom. For example, it returns
+256 * 2^zoom for Mercator-based CRS.
+
+
+
+ zoom (<Number> scale )
+ Number
+ Inverse of scale(), returns the zoom level corresponding to a scale
+factor of scale.
+
+
+
+ getProjectedBounds (<Number> zoom )
+ Bounds
+ Returns the projection's bounds scaled and transformed for the provided zoom.
+
+
+
+ distance (<LatLng > latlng1 , <LatLng > latlng2 )
+ Number
+ Returns the distance between two geographical coordinates.
+
+
+
+ wrapLatLng (<LatLng > latlng )
+ LatLng
+ Returns a LatLng where lat and lng has been wrapped according to the
+CRS's wrapLat and wrapLng properties, if they are outside the CRS's bounds.
+Only accepts actual L.LatLng instances, not arrays.
+
+
+
+ wrapLatLngBounds (<LatLngBounds > bounds )
+ LatLngBounds
+ Returns a LatLngBounds with the same size as the given one, ensuring
+that its center is within the CRS's bounds.
+Only accepts actual L.LatLngBounds instances, not arrays.
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ code
+ String
+ Standard code name of the CRS passed into WMS services (e.g. 'EPSG:3857')
+
+
+ wrapLng
+ Number[]
+ An array of two numbers defining whether the longitude (horizontal) coordinate
+axis wraps around a given range and how. Defaults to [-180, 180] in most
+geographical CRSs. If undefined, the longitude axis does not wrap around.
+
+
+ wrapLat
+ Number[]
+ Like wrapLng, but for the latitude (vertical) axis.
+
+
+ infinite
+ Boolean
+ If true, the coordinate space will be unbounded (infinite in both axes)
+
+
+
+
+
+
+
+Defined CRSs
+
+
+
+
+
+
+
+
+ CRS
+ Description
+
+
+
+ L.CRS.EPSG3395
+ Rarely used by some commercial tile providers. Uses Elliptical Mercator projection.
+
+
+ L.CRS.EPSG3857
+ The most common CRS for online maps, used by almost all free and commercial
+tile providers. Uses Spherical Mercator projection. Set in by default in
+Map's crs option.
+
+
+ L.CRS.EPSG4326
+ A common CRS among GIS enthusiasts. Uses simple Equirectangular projection.
+Leaflet 1.0.x complies with the TMS coordinate scheme for EPSG:4326 ,
+which is a breaking change from 0.7.x behaviour. If you are using a TileLayer
+with this CRS, ensure that there are two 256x256 pixel tiles covering the
+whole earth at zoom level zero, and that the tile coordinate origin is (-180,+90),
+or (-180,-90) for TileLayers with the tms option set.
+
+
+ L.CRS.Earth
+ Serves as the base for CRS that are global such that they cover the earth.
+Can only be used as the base for other CRS and cannot be used directly,
+since it does not have a code, projection or transformation . distance() returns
+meters.
+
+
+ L.CRS.Simple
+ A simple CRS that maps longitude and latitude into x and y directly.
+May be used for maps of flat surfaces (e.g. game maps). Note that the y
+axis should still be inverted (going from bottom to top). distance() returns
+simple euclidean distance.
+
+
+
+
+
+
+ Renderer Base class for vector renderer implementations (SVG , Canvas ). Handles the
+DOM container of the renderer, its bounds, and its zoom animation.
+A Renderer works as an implicit layer group for all Path s - the renderer
+itself can be added or removed to the map. All paths use a renderer, which can
+be implicit (the map will decide the type of renderer and use it automatically)
+or explicit (using the renderer option of the path).
+Do not use this class directly, use SVG and Canvas instead.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ padding
+ Number
+ 0.1
+ How much to extend the clip area around the map view (relative to its size)
+e.g. 0.1 would be 10% of map view in each direction
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ update
+ Event
+ Fired when the renderer updates its bounds, center and zoom, for example when
+its map has moved
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Event objects Whenever a class inheriting from Evented fires an event, a listener function
+will be called with an event argument, which is a plain object containing
+information about the event. For example:
+
map.on('click', function(ev) {
+ alert(ev.latlng); // ev is an event object (MouseEvent in this case)
+});
+
+
The information available depends on the event type:
+
+
+
+
+Event
+
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+KeyboardEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ originalEvent
+ DOMEvent
+ The original DOM KeyboardEvent that triggered this Leaflet event.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+MouseEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ latlng
+ LatLng
+ The geographical point where the mouse event occurred.
+
+
+ layerPoint
+ Point
+ Pixel coordinates of the point where the mouse event occurred relative to the map layer.
+
+
+ containerPoint
+ Point
+ Pixel coordinates of the point where the mouse event occurred relative to the map сontainer.
+
+
+ originalEvent
+ DOMEvent
+ The original DOM MouseEvent or DOM TouchEvent that triggered this Leaflet event.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+LocationEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ latlng
+ LatLng
+ Detected geographical location of the user.
+
+
+ bounds
+ LatLngBounds
+ Geographical bounds of the area user is located in (with respect to the accuracy of location).
+
+
+ accuracy
+ Number
+ Accuracy of location in meters.
+
+
+ altitude
+ Number
+ Height of the position above the WGS84 ellipsoid in meters.
+
+
+ altitudeAccuracy
+ Number
+ Accuracy of altitude in meters.
+
+
+ heading
+ Number
+ The direction of travel in degrees counting clockwise from true North.
+
+
+ speed
+ Number
+ Current velocity in meters per second.
+
+
+ timestamp
+ Number
+ The time when the position was acquired.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+ErrorEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ message
+ String
+ Error message.
+
+
+ code
+ Number
+ Error code (if applicable).
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+LayerEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ layer
+ Layer
+ The layer that was added or removed.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+LayersControlEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ layer
+ Layer
+ The layer that was added or removed.
+
+
+ name
+ String
+ The name of the layer that was added or removed.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+TileEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ tile
+ HTMLElement
+ The tile element (image).
+
+
+ coords
+ Point
+ Point object with the tile's x, y, and z (zoom level) coordinates.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+TileErrorEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ tile
+ HTMLElement
+ The tile element (image).
+
+
+ coords
+ Point
+ Point object with the tile's x, y, and z (zoom level) coordinates.
+
+
+ error
+ *
+ Error passed to the tile's done() callback.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+ResizeEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ oldSize
+ Point
+ The old size before resize event.
+
+
+ newSize
+ Point
+ The new size after the resize event.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+GeoJSONEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ layer
+ Layer
+ The layer for the GeoJSON feature that is being added to the map.
+
+
+ properties
+ Object
+ GeoJSON properties of the feature.
+
+
+ geometryType
+ String
+ GeoJSON geometry type of the feature.
+
+
+ id
+ String
+ GeoJSON ID of the feature (if present).
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ tooltip
+ Tooltip
+ The tooltip that was opened or closed.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+DragEndEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ distance
+ Number
+ The distance in pixels the draggable element was moved by.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+ZoomAnimEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ center
+ LatLng
+ The current center of the map
+
+
+ zoom
+ Number
+ The current zoom level of the map
+
+
+ noUpdate
+ Boolean
+ Whether layers should update their contents due to this event
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+ DivOverlay Base model for L.Popup and L.Tooltip. Inherit from it for custom popup like plugins.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ offset
+ Point
+ Point(0, 7)
+ The offset of the popup position. Useful to control the anchor
+of the popup when opening it on some overlays.
+
+
+ className
+ String
+ ''
+ A custom CSS class name to assign to the popup.
+
+
+ pane
+ String
+ 'popupPane'
+ Map pane where the popup will be added.
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Global Switches Global switches are created for rare cases and generally make
+Leaflet to not detect a particular browser feature even if it's
+there. You need to set the switch as a global variable to true
+before including Leaflet on the page, like this:
+
<script>L_NO_TOUCH = true;</script>
+<script src="leaflet.js"></script>
+
+
+
+
+Switch
+Description
+
+
+
+
+L_NO_TOUCH
+Forces Leaflet to not use touch events even if it detects them.
+
+
+L_DISABLE_3D
+Forces Leaflet to not use hardware-accelerated CSS 3D transforms for positioning (which may cause glitches in some rare environments) even if they're supported.
+
+
+
+
+
noConflict This method restores the L global variable to the original value
+it had before Leaflet inclusion, and returns the real Leaflet
+namespace so you can put it elsewhere, like this:
+
<script src='libs/l.js'>
+<!-- L points to some other library -->
+<script src='leaflet.js'>
+<!-- you include Leaflet, it replaces the L variable to Leaflet namespace -->
+<script>
+var Leaflet = L.noConflict();
+// now L points to that other library again, and you can use Leaflet.Map etc.
+</script>
+
+
+
version A constant that represents the Leaflet version in use.
+
L.version; // contains "1.0.0" (or whatever version is currently in use)
+
diff --git a/src/public/Leaflet-1.7.1/docs/reference-1.1.0.html b/src/public/Leaflet-1.7.1/docs/reference-1.1.0.html
new file mode 100644
index 0000000..3848393
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/reference-1.1.0.html
@@ -0,0 +1,23456 @@
+---
+layout: v2
+title: Documentation
+bodyclass: api-page
+---
+
+
API Reference
+
+
This reference reflects Leaflet 1.1.0 . Check this list if you are using a different version of Leaflet.
+
+
+
+
Map
+
+
Map Methods
+
+
Map Misc
+
+
+
+
UI Layers
+
+
Raster Layers
+
+
Vector Layers
+
+
+
+
Other Layers
+
+
Basic Types
+
+
Controls
+
+
+
+
+
+
+
+
+
+
Utility
+
+
DOM Utility
+
+
+
+
Base Classes
+
+
+
Misc
+
+
+
+
+
Map The central class of the API — it is used to create a map on a page and manipulate it.
+
+
+Usage example
+
+
+
+
+
+
+
+// initialize the map on the "map" div with a given center and zoom
+var map = L.map('map', {
+ center: [51.505, -0.09],
+ zoom: 13
+});
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.map (<String> id , <Map options> options? )
+ Instantiates a map object given the DOM ID of a <div> element
+and optionally an object literal with Map options.
+
+
+ L.map (<HTMLElement> el , <Map options> options? )
+ Instantiates a map object given an instance of a <div> HTML element
+and optionally an object literal with Map options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ preferCanvas
+ Boolean
+ false
+ Whether Path s should be rendered on a Canvas renderer.
+By default, all Paths are rendered in a SVG renderer.
+
+
+
+
+
+Control options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attributionControl
+ Boolean
+ true
+ Whether a attribution control is added to the map by default.
+
+
+ zoomControl
+ Boolean
+ true
+ Whether a zoom control is added to the map by default.
+
+
+
+
+
+Interaction Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+
+ zoomSnap
+ Number
+ 1
+ Forces the map's zoom level to always be a multiple of this, particularly
+right after a fitBounds() or a pinch-zoom.
+By default, the zoom level snaps to the nearest integer; lower values
+(e.g. 0.5 or 0.1) allow for greater granularity. A value of 0
+means the zoom level will not be snapped after fitBounds or a pinch-zoom.
+
+
+ zoomDelta
+ Number
+ 1
+ Controls how much the map's zoom level will change after a
+zoomIn() , zoomOut() , pressing +
+or - on the keyboard, or using the zoom controls .
+Values smaller than 1 (e.g. 0.5) allow for greater granularity.
+
+
+ trackResize
+ Boolean
+ true
+ Whether the map automatically handles browser window resize to update itself.
+
+
+ boxZoom
+ Boolean
+ true
+ Whether the map can be zoomed to a rectangular area specified by
+dragging the mouse while pressing the shift key.
+
+
+ doubleClickZoom
+ Boolean|String
+ true
+ Whether the map can be zoomed in by double clicking on it and
+zoomed out by double clicking while holding shift. If passed
+'center', double-click zoom will zoom to the center of the
+ view regardless of where the mouse was.
+
+
+ dragging
+ Boolean
+ true
+ Whether the map be draggable with mouse/touch or not.
+
+
+
+
+
+Map State Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ crs
+ CRS
+ L.CRS.EPSG3857
+ The Coordinate Reference System to use. Don't change this if you're not
+sure what it means.
+
+
+ center
+ LatLng
+ undefined
+ Initial geographic center of the map
+
+
+ zoom
+ Number
+ undefined
+ Initial map zoom level
+
+
+ minZoom
+ Number
+ *
+ Minimum zoom level of the map.
+If not specified and at least one GridLayer or TileLayer is in the map,
+the lowest of their minZoom options will be used instead.
+
+
+ maxZoom
+ Number
+ *
+ Maximum zoom level of the map.
+If not specified and at least one GridLayer or TileLayer is in the map,
+the highest of their maxZoom options will be used instead.
+
+
+ layers
+ Layer[]
+ []
+ Array of layers that will be added to the map initially
+
+
+ maxBounds
+ LatLngBounds
+ null
+ When this option is set, the map restricts the view to the given
+geographical bounds, bouncing the user back if the user tries to pan
+outside the view. To set the restriction dynamically, use
+setMaxBounds method.
+
+
+ renderer
+ Renderer
+ *
+ The default method for drawing vector layers on the map. L.SVG
+or L.Canvas by default depending on browser support.
+
+
+
+
+
+Animation Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ zoomAnimation
+ Boolean
+ true
+ Whether the map zoom animation is enabled. By default it's enabled
+in all browsers that support CSS3 Transitions except Android.
+
+
+ zoomAnimationThreshold
+ Number
+ 4
+ Won't animate zoom if the zoom difference exceeds this value.
+
+
+ fadeAnimation
+ Boolean
+ true
+ Whether the tile fade animation is enabled. By default it's enabled
+in all browsers that support CSS3 Transitions except Android.
+
+
+ markerZoomAnimation
+ Boolean
+ true
+ Whether markers animate their zoom with the zoom animation, if disabled
+they will disappear for the length of the animation. By default it's
+enabled in all browsers that support CSS3 Transitions except Android.
+
+
+ transform3DLimit
+ Number
+ 2^23
+ Defines the maximum size of a CSS translation transform. The default
+value should not be changed unless a web browser positions layers in
+the wrong place after doing a large panBy.
+
+
+
+
+
+Panning Inertia Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ inertia
+ Boolean
+ *
+ If enabled, panning of the map will have an inertia effect where
+the map builds momentum while dragging and continues moving in
+the same direction for some time. Feels especially nice on touch
+devices. Enabled by default unless running on old Android devices.
+
+
+ inertiaDeceleration
+ Number
+ 3000
+ The rate with which the inertial movement slows down, in pixels/second².
+
+
+ inertiaMaxSpeed
+ Number
+ Infinity
+ Max speed of the inertial movement, in pixels/second.
+
+
+ easeLinearity
+ Number
+ 0.2
+
+
+
+ worldCopyJump
+ Boolean
+ false
+ With this option enabled, the map tracks when you pan to another "copy"
+of the world and seamlessly jumps to the original one so that all overlays
+like markers and vector layers are still visible.
+
+
+ maxBoundsViscosity
+ Number
+ 0.0
+ If maxBounds is set, this option will control how solid the bounds
+are when dragging the map around. The default value of 0.0 allows the
+user to drag outside the bounds at normal speed, higher values will
+slow down map dragging outside bounds, and 1.0 makes the bounds fully
+solid, preventing the user from dragging outside the bounds.
+
+
+
+
+
+Keyboard Navigation Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ keyboard
+ Boolean
+ true
+ Makes the map focusable and allows users to navigate the map with keyboard
+arrows and +/- keys.
+
+
+ keyboardPanDelta
+ Number
+ 80
+ Amount of pixels to pan when pressing an arrow key.
+
+
+
+
+
+Mousewheel options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ scrollWheelZoom
+ Boolean|String
+ true
+ Whether the map can be zoomed by using the mouse wheel. If passed 'center',
+it will zoom to the center of the view regardless of where the mouse was.
+
+
+ wheelDebounceTime
+ Number
+ 40
+ Limits the rate at which a wheel can fire (in milliseconds). By default
+user can't zoom via wheel more often than once per 40 ms.
+
+
+ wheelPxPerZoomLevel
+ Number
+ 60
+ How many scroll pixels (as reported by L.DomEvent.getWheelDelta )
+mean a change of one full zoom level. Smaller values will make wheel-zooming
+faster (and vice versa).
+
+
+
+
+
+Touch interaction options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ tap
+ Boolean
+ true
+ Enables mobile hacks for supporting instant taps (fixing 200ms click
+delay on iOS/Android) and touch holds (fired as contextmenu events).
+
+
+ tapTolerance
+ Number
+ 15
+ The max number of pixels a user can shift his finger during touch
+for it to be considered a valid tap.
+
+
+ touchZoom
+ Boolean|String
+ *
+ Whether the map can be zoomed by touch-dragging with two fingers. If
+passed 'center', it will zoom to the center of the view regardless of
+where the touch events (fingers) were. Enabled for touch-capable web
+browsers except for old Androids.
+
+
+ bounceAtZoomLimits
+ Boolean
+ true
+ Set it to false if you don't want the map to zoom beyond min/max zoom
+and then bounce back when pinch-zooming.
+
+
+
+
+
+
+
+Events
+
+
+
+Layer events
+
+
+
+
+
+
+Map state change events
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ zoomlevelschange
+ Event
+ Fired when the number of zoomlevels on the map is changed due
+to adding or removing a layer.
+
+
+ resize
+ ResizeEvent
+ Fired when the map is resized.
+
+
+ unload
+ Event
+ Fired when the map is destroyed with remove method.
+
+
+ viewreset
+ Event
+ Fired when the map needs to redraw its content (this usually happens
+on map zoom or load). Very useful for creating custom overlays.
+
+
+ load
+ Event
+ Fired when the map is initialized (when its center and zoom are set
+for the first time).
+
+
+ zoomstart
+ Event
+ Fired when the map zoom is about to change (e.g. before zoom animation).
+
+
+ movestart
+ Event
+ Fired when the view of the map starts changing (e.g. user starts dragging the map).
+
+
+ zoom
+ Event
+ Fired repeatedly during any change in zoom level, including zoom
+and fly animations.
+
+
+ move
+ Event
+ Fired repeatedly during any movement of the map, including pan and
+fly animations.
+
+
+ zoomend
+ Event
+ Fired when the map has changed, after any animations.
+
+
+ moveend
+ Event
+ Fired when the center of the map stops changing (e.g. user stopped
+dragging the map).
+
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+ autopanstart
+ Event
+ Fired when the map starts autopanning when opening a popup.
+
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip is opened in the map.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip in the map is closed.
+
+
+
+
+
+Location events
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ locationerror
+ ErrorEvent
+ Fired when geolocation (using the locate method) failed.
+
+
+ locationfound
+ LocationEvent
+ Fired when geolocation (using the locate method)
+went successfully.
+
+
+
+
+
+Interaction events
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the map.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the map.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the map.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button on the map.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the map.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the map.
+
+
+ mousemove
+ MouseEvent
+ Fired while the mouse moves over the map.
+
+
+
+ keypress
+ KeyboardEvent
+ Fired when the user presses a key from the keyboard while the map is focused.
+
+
+ preclick
+ MouseEvent
+ Fired before mouse click on the map (sometimes useful when you
+want something to happen on click before any existing click
+handlers start running).
+
+
+
+
+
+Other Methods
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ zoomanim
+ ZoomAnimEvent
+ Fired on every frame of a zoom animation
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getRenderer (<Path > layer )
+ Renderer
+ Returns the instance of Renderer that should be used to render the given
+Path . It will ensure that the renderer options of the map and paths
+are respected, and that the renderers do exist on the map.
+
+
+
+
+
+
+Methods for Layers and Controls
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addControl (<Control > control )
+ this
+ Adds the given control to the map
+
+
+
+ removeControl (<Control > control )
+ this
+ Removes the given control from the map
+
+
+
+ addLayer (<Layer > layer )
+ this
+ Adds the given layer to the map
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Removes the given layer from the map.
+
+
+
+ hasLayer (<Layer > layer )
+ Boolean
+ Returns true if the given layer is currently added to the map
+
+
+
+ eachLayer (<Function> fn , <Object> context? )
+ this
+ Iterates over the layers of the map, optionally specifying context of the iterator function.
+map.eachLayer(function(layer){
+ layer.bindPopup('Hello');
+});
+
+
+
+
+
+
+ openTooltip (<Tooltip > tooltip )
+ this
+ Opens the specified tooltip.
+
+
+
+ openTooltip (<String|HTMLElement> content , <LatLng > latlng , <Tooltip options > options? )
+ this
+ Creates a tooltip with the specified content and options and open it.
+
+
+
+ closeTooltip (<Tooltip > tooltip? )
+ this
+ Closes the tooltip given as parameter.
+
+
+
+
+
+
+Methods for modifying map state
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setView (<LatLng > center , <Number> zoom , <Zoom/pan options > options? )
+ this
+ Sets the view of the map (geographical center and zoom) with the given
+animation options.
+
+
+
+ setZoom (<Number> zoom , <Zoom/pan options > options? )
+ this
+ Sets the zoom of the map.
+
+
+
+ zoomIn (<Number> delta? , <Zoom options > options? )
+ this
+ Increases the zoom of the map by delta (zoomDelta by default).
+
+
+
+ zoomOut (<Number> delta? , <Zoom options > options? )
+ this
+ Decreases the zoom of the map by delta (zoomDelta by default).
+
+
+
+ setZoomAround (<LatLng > latlng , <Number> zoom , <Zoom options > options )
+ this
+ Zooms the map while keeping a specified geographical point on the map
+stationary (e.g. used internally for scroll zoom and double-click zoom).
+
+
+
+ setZoomAround (<Point > offset , <Number> zoom , <Zoom options > options )
+ this
+ Zooms the map while keeping a specified pixel on the map (relative to the top-left corner) stationary.
+
+
+
+ fitBounds (<LatLngBounds > bounds , <fitBounds options > options? )
+ this
+ Sets a map view that contains the given geographical bounds with the
+maximum zoom level possible.
+
+
+
+ fitWorld (<fitBounds options > options? )
+ this
+ Sets a map view that mostly contains the whole world with the maximum
+zoom level possible.
+
+
+
+ panTo (<LatLng > latlng , <Pan options > options? )
+ this
+ Pans the map to a given center.
+
+
+
+ panBy (<Point > offset , <Pan options > options? )
+ this
+ Pans the map by a given number of pixels (animated).
+
+
+
+ flyTo (<LatLng > latlng , <Number> zoom? , <Zoom/pan options > options? )
+ this
+ Sets the view of the map (geographical center and zoom) performing a smooth
+pan-zoom animation.
+
+
+
+ flyToBounds (<LatLngBounds > bounds , <fitBounds options > options? )
+ this
+ Sets the view of the map with a smooth animation like flyTo ,
+but takes a bounds parameter like fitBounds .
+
+
+
+ setMaxBounds (<Bounds > bounds )
+ this
+ Restricts the map view to the given bounds (see the maxBounds option).
+
+
+
+ setMinZoom (<Number> zoom )
+ this
+ Sets the lower limit for the available zoom levels (see the minZoom option).
+
+
+
+ setMaxZoom (<Number> zoom )
+ this
+ Sets the upper limit for the available zoom levels (see the maxZoom option).
+
+
+
+ panInsideBounds (<LatLngBounds > bounds , <Pan options > options? )
+ this
+ Pans the map to the closest view that would lie inside the given bounds (if it's not already), controlling the animation using the options specific, if any.
+
+
+
+ invalidateSize (<Zoom/Pan options> options )
+ this
+ Checks if the map container size changed and updates the map if so —
+call it after you've changed the map size dynamically, also animating
+pan by default. If options.pan is false, panning will not occur.
+If options.debounceMoveend is true, it will delay moveend event so
+that it doesn't happen often even if the method is called many
+times in a row.
+
+
+
+ invalidateSize (<Boolean> animate )
+ this
+ Checks if the map container size changed and updates the map if so —
+call it after you've changed the map size dynamically, also animating
+pan by default.
+
+
+
+ stop ()
+ this
+ Stops the currently running panTo or flyTo animation, if any.
+
+
+
+
+
+
+Geolocation methods
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ locate (<Locate options > options? )
+ this
+ Tries to locate the user using the Geolocation API, firing a locationfound
+event with location data on success or a locationerror event on failure,
+and optionally sets the map view to the user's location with respect to
+detection accuracy (or to the world view if geolocation failed).
+Note that, if your page doesn't use HTTPS, this method will fail in
+modern browsers (Chrome 50 and newer )
+See Locate options for more details.
+
+
+
+ stopLocate ()
+ this
+ Stops watching location previously initiated by map.locate({watch: true})
+and aborts resetting the map view if map.locate was called with
+{setView: true}.
+
+
+
+
+
+
+Other Methods
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addHandler (<String> name , <Function> HandlerClass )
+ this
+ Adds a new Handler to the map, given its name and constructor function.
+
+
+
+ remove ()
+ this
+ Destroys the map and clears all related event listeners.
+
+
+
+ createPane (<String> name , <HTMLElement> container? )
+ HTMLElement
+ Creates a new map pane with the given name if it doesn't exist already,
+then returns it. The pane is created as a child of container, or
+as a child of the main map pane if not set.
+
+
+
+ getPane (<String|HTMLElement> pane )
+ HTMLElement
+ Returns a map pane , given its name or its HTML element (its identity).
+
+
+
+ getPanes ()
+ Object
+ Returns a plain object containing the names of all panes as keys and
+the panes as values.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTML element that contains the map.
+
+
+
+ whenReady (<Function> fn , <Object> context? )
+ this
+ Runs the given function fn when the map gets initialized with
+a view (center and zoom) and at least one layer, or immediately
+if it's already initialized, optionally passing a function context.
+
+
+
+
+
+
+Methods for Getting Map State
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getCenter ()
+ LatLng
+ Returns the geographical center of the map view
+
+
+
+ getZoom ()
+ Number
+ Returns the current zoom level of the map view
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the geographical bounds visible in the current map view
+
+
+
+ getMinZoom ()
+ Number
+ Returns the minimum zoom level of the map (if set in the minZoom option of the map or of any layers), or 0 by default.
+
+
+
+ getMaxZoom ()
+ Number
+ Returns the maximum zoom level of the map (if set in the maxZoom option of the map or of any layers).
+
+
+
+ getBoundsZoom (<LatLngBounds > bounds , <Boolean> inside? )
+ Number
+ Returns the maximum zoom level on which the given bounds fit to the map
+view in its entirety. If inside (optional) is set to true, the method
+instead returns the minimum zoom level on which the map view fits into
+the given bounds in its entirety.
+
+
+
+ getSize ()
+ Point
+ Returns the current size of the map container (in pixels).
+
+
+
+ getPixelBounds ()
+ Bounds
+ Returns the bounds of the current map view in projected pixel
+coordinates (sometimes useful in layer and overlay implementations).
+
+
+
+ getPixelOrigin ()
+ Point
+ Returns the projected pixel coordinates of the top left point of
+the map layer (useful in custom layer and overlay implementations).
+
+
+
+ getPixelWorldBounds (<Number> zoom? )
+ Bounds
+ Returns the world's bounds in pixel coordinates for zoom level zoom.
+If zoom is omitted, the map's current zoom level is used.
+
+
+
+
+
+
+Conversion Methods
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getZoomScale (<Number> toZoom , <Number> fromZoom )
+ Number
+ Returns the scale factor to be applied to a map transition from zoom level
+fromZoom to toZoom. Used internally to help with zoom animations.
+
+
+
+ getScaleZoom (<Number> scale , <Number> fromZoom )
+ Number
+ Returns the zoom level that the map would end up at, if it is at fromZoom
+level and everything is scaled by a factor of scale. Inverse of
+getZoomScale .
+
+
+
+ project (<LatLng > latlng , <Number> zoom )
+ Point
+ Projects a geographical coordinate LatLng according to the projection
+of the map's CRS, then scales it according to zoom and the CRS's
+Transformation . The result is pixel coordinate relative to
+the CRS origin.
+
+
+
+ unproject (<Point > point , <Number> zoom )
+ LatLng
+ Inverse of project .
+
+
+
+ layerPointToLatLng (<Point > point )
+ LatLng
+ Given a pixel coordinate relative to the origin pixel ,
+returns the corresponding geographical coordinate (for the current zoom level).
+
+
+
+ latLngToLayerPoint (<LatLng > latlng )
+ Point
+ Given a geographical coordinate, returns the corresponding pixel coordinate
+relative to the origin pixel .
+
+
+
+ wrapLatLng (<LatLng > latlng )
+ LatLng
+ Returns a LatLng where lat and lng has been wrapped according to the
+map's CRS's wrapLat and wrapLng properties, if they are outside the
+CRS's bounds.
+By default this means longitude is wrapped around the dateline so its
+value is between -180 and +180 degrees.
+
+
+
+ wrapLatLngBounds (<LatLngBounds > bounds )
+ LatLngBounds
+ Returns a LatLngBounds with the same size as the given one, ensuring that
+its center is within the CRS's bounds.
+By default this means the center longitude is wrapped around the dateline so its
+value is between -180 and +180 degrees, and the majority of the bounds
+overlaps the CRS's bounds.
+
+
+
+ distance (<LatLng > latlng1 , <LatLng > latlng2 )
+ Number
+ Returns the distance between two geographical coordinates according to
+the map's CRS. By default this measures distance in meters.
+
+
+
+ containerPointToLayerPoint (<Point > point )
+ Point
+ Given a pixel coordinate relative to the map container, returns the corresponding
+pixel coordinate relative to the origin pixel .
+
+
+
+ layerPointToContainerPoint (<Point > point )
+ Point
+ Given a pixel coordinate relative to the origin pixel ,
+returns the corresponding pixel coordinate relative to the map container.
+
+
+
+ containerPointToLatLng (<Point > point )
+ LatLng
+ Given a pixel coordinate relative to the map container, returns
+the corresponding geographical coordinate (for the current zoom level).
+
+
+
+ latLngToContainerPoint (<LatLng > latlng )
+ Point
+ Given a geographical coordinate, returns the corresponding pixel coordinate
+relative to the map container.
+
+
+
+ mouseEventToContainerPoint (<MouseEvent > ev )
+ Point
+ Given a MouseEvent object, returns the pixel coordinate relative to the
+map container where the event took place.
+
+
+
+ mouseEventToLayerPoint (<MouseEvent > ev )
+ Point
+ Given a MouseEvent object, returns the pixel coordinate relative to
+the origin pixel where the event took place.
+
+
+
+ mouseEventToLatLng (<MouseEvent > ev )
+ LatLng
+ Given a MouseEvent object, returns geographical coordinate where the
+event took place.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+
+Properties
+
+
+
+Handlers
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ boxZoom
+ Handler
+ Box (shift-drag with mouse) zoom handler.
+
+
+ doubleClickZoom
+ Handler
+ Double click zoom handler.
+
+
+ dragging
+ Handler
+ Map dragging handler (by both mouse and touch).
+
+
+ keyboard
+ Handler
+ Keyboard navigation handler.
+
+
+ scrollWheelZoom
+ Handler
+ Scroll wheel zoom handler.
+
+
+ tap
+ Handler
+ Mobile touch hacks (quick tap and touch hold) handler.
+
+
+ touchZoom
+ Handler
+ Touch zoom handler.
+
+
+
+
+
+
+
+Map panes
+
+
+
+
+
+
+
+
+
+ Pane
+ Type
+ Z-index
+ Description
+
+
+
+ mapPane
+ HTMLElement
+ 'auto'
+ Pane that contains all other map panes
+
+
+ tilePane
+ HTMLElement
+ 200
+ Pane for GridLayer s and TileLayer s
+
+
+ overlayPane
+ HTMLElement
+ 400
+ Pane for vector overlays (Path s), like Polyline s and Polygon s
+
+
+ shadowPane
+ HTMLElement
+ 500
+ Pane for overlay shadows (e.g. Marker shadows)
+
+
+ markerPane
+ HTMLElement
+ 600
+ Pane for Icon s of Marker s
+
+
+ tooltipPane
+ HTMLElement
+ 650
+ Pane for tooltip.
+
+
+
+
+
+
+
+
+
+
+Locate options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ watch
+ Boolean
+ false
+ If true, starts continuous watching of location changes (instead of detecting it
+once) using W3C watchPosition method. You can later stop watching using
+map.stopLocate() method.
+
+
+ setView
+ Boolean
+ false
+ If true, automatically sets the map view to the user location with respect to
+detection accuracy, or to world view if geolocation failed.
+
+
+ maxZoom
+ Number
+ Infinity
+ The maximum zoom for automatic view setting when using setView option.
+
+
+ timeout
+ Number
+ 10000
+ Number of milliseconds to wait for a response from geolocation before firing a
+locationerror event.
+
+
+ maximumAge
+ Number
+ 0
+ Maximum age of detected location. If less than this amount of milliseconds
+passed since last geolocation response, locate will return a cached location.
+
+
+ enableHighAccuracy
+ Boolean
+ false
+ Enables high accuracy, see description in the W3C spec .
+
+
+
+
+
+
+
+
+
+Zoom options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ animate
+ Boolean
+
+ If not specified, zoom animation will happen if the zoom origin is inside the
+current view. If true, the map will attempt animating zoom disregarding where
+zoom origin is. Setting false will make it always reset the view completely
+without animation.
+
+
+
+
+
+
+
+
+
+Pan options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ animate
+ Boolean
+
+ If true, panning will always be animated if possible. If false, it will
+not animate panning, either resetting the map view if panning more than a
+screen away, or just setting a new offset for the map pane (except for panBy
+which always does the latter).
+
+
+ duration
+ Number
+ 0.25
+ Duration of animated panning, in seconds.
+
+
+ easeLinearity
+ Number
+ 0.25
+ The curvature factor of panning animation easing (third parameter of the
+Cubic Bezier curve ). 1.0 means linear animation,
+and the smaller this number, the more bowed the curve.
+
+
+ noMoveStart
+ Boolean
+ false
+ If true, panning won't fire movestart event on start (used internally for
+panning inertia).
+
+
+
+
+
+
+
+
+
+Zoom/pan options
+
+
+
+
+
+
▶ Options inherited from Zoom options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ animate
+ Boolean
+
+ If not specified, zoom animation will happen if the zoom origin is inside the
+current view. If true, the map will attempt animating zoom disregarding where
+zoom origin is. Setting false will make it always reset the view completely
+without animation.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Pan options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ duration
+ Number
+ 0.25
+ Duration of animated panning, in seconds.
+
+
+ easeLinearity
+ Number
+ 0.25
+ The curvature factor of panning animation easing (third parameter of the
+Cubic Bezier curve ). 1.0 means linear animation,
+and the smaller this number, the more bowed the curve.
+
+
+ noMoveStart
+ Boolean
+ false
+ If true, panning won't fire movestart event on start (used internally for
+panning inertia).
+
+
+
+
+
+
+
+
+
+
+FitBounds options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ paddingTopLeft
+ Point
+ [0, 0]
+ Sets the amount of padding in the top left corner of a map container that
+shouldn't be accounted for when setting the view to fit bounds. Useful if you
+have some control overlays on the map like a sidebar and you don't want them
+to obscure objects you're zooming to.
+
+
+ paddingBottomRight
+ Point
+ [0, 0]
+ The same for the bottom right corner of the map.
+
+
+ padding
+ Point
+ [0, 0]
+ Equivalent of setting both top left and bottom right padding to the same value.
+
+
+ maxZoom
+ Number
+ null
+ The maximum possible zoom to use.
+
+
+
+
+
+
+
+
▶ Options inherited from Zoom options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ animate
+ Boolean
+
+ If not specified, zoom animation will happen if the zoom origin is inside the
+current view. If true, the map will attempt animating zoom disregarding where
+zoom origin is. Setting false will make it always reset the view completely
+without animation.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Pan options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ duration
+ Number
+ 0.25
+ Duration of animated panning, in seconds.
+
+
+ easeLinearity
+ Number
+ 0.25
+ The curvature factor of panning animation easing (third parameter of the
+Cubic Bezier curve ). 1.0 means linear animation,
+and the smaller this number, the more bowed the curve.
+
+
+ noMoveStart
+ Boolean
+ false
+ If true, panning won't fire movestart event on start (used internally for
+panning inertia).
+
+
+
+
+
+
+
+ Marker L.Marker is used to display clickable/draggable icons on the map. Extends Layer .
+
+
+Usage example
+
+
+
+
+
+
+
+L.marker([50.5, 30.5]).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.marker (<LatLng > latlng , <Marker options > options? )
+ Instantiates a Marker object given a geographical point and optionally an options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ icon
+ Icon
+ *
+ Icon instance to use for rendering the marker.
+See Icon documentation for details on how to customize the marker icon.
+If not specified, a common instance of L.Icon.Default is used.
+
+
+ draggable
+ Boolean
+ false
+ Whether the marker is draggable with mouse/touch or not.
+
+
+ keyboard
+ Boolean
+ true
+ Whether the marker can be tabbed to with a keyboard and clicked by pressing enter.
+
+
+ title
+ String
+ ''
+ Text for the browser tooltip that appear on marker hover (no tooltip by default).
+
+
+ alt
+ String
+ ''
+ Text for the alt attribute of the icon image (useful for accessibility).
+
+
+ zIndexOffset
+ Number
+ 0
+ By default, marker images zIndex is set automatically based on its latitude. Use this option if you want to put the marker on top of all others (or below), specifying a high value like 1000 (or high negative value, respectively).
+
+
+ opacity
+ Number
+ 1.0
+ The opacity of the marker.
+
+
+ riseOnHover
+ Boolean
+ false
+ If true, the marker will get on top of others when you hover the mouse over it.
+
+
+ riseOffset
+ Number
+ 250
+ The z-index offset used for the riseOnHover feature.
+
+
+ pane
+ String
+ 'markerPane'
+ Map pane where the markers icon will be added.
+
+
+ bubblingMouseEvents
+ Boolean
+ false
+ When true, a mouse event on this marker will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ move
+ Event
+ Fired when the marker is moved via setLatLng or by dragging . Old and new coordinates are included in event arguments as oldLatLng, latlng .
+
+
+
+
+
+Dragging events
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ dragstart
+ Event
+ Fired when the user starts dragging the marker.
+
+
+ movestart
+ Event
+ Fired when the marker starts moving (because of dragging).
+
+
+ drag
+ Event
+ Fired repeatedly while the user drags the marker.
+
+
+ dragend
+ DragEndEvent
+ Fired when the user stops dragging the marker.
+
+
+ moveend
+ Event
+ Fired when the marker stops moving (because of dragging).
+
+
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the marker (as a GeoJSON Point Feature).
+
+
+
+ getLatLng ()
+ LatLng
+ Returns the current geographical position of the marker.
+
+
+
+ setLatLng (<LatLng > latlng )
+ this
+ Changes the marker position to the given point.
+
+
+
+ setZIndexOffset (<Number> offset )
+ this
+ Changes the zIndex offset of the marker.
+
+
+
+ setIcon (<Icon > icon )
+ this
+ Changes the marker icon.
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Changes the opacity of the marker.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+
+Properties
+
+
+
+Interaction handlers
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ dragging
+ Handler
+ Marker dragging handler (by both mouse and touch). Only valid when the marker is on the map (Otherwise set marker.options.draggable ).
+
+
+
+
+
+
+ Used to open popups in certain places of the map. Use Map.openPopup to
+open popups while making sure that only one popup is open at one time
+(recommended for usability), or use Map.addLayer to open as many as you want.
+
+
+
+
+
+
+
+
+
+
+If you want to just bind a popup to marker click and then open it, it's really easy:
+marker.bindPopup(popupContent).openPopup();
+
+Path overlays like polylines also have a bindPopup method.
+Here's a more complicated way to open a popup on a map:
+var popup = L.popup()
+ .setLatLng(latlng)
+ .setContent('<p>Hello world!<br />This is a nice popup.</p>')
+ .openOn(map);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Options inherited from DivOverlay
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Used to display small texts on top of map layers.
+
+
+
+
+
+
+
+
+
+
+marker.bindTooltip("my tooltip text").openTooltip();
+
+Note about tooltip offset. Leaflet takes two options in consideration
+for computing tooltip offseting:
+
+the offset Tooltip option: it defaults to [0, 0], and it's specific to one tooltip.
+Add a positive x offset to move the tooltip to the right, and a positive y offset to
+move it to the bottom. Negatives will move to the left and top.
+the tooltipAnchor Icon option: this will only be considered for Marker. You
+should adapt this value if you use a custom icon.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.tooltip (<Tooltip options > options? , <Layer > source? )
+ Instantiates a Tooltip object given an optional options object that describes its appearance and location and an optional source object that is used to tag the tooltip with a reference to the Layer to which it refers.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'tooltipPane'
+ Map pane where the tooltip will be added.
+
+
+ offset
+ Point
+ Point(0, 0)
+ Optional offset of the tooltip position.
+
+
+ direction
+ String
+ 'auto'
+ Direction where to open the tooltip. Possible values are: right, left,
+top, bottom, center, auto.
+auto will dynamically switch between right and left according to the tooltip
+position on the map.
+
+
+ permanent
+ Boolean
+ false
+ Whether to open the tooltip permanently or only on mouseover.
+
+
+ sticky
+ Boolean
+ false
+ If true, the tooltip will follow the mouse instead of being fixed at the feature center.
+
+
+ interactive
+ Boolean
+ false
+ If true, the tooltip will listen to the feature events.
+
+
+ opacity
+ Number
+ 0.9
+ Tooltip container opacity.
+
+
+
+
+
+
+
+
▶ Options inherited from DivOverlay
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ className
+ String
+ ''
+ A custom CSS class name to assign to the popup.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ TileLayer Used to load and display tile layers on the map. Extends GridLayer .
+
+
+Usage example
+
+
+
+
+
+
+
+L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png?{foo}', {foo: 'bar'}).addTo(map);
+
+
+
+
+
+
+URL template
+
+
+
+A string of the following form:
+'http://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png'
+You can use custom keys in the template, which will be evaluated from TileLayer options, like this:
+L.tileLayer('http://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png', {foo: 'bar'});
+
+
+
+
+
+
+
+Creation
+
+
+
+Extension methods
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.tilelayer (<String> urlTemplate , <TileLayer options > options? )
+ Instantiates a tile layer object given a URL template and optionally an options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ minZoom
+ Number
+ 0
+ The minimum zoom level down to which this layer will be displayed (inclusive).
+
+
+ maxZoom
+ Number
+ 18
+ The maximum zoom level up to which this layer will be displayed (inclusive).
+
+
+ subdomains
+ String|String[]
+ 'abc'
+ Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.
+
+
+ errorTileUrl
+ String
+ ''
+ URL to the tile image to show in place of the tile that failed to load.
+
+
+ zoomOffset
+ Number
+ 0
+ The zoom number used in tile URLs will be offset with this value.
+
+
+ tms
+ Boolean
+ false
+ If true, inverses Y axis numbering for tiles (turn this on for TMS services).
+
+
+ zoomReverse
+ Boolean
+ false
+ If set to true, the zoom number used in tile URLs will be reversed (maxZoom - zoom instead of zoom)
+
+
+ detectRetina
+ Boolean
+ false
+ If true and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.
+
+
+ crossOrigin
+ Boolean
+ false
+ If true, all tiles will have their crossOrigin attribute set to ''. This is needed if you want to access tile pixel data.
+
+
+
+
+
+
+
+
▶ Options inherited from GridLayer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ tileSize
+ Number|Point
+ 256
+ Width and height of tiles in the grid. Use a number if width and height are equal, or L.point(width, height) otherwise.
+
+
+ opacity
+ Number
+ 1.0
+ Opacity of the tiles. Can be used in the createTile() function.
+
+
+ updateWhenIdle
+ Boolean
+ depends
+ If false, new tiles are loaded during panning, otherwise only after it (for better performance). true by default on mobile browsers, otherwise false.
+
+
+ updateWhenZooming
+ Boolean
+ true
+ By default, a smooth zoom animation (during a touch zoom or a flyTo() ) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends.
+
+
+ updateInterval
+ Number
+ 200
+ Tiles will not update more than once every updateInterval milliseconds when panning.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the tile layer.
+
+
+ bounds
+ LatLngBounds
+ undefined
+ If set, tiles will only be loaded inside the set LatLngBounds .
+
+
+ maxNativeZoom
+ Number
+ undefined
+ Maximum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels higher than maxNativeZoom will be loaded
+from maxNativeZoom level and auto-scaled.
+
+
+ minNativeZoom
+ Number
+ undefined
+ Minimum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels lower than minNativeZoom will be loaded
+from minNativeZoom level and auto-scaled.
+
+
+ noWrap
+ Boolean
+ false
+ Whether the layer is wrapped around the antimeridian. If true, the
+GridLayer will only be displayed once at low zoom levels. Has no
+effect when the map CRS doesn't wrap around. Can be used
+in combination with bounds to prevent requesting
+tiles outside the CRS limits.
+
+
+ pane
+ String
+ 'tilePane'
+ Map pane where the grid layer will be added.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the tile layer. Empty by default.
+
+
+ keepBuffer
+ Number
+ 2
+ When panning the map, keep this many rows and columns of tiles before unloading them.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from GridLayer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ loading
+ Event
+ Fired when the grid layer starts loading tiles.
+
+
+ tileunload
+ TileEvent
+ Fired when a tile is removed (e.g. when a tile goes off the screen).
+
+
+ tileloadstart
+ TileEvent
+ Fired when a tile is requested and starts loading.
+
+
+ tileerror
+ TileErrorEvent
+ Fired when there is an error loading a tile.
+
+
+ tileload
+ TileEvent
+ Fired when a tile loads.
+
+
+ load
+ Event
+ Fired when the grid layer loaded all visible tiles.
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setUrl (<String> url , <Boolean> noRedraw? )
+ this
+ Updates the layer's URL template and redraws it (unless noRedraw is set to true).
+
+
+
+ createTile (<Object> coords , <Function> done? )
+ HTMLElement
+ Called only internally, overrides GridLayer's createTile()
+to return an <img> HTML element with the appropriate image URL given coords. The done
+callback is called when the tile has been loaded.
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getTileUrl (<Object> coords )
+ String
+ Called only internally, returns the URL for a tile given its coordinates.
+Classes extending TileLayer can override this function to provide custom tile URL naming schemes.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from GridLayer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bringToFront ()
+ this
+ Brings the tile layer to the top of all tile layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the tile layer to the bottom of all tile layers.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTML element that contains the tiles for this layer.
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Changes the opacity of the grid layer.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Changes the zIndex of the grid layer.
+
+
+
+ isLoading ()
+ Boolean
+ Returns true if any tile in the grid layer has not finished loading.
+
+
+
+ redraw ()
+ this
+ Causes the layer to clear all the tiles and request them again.
+
+
+
+ getTileSize ()
+ Point
+ Normalizes the tileSize option into a point. Used by the createTile() method.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ TileLayer.WMS Used to display WMS services as tile layers on the map. Extends TileLayer .
+
+
+Usage example
+
+
+
+
+
+
+
+var nexrad = L.tileLayer.wms("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi", {
+ layers: 'nexrad-n0r-900913',
+ format: 'image/png',
+ transparent: true,
+ attribution: "Weather data © 2012 IEM Nexrad"
+});
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.tileLayer.wms (<String> baseUrl , <TileLayer.WMS options > options )
+ Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ layers
+ String
+ ''
+ (required) Comma-separated list of WMS layers to show.
+
+
+ styles
+ String
+ ''
+ Comma-separated list of WMS styles.
+
+
+ format
+ String
+ 'image/jpeg'
+ WMS image format (use 'image/png' for layers with transparency).
+
+
+ transparent
+ Boolean
+ false
+ If true, the WMS service will return images with transparency.
+
+
+ version
+ String
+ '1.1.1'
+ Version of the WMS service to use
+
+
+ crs
+ CRS
+ null
+ Coordinate Reference System to use for the WMS requests, defaults to
+map CRS. Don't change this if you're not sure what it means.
+
+
+ uppercase
+ Boolean
+ false
+ If true, WMS request parameter keys will be uppercase.
+
+
+
+
+
+
+
+
▶ Options inherited from TileLayer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ minZoom
+ Number
+ 0
+ The minimum zoom level down to which this layer will be displayed (inclusive).
+
+
+ maxZoom
+ Number
+ 18
+ The maximum zoom level up to which this layer will be displayed (inclusive).
+
+
+ subdomains
+ String|String[]
+ 'abc'
+ Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.
+
+
+ errorTileUrl
+ String
+ ''
+ URL to the tile image to show in place of the tile that failed to load.
+
+
+ zoomOffset
+ Number
+ 0
+ The zoom number used in tile URLs will be offset with this value.
+
+
+ tms
+ Boolean
+ false
+ If true, inverses Y axis numbering for tiles (turn this on for TMS services).
+
+
+ zoomReverse
+ Boolean
+ false
+ If set to true, the zoom number used in tile URLs will be reversed (maxZoom - zoom instead of zoom)
+
+
+ detectRetina
+ Boolean
+ false
+ If true and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.
+
+
+ crossOrigin
+ Boolean
+ false
+ If true, all tiles will have their crossOrigin attribute set to ''. This is needed if you want to access tile pixel data.
+
+
+
+
+
+
+
+
+
▶ Options inherited from GridLayer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ tileSize
+ Number|Point
+ 256
+ Width and height of tiles in the grid. Use a number if width and height are equal, or L.point(width, height) otherwise.
+
+
+ opacity
+ Number
+ 1.0
+ Opacity of the tiles. Can be used in the createTile() function.
+
+
+ updateWhenIdle
+ Boolean
+ depends
+ If false, new tiles are loaded during panning, otherwise only after it (for better performance). true by default on mobile browsers, otherwise false.
+
+
+ updateWhenZooming
+ Boolean
+ true
+ By default, a smooth zoom animation (during a touch zoom or a flyTo() ) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends.
+
+
+ updateInterval
+ Number
+ 200
+ Tiles will not update more than once every updateInterval milliseconds when panning.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the tile layer.
+
+
+ bounds
+ LatLngBounds
+ undefined
+ If set, tiles will only be loaded inside the set LatLngBounds .
+
+
+ maxNativeZoom
+ Number
+ undefined
+ Maximum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels higher than maxNativeZoom will be loaded
+from maxNativeZoom level and auto-scaled.
+
+
+ minNativeZoom
+ Number
+ undefined
+ Minimum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels lower than minNativeZoom will be loaded
+from minNativeZoom level and auto-scaled.
+
+
+ noWrap
+ Boolean
+ false
+ Whether the layer is wrapped around the antimeridian. If true, the
+GridLayer will only be displayed once at low zoom levels. Has no
+effect when the map CRS doesn't wrap around. Can be used
+in combination with bounds to prevent requesting
+tiles outside the CRS limits.
+
+
+ pane
+ String
+ 'tilePane'
+ Map pane where the grid layer will be added.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the tile layer. Empty by default.
+
+
+ keepBuffer
+ Number
+ 2
+ When panning the map, keep this many rows and columns of tiles before unloading them.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from GridLayer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ loading
+ Event
+ Fired when the grid layer starts loading tiles.
+
+
+ tileunload
+ TileEvent
+ Fired when a tile is removed (e.g. when a tile goes off the screen).
+
+
+ tileloadstart
+ TileEvent
+ Fired when a tile is requested and starts loading.
+
+
+ tileerror
+ TileErrorEvent
+ Fired when there is an error loading a tile.
+
+
+ tileload
+ TileEvent
+ Fired when a tile loads.
+
+
+ load
+ Event
+ Fired when the grid layer loaded all visible tiles.
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setParams (<Object> params , <Boolean> noRedraw? )
+ this
+ Merges an object with the new parameters and re-requests tiles on the current screen (unless noRedraw was set to true).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from TileLayer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setUrl (<String> url , <Boolean> noRedraw? )
+ this
+ Updates the layer's URL template and redraws it (unless noRedraw is set to true).
+
+
+
+ createTile (<Object> coords , <Function> done? )
+ HTMLElement
+ Called only internally, overrides GridLayer's createTile()
+to return an <img> HTML element with the appropriate image URL given coords. The done
+callback is called when the tile has been loaded.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from GridLayer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bringToFront ()
+ this
+ Brings the tile layer to the top of all tile layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the tile layer to the bottom of all tile layers.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTML element that contains the tiles for this layer.
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Changes the opacity of the grid layer.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Changes the zIndex of the grid layer.
+
+
+
+ isLoading ()
+ Boolean
+ Returns true if any tile in the grid layer has not finished loading.
+
+
+
+ redraw ()
+ this
+ Causes the layer to clear all the tiles and request them again.
+
+
+
+ getTileSize ()
+ Point
+ Normalizes the tileSize option into a point. Used by the createTile() method.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ ImageOverlay Used to load and display a single image over specific bounds of the map. Extends Layer .
+
+
+Usage example
+
+
+
+
+
+
+
+var imageUrl = 'http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg',
+ imageBounds = [[40.712216, -74.22655], [40.773941, -74.12544]];
+L.imageOverlay(imageUrl, imageBounds).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.imageOverlay (<String> imageUrl , <LatLngBounds > bounds , <ImageOverlay options > options? )
+ Instantiates an image overlay object given the URL of the image and the
+geographical bounds it is tied to.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ opacity
+ Number
+ 1.0
+ The opacity of the image overlay.
+
+
+ alt
+ String
+ ''
+ Text for the alt attribute of the image (useful for accessibility).
+
+
+ interactive
+ Boolean
+ false
+ If true, the image overlay will emit mouse events when clicked or hovered.
+
+
+ crossOrigin
+ Boolean
+ false
+ If true, the image will have its crossOrigin attribute set to ''. This is needed if you want to access image pixel data.
+
+
+ errorOverlayUrl
+ String
+ ''
+ URL to the overlay image to show in place of the overlay that failed to load.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the tile layer.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the image. Empty by default.
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this layer will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ load
+ Event
+ Fired when the ImageOverlay layer has loaded its image
+
+
+ error
+ Event
+ Fired when the ImageOverlay layer has loaded its image
+
+
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Sets the opacity of the overlay.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all overlays.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all overlays.
+
+
+
+ setUrl (<String> url )
+ this
+ Changes the URL of the image.
+
+
+
+ setBounds (<LatLngBounds > bounds )
+ this
+ Update the bounds that this ImageOverlay covers
+Changes the zIndex of the image overlay.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Get the bounds that this ImageOverlay covers
+
+
+
+ getElement ()
+ HTMLElement
+ Returns the instance of HTMLImageElement
+used by this overlay.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ VideoOverlay Used to load and display a video player over specific bounds of the map. Extends ImageOverlay .
+A video overlay uses the <video>
+HTML5 element.
+
+
+Usage example
+
+
+
+
+
+
+
+var videoUrl = 'https://www.mapbox.com/bites/00188/patricia_nasa.webm',
+ imageBounds = [[ 32, -130], [ 13, -100]];
+L.imageOverlay(imageUrl, imageBounds).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.videoOverlay (<String|Array> videoUrl , <LatLngBounds > bounds , <VideoOverlay options > options? )
+ Instantiates an image overlay object given the URL of the video (or array of URLs) and the
+geographical bounds it is tied to.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ autoplay
+ Boolean
+ true
+ Whether the video starts playing automatically when loaded.
+
+
+ loop
+ Boolean
+ true
+ Whether the video will loop back to the beginning when played.
+
+
+
+
+
+
+
+
▶ Options inherited from ImageOverlay
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ opacity
+ Number
+ 1.0
+ The opacity of the image overlay.
+
+
+ alt
+ String
+ ''
+ Text for the alt attribute of the image (useful for accessibility).
+
+
+ interactive
+ Boolean
+ false
+ If true, the image overlay will emit mouse events when clicked or hovered.
+
+
+ crossOrigin
+ Boolean
+ false
+ If true, the image will have its crossOrigin attribute set to ''. This is needed if you want to access image pixel data.
+
+
+ errorOverlayUrl
+ String
+ ''
+ URL to the overlay image to show in place of the overlay that failed to load.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the tile layer.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the image. Empty by default.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this layer will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ load
+ Event
+ Fired when the video has finished loading the first frame
+
+
+
+
+
+
+
+
▶ Events inherited from ImageOverlay
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ error
+ Event
+ Fired when the ImageOverlay layer has loaded its image
+
+
+
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getElement ()
+ HTMLVideoElement
+ Returns the instance of HTMLVideoElement
+used by this overlay.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from ImageOverlay
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Sets the opacity of the overlay.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all overlays.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all overlays.
+
+
+
+ setUrl (<String> url )
+ this
+ Changes the URL of the image.
+
+
+
+ setBounds (<LatLngBounds > bounds )
+ this
+ Update the bounds that this ImageOverlay covers
+Changes the zIndex of the image overlay.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Get the bounds that this ImageOverlay covers
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Path An abstract class that contains options and constants shared between vector
+overlays (Polygon, Polyline, Circle). Do not use it directly. Extends Layer .
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.svg (<Renderer options > options? )
+ Creates a SVG renderer with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Polyline A class for drawing polyline overlays on a map. Extends Path .
+
+
+Usage example
+
+
+
+
+
+
+
+// create a red polyline from an array of LatLng points
+var latlngs = [
+ [45.51, -122.68],
+ [37.77, -122.43],
+ [34.04, -118.2]
+];
+var polyline = L.polyline(latlngs, {color: 'red'}).addTo(map);
+// zoom the map to the polyline
+map.fitBounds(polyline.getBounds());
+
+You can also pass a multi-dimensional array to represent a MultiPolyline shape:
+// create a red polyline from an array of arrays of LatLng points
+var latlngs = [
+ [[45.51, -122.68],
+ [37.77, -122.43],
+ [34.04, -118.2]],
+ [[40.78, -73.91],
+ [41.83, -87.62],
+ [32.76, -96.72]]
+];
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.polyline (<LatLng[]> latlngs , <Polyline options > options? )
+ Instantiates a polyline object given an array of geographical points and
+optionally an options object. You can create a Polyline object with
+multiple separate lines (MultiPolyline) by passing an array of arrays
+of geographic points.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ smoothFactor
+ Number
+ 1.0
+ How much to simplify the polyline on each zoom level. More means
+better performance and smoother look, and less means more accurate representation.
+
+
+ noClip
+ Boolean
+ false
+ Disable polyline clipping.
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the polyline (as a GeoJSON LineString or MultiLineString Feature).
+
+
+
+ getLatLngs ()
+ LatLng[]
+ Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.
+
+
+
+ setLatLngs (<LatLng[]> latlngs )
+ this
+ Replaces all the points in the polyline with the given array of geographical points.
+
+
+
+ isEmpty ()
+ Boolean
+ Returns true if the Polyline has no LatLngs.
+
+
+
+ getCenter ()
+ LatLng
+ Returns the center (centroid ) of the polyline.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the path.
+
+
+
+ addLatLng (<LatLng > latlng )
+ this
+ Adds a given point to the polyline. By default, adds to the first ring of
+the polyline in case of a multi-polyline, but can be overridden by passing
+a specific ring as a LatLng array (that you can earlier access with getLatLngs ).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Polygon A class for drawing polygon overlays on a map. Extends Polyline .
+Note that points you pass when creating a polygon shouldn't have an additional last point equal to the first one — it's better to filter out such points.
+
+
+Usage example
+
+
+
+
+
+
+
+// create a red polygon from an array of LatLng points
+var latlngs = [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]];
+var polygon = L.polygon(latlngs, {color: 'red'}).addTo(map);
+// zoom the map to the polygon
+map.fitBounds(polygon.getBounds());
+
+You can also pass an array of arrays of latlngs, with the first array representing the outer shape and the other arrays representing holes in the outer shape:
+var latlngs = [
+ [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring
+ [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole
+];
+
+Additionally, you can pass a multi-dimensional array to represent a MultiPolygon shape.
+var latlngs = [
+ [ // first polygon
+ [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring
+ [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole
+ ],
+ [ // second polygon
+ [[41, -111.03],[45, -111.04],[45, -104.05],[41, -104.05]]
+ ]
+];
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.polygon (<LatLng[]> latlngs , <Polyline options > options? )
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Polyline
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ smoothFactor
+ Number
+ 1.0
+ How much to simplify the polyline on each zoom level. More means
+better performance and smoother look, and less means more accurate representation.
+
+
+ noClip
+ Boolean
+ false
+ Disable polyline clipping.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the polygon (as a GeoJSON Polygon or MultiPolygon Feature).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Polyline
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getLatLngs ()
+ LatLng[]
+ Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.
+
+
+
+ setLatLngs (<LatLng[]> latlngs )
+ this
+ Replaces all the points in the polyline with the given array of geographical points.
+
+
+
+ isEmpty ()
+ Boolean
+ Returns true if the Polyline has no LatLngs.
+
+
+
+ getCenter ()
+ LatLng
+ Returns the center (centroid ) of the polyline.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the path.
+
+
+
+ addLatLng (<LatLng > latlng )
+ this
+ Adds a given point to the polyline. By default, adds to the first ring of
+the polyline in case of a multi-polyline, but can be overridden by passing
+a specific ring as a LatLng array (that you can earlier access with getLatLngs ).
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Rectangle A class for drawing rectangle overlays on a map. Extends Polygon .
+
+
+Usage example
+
+
+
+
+
+
+
+// define rectangle geographical bounds
+var bounds = [[54.559322, -5.767822], [56.1210604, -3.021240]];
+// create an orange rectangle
+L.rectangle(bounds, {color: "#ff7800", weight: 1}).addTo(map);
+// zoom the map to the rectangle bounds
+map.fitBounds(bounds);
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Polyline
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ smoothFactor
+ Number
+ 1.0
+ How much to simplify the polyline on each zoom level. More means
+better performance and smoother look, and less means more accurate representation.
+
+
+ noClip
+ Boolean
+ false
+ Disable polyline clipping.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setBounds (<LatLngBounds > latLngBounds )
+ this
+ Redraws the rectangle with the passed bounds.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Polygon
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the polygon (as a GeoJSON Polygon or MultiPolygon Feature).
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Polyline
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getLatLngs ()
+ LatLng[]
+ Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.
+
+
+
+ setLatLngs (<LatLng[]> latlngs )
+ this
+ Replaces all the points in the polyline with the given array of geographical points.
+
+
+
+ isEmpty ()
+ Boolean
+ Returns true if the Polyline has no LatLngs.
+
+
+
+ getCenter ()
+ LatLng
+ Returns the center (centroid ) of the polyline.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the path.
+
+
+
+ addLatLng (<LatLng > latlng )
+ this
+ Adds a given point to the polyline. By default, adds to the first ring of
+the polyline in case of a multi-polyline, but can be overridden by passing
+a specific ring as a LatLng array (that you can earlier access with getLatLngs ).
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Circle A class for drawing circle overlays on a map. Extends CircleMarker .
+It's an approximation and starts to diverge from a real circle closer to poles (due to projection distortion).
+
+
+Usage example
+
+
+
+
+
+
+
+L.circle([50.5, 30.5], {radius: 200}).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.circle (<LatLng > latlng , <Circle options > options? )
+ Instantiates a circle object given a geographical point, and an options object
+which contains the circle radius.
+
+
+ L.circle (<LatLng > latlng , <Number> radius , <Circle options > options? )
+ Obsolete way of instantiating a circle, for compatibility with 0.7.x code.
+Do not use in new applications or plugins.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ radius
+ Number
+
+ Radius of the circle, in meters.
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setRadius (<Number> radius )
+ this
+ Sets the radius of a circle. Units are in meters.
+
+
+
+ getRadius ()
+ Number
+ Returns the current radius of a circle. Units are in meters.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the path.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from CircleMarker
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the circle marker (as a GeoJSON Point Feature).
+
+
+
+ setLatLng (<LatLng > latLng )
+ this
+ Sets the position of a circle marker to a new location.
+
+
+
+ getLatLng ()
+ LatLng
+ Returns the current geographical position of the circle marker
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ CircleMarker A circle of a fixed size with radius specified in pixels. Extends Path .
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.circleMarker (<LatLng > latlng , <CircleMarker options > options? )
+ Instantiates a circle marker object given a geographical point, and an optional options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ radius
+ Number
+ 10
+ Radius of the circle marker, in pixels
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the circle marker (as a GeoJSON Point Feature).
+
+
+
+ setLatLng (<LatLng > latLng )
+ this
+ Sets the position of a circle marker to a new location.
+
+
+
+ getLatLng ()
+ LatLng
+ Returns the current geographical position of the circle marker
+
+
+
+ setRadius (<Number> radius )
+ this
+ Sets the radius of a circle marker. Units are in pixels.
+
+
+
+ getRadius ()
+ Number
+ Returns the current radius of the circle
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ SVG Although SVG is not available on IE7 and IE8, these browsers support VML , and the SVG renderer will fall back to VML in this case.
+VML was deprecated in 2012, which means VML functionality exists only for backwards compatibility
+with old versions of Internet Explorer.
+
Allows vector layers to be displayed with SVG .
+Inherits Renderer .
+Due to technical limitations , SVG is not
+available in all web browsers, notably Android 2.x and 3.x.
+Although SVG is not available on IE7 and IE8, these browsers support
+VML
+(a now deprecated technology), and the SVG renderer will fall back to VML in
+this case.
+
+
+Usage example
+
+
+
+
+
+
+
+Use SVG by default for all paths in the map:
+var map = L.map('map', {
+ renderer: L.svg()
+});
+
+Use a SVG renderer with extra padding for specific vector geometries:
+var map = L.map('map');
+var myRenderer = L.svg({ padding: 0.5 });
+var line = L.polyline( coordinates, { renderer: myRenderer } );
+var circle = L.circle( center, { renderer: myRenderer } );
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Renderer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ padding
+ Number
+ 0.1
+ How much to extend the clip area around the map view (relative to its size)
+e.g. 0.1 would be 10% of map view in each direction
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Renderer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ update
+ Event
+ Fired when the renderer updates its bounds, center and zoom, for example when
+its map has moved
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+
+Functions
+
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ create (<String> name )
+ SVGElement
+ Returns a instance of SVGElement ,
+corresponding to the class name passed. For example, using 'line' will return
+an instance of SVGLineElement .
+
+
+ pointsToPath (<Point[]> rings , <Boolean> closed )
+ String
+ Generates a SVG path string for multiple rings, with each ring turning
+into "M..L..L.." instructions
+
+
+
+
+
+
+ Canvas Allows vector layers to be displayed with <canvas> .
+Inherits Renderer .
+Due to technical limitations , Canvas is not
+available in all web browsers, notably IE8, and overlapping geometries might
+not display properly in some edge cases.
+
+
+Usage example
+
+
+
+
+
+
+
+Use Canvas by default for all paths in the map:
+var map = L.map('map', {
+ renderer: L.canvas()
+});
+
+Use a Canvas renderer with extra padding for specific vector geometries:
+var map = L.map('map');
+var myRenderer = L.canvas({ padding: 0.5 });
+var line = L.polyline( coordinates, { renderer: myRenderer } );
+var circle = L.circle( center, { renderer: myRenderer } );
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.canvas (<Renderer options > options? )
+ Creates a Canvas renderer with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Renderer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ padding
+ Number
+ 0.1
+ How much to extend the clip area around the map view (relative to its size)
+e.g. 0.1 would be 10% of map view in each direction
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Renderer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ update
+ Event
+ Fired when the renderer updates its bounds, center and zoom, for example when
+its map has moved
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ LayerGroup Used to group several layers and handle them as one. If you add it to the map,
+any layers added or removed from the group will be added/removed on the map as
+well. Extends Layer .
+
+
+Usage example
+
+
+
+
+
+
+
+L.layerGroup([marker1, marker2])
+ .addLayer(polyline)
+ .addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.layerGroup (<Layer[]> layers )
+ Create a layer group, optionally given an initial set of layers.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the layer group (as a GeoJSON FeatureCollection, GeometryCollection, or MultiPoint).
+
+
+
+ addLayer (<Layer > layer )
+ this
+ Adds the given layer to the group.
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Removes the given layer from the group.
+
+
+
+ removeLayer (<Number> id )
+ this
+ Removes the layer with the given internal ID from the group.
+
+
+
+ hasLayer (<Layer > layer )
+ Boolean
+ Returns true if the given layer is currently added to the group.
+
+
+
+ hasLayer (<Number> id )
+ Boolean
+ Returns true if the given internal ID is currently added to the group.
+
+
+
+ clearLayers ()
+ this
+ Removes all the layers from the group.
+
+
+
+ invoke (<String> methodName , … )
+ this
+ Calls methodName on every layer contained in this group, passing any
+additional parameters. Has no effect if the layers contained do not
+implement methodName.
+
+
+
+ eachLayer (<Function> fn , <Object> context? )
+ this
+ Iterates over the layers of the group, optionally specifying context of the iterator function.
+group.eachLayer(function (layer) {
+ layer.bindPopup('Hello');
+});
+
+
+
+
+ getLayer (<Number> id )
+ Layer
+ Returns the layer with the given internal ID.
+
+
+
+ getLayers ()
+ Layer[]
+ Returns an array of all the layers added to the group.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Calls setZIndex on every layer contained in this group, passing the z-index.
+
+
+
+ getLayerId (<Layer > layer )
+ Number
+ Returns the internal ID for a layer
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ FeatureGroup Extended LayerGroup that makes it easier to do the same thing to all its member layers:
+
+bindPopup binds a popup to all of the layers at once (likewise with bindTooltip )
+Events are propagated to the FeatureGroup , so if the group has an event
+handler, it will handle events from any of the layers. This includes mouse events
+and custom events.
+Has layeradd and layerremove events
+
+
+
+Usage example
+
+
+
+
+
+
+
+L.featureGroup([marker1, marker2, polyline])
+ .bindPopup('Hello world!')
+ .on('click', function() { alert('Clicked on a member of the group!'); })
+ .addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.featureGroup (<Layer[]> layers )
+ Create a feature group, optionally given an initial set of layers.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setStyle (<Path options > style )
+ this
+ Sets the given path options to each layer of the group that has a setStyle method.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer group to the top of all other layers
+
+
+
+ bringToBack ()
+ this
+ Brings the layer group to the back of all other layers
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from LayerGroup
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the layer group (as a GeoJSON FeatureCollection, GeometryCollection, or MultiPoint).
+
+
+
+ addLayer (<Layer > layer )
+ this
+ Adds the given layer to the group.
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Removes the given layer from the group.
+
+
+
+ removeLayer (<Number> id )
+ this
+ Removes the layer with the given internal ID from the group.
+
+
+
+ hasLayer (<Layer > layer )
+ Boolean
+ Returns true if the given layer is currently added to the group.
+
+
+
+ hasLayer (<Number> id )
+ Boolean
+ Returns true if the given internal ID is currently added to the group.
+
+
+
+ clearLayers ()
+ this
+ Removes all the layers from the group.
+
+
+
+ invoke (<String> methodName , … )
+ this
+ Calls methodName on every layer contained in this group, passing any
+additional parameters. Has no effect if the layers contained do not
+implement methodName.
+
+
+
+ eachLayer (<Function> fn , <Object> context? )
+ this
+ Iterates over the layers of the group, optionally specifying context of the iterator function.
+group.eachLayer(function (layer) {
+ layer.bindPopup('Hello');
+});
+
+
+
+
+ getLayer (<Number> id )
+ Layer
+ Returns the layer with the given internal ID.
+
+
+
+ getLayers ()
+ Layer[]
+ Returns an array of all the layers added to the group.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Calls setZIndex on every layer contained in this group, passing the z-index.
+
+
+
+ getLayerId (<Layer > layer )
+ Number
+ Returns the internal ID for a layer
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ GeoJSON Represents a GeoJSON object or an array of GeoJSON objects. Allows you to parse
+GeoJSON data and display it on the map. Extends FeatureGroup .
+
+
+Usage example
+
+
+
+
+
+
+
+L.geoJSON(data, {
+ style: function (feature) {
+ return {color: feature.properties.color};
+ }
+}).bindPopup(function (layer) {
+ return layer.feature.properties.description;
+}).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.geoJSON (<Object> geojson? , <GeoJSON options > options? )
+ Creates a GeoJSON layer. Optionally accepts an object in
+GeoJSON format to display on the map
+(you can alternatively add it later with addData method) and an options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pointToLayer
+ Function
+ *
+ A Function defining how GeoJSON points spawn Leaflet layers. It is internally
+called when data is added, passing the GeoJSON point feature and its LatLng .
+The default is to spawn a default Marker :
+function(geoJsonPoint, latlng) {
+ return L.marker(latlng);
+}
+
+
+
+ style
+ Function
+ *
+ A Function defining the Path options for styling GeoJSON lines and polygons,
+called internally when data is added.
+The default value is to not override any defaults:
+function (geoJsonFeature) {
+ return {}
+}
+
+
+
+ onEachFeature
+ Function
+ *
+ A Function that will be called once for each created Feature, after it has
+been created and styled. Useful for attaching events and popups to features.
+The default is to do nothing with the newly created layers:
+function (feature, layer) {}
+
+
+
+ filter
+ Function
+ *
+ A Function that will be used to decide whether to include a feature or not.
+The default is to include all features:
+function (geoJsonFeature) {
+ return true;
+}
+
+Note: dynamically changing the filter option will have effect only on newly
+added data. It will not re-evaluate already included features.
+
+
+ coordsToLatLng
+ Function
+ *
+ A Function that will be used for converting GeoJSON coordinates to LatLng s.
+The default is the coordsToLatLng static method.
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addData (data )
+ this
+ Adds a GeoJSON object to the layer.
+
+
+
+ resetStyle (layer )
+ this
+ Resets the given vector layer's style to the original GeoJSON style, useful for resetting style after hover events.
+
+
+
+ setStyle (style )
+ this
+ Changes styles of GeoJSON vector layers with the given style function.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from FeatureGroup
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bringToFront ()
+ this
+ Brings the layer group to the top of all other layers
+
+
+
+ bringToBack ()
+ this
+ Brings the layer group to the back of all other layers
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from LayerGroup
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the layer group (as a GeoJSON FeatureCollection, GeometryCollection, or MultiPoint).
+
+
+
+ addLayer (<Layer > layer )
+ this
+ Adds the given layer to the group.
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Removes the given layer from the group.
+
+
+
+ removeLayer (<Number> id )
+ this
+ Removes the layer with the given internal ID from the group.
+
+
+
+ hasLayer (<Layer > layer )
+ Boolean
+ Returns true if the given layer is currently added to the group.
+
+
+
+ hasLayer (<Number> id )
+ Boolean
+ Returns true if the given internal ID is currently added to the group.
+
+
+
+ clearLayers ()
+ this
+ Removes all the layers from the group.
+
+
+
+ invoke (<String> methodName , … )
+ this
+ Calls methodName on every layer contained in this group, passing any
+additional parameters. Has no effect if the layers contained do not
+implement methodName.
+
+
+
+ eachLayer (<Function> fn , <Object> context? )
+ this
+ Iterates over the layers of the group, optionally specifying context of the iterator function.
+group.eachLayer(function (layer) {
+ layer.bindPopup('Hello');
+});
+
+
+
+
+ getLayer (<Number> id )
+ Layer
+ Returns the layer with the given internal ID.
+
+
+
+ getLayers ()
+ Layer[]
+ Returns an array of all the layers added to the group.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Calls setZIndex on every layer contained in this group, passing the z-index.
+
+
+
+ getLayerId (<Layer > layer )
+ Number
+ Returns the internal ID for a layer
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+
+Functions
+
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ geometryToLayer (<Object> featureData , <GeoJSON options > options? )
+ Layer
+ Creates a Layer from a given GeoJSON feature. Can use a custom
+pointToLayer and/or coordsToLatLng
+functions if provided as options.
+
+
+ coordsToLatLng (<Array> coords )
+ LatLng
+ Creates a LatLng object from an array of 2 numbers (longitude, latitude)
+or 3 numbers (longitude, latitude, altitude) used in GeoJSON for points.
+
+
+ coordsToLatLngs (<Array> coords , <Number> levelsDeep? , <Function> coordsToLatLng? )
+ Array
+ Creates a multidimensional array of LatLng s from a GeoJSON coordinates array.
+levelsDeep specifies the nesting level (0 is for an array of points, 1 for an array of arrays of points, etc., 0 by default).
+Can use a custom coordsToLatLng function.
+
+
+ latLngToCoords (<LatLng > latlng , <Number> precision? )
+ Array
+ Reverse of coordsToLatLng
+
+
+ latLngsToCoords (<Array> latlngs , <Number> levelsDeep? , <Boolean> closed? )
+ Array
+ Reverse of coordsToLatLngs
+closed determines whether the first point should be appended to the end of the array to close the feature, only used when levelsDeep is 0. False by default.
+
+
+ asFeature (<Object> geojson )
+ Object
+ Normalize GeoJSON geometries/features into GeoJSON features.
+
+
+
+
+
+
+ GridLayer Generic class for handling a tiled grid of HTML elements. This is the base class for all tile layers and replaces TileLayer.Canvas.
+GridLayer can be extended to create a tiled grid of HTML elements like <canvas>, <img> or <div>. GridLayer will handle creating and animating these DOM elements for you.
+
+
+Usage example
+
+
+
+Synchronous usage
+
+
+
+To create a custom layer, extend GridLayer and implement the createTile() method, which will be passed a Point object with the x, y, and z (zoom level) coordinates to draw your tile.
+var CanvasLayer = L.GridLayer.extend({
+ createTile: function(coords){
+ // create a <canvas> element for drawing
+ var tile = L.DomUtil.create('canvas', 'leaflet-tile');
+ // setup tile width and height according to the options
+ var size = this.getTileSize();
+ tile.width = size.x;
+ tile.height = size.y;
+ // get a canvas context and draw something on it using coords.x, coords.y and coords.z
+ var ctx = tile.getContext('2d');
+ // return the tile so it can be rendered on screen
+ return tile;
+ }
+});
+
+
+
+
+
+
+Asynchronous usage
+
+
+
+Tile creation can also be asynchronous, this is useful when using a third-party drawing library. Once the tile is finished drawing it can be passed to the done() callback.
+var CanvasLayer = L.GridLayer.extend({
+ createTile: function(coords, done){
+ var error;
+ // create a <canvas> element for drawing
+ var tile = L.DomUtil.create('canvas', 'leaflet-tile');
+ // setup tile width and height according to the options
+ var size = this.getTileSize();
+ tile.width = size.x;
+ tile.height = size.y;
+ // draw something asynchronously and pass the tile to the done() callback
+ setTimeout(function() {
+ done(error, tile);
+ }, 1000);
+ return tile;
+ }
+});
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.gridLayer (<GridLayer options > options? )
+ Creates a new instance of GridLayer with the supplied options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ tileSize
+ Number|Point
+ 256
+ Width and height of tiles in the grid. Use a number if width and height are equal, or L.point(width, height) otherwise.
+
+
+ opacity
+ Number
+ 1.0
+ Opacity of the tiles. Can be used in the createTile() function.
+
+
+ updateWhenIdle
+ Boolean
+ depends
+ If false, new tiles are loaded during panning, otherwise only after it (for better performance). true by default on mobile browsers, otherwise false.
+
+
+ updateWhenZooming
+ Boolean
+ true
+ By default, a smooth zoom animation (during a touch zoom or a flyTo() ) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends.
+
+
+ updateInterval
+ Number
+ 200
+ Tiles will not update more than once every updateInterval milliseconds when panning.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the tile layer.
+
+
+ bounds
+ LatLngBounds
+ undefined
+ If set, tiles will only be loaded inside the set LatLngBounds .
+
+
+ minZoom
+ Number
+ 0
+ The minimum zoom level down to which this layer will be displayed (inclusive).
+
+
+ maxZoom
+ Number
+ undefined
+ The maximum zoom level up to which this layer will be displayed (inclusive).
+
+
+ maxNativeZoom
+ Number
+ undefined
+ Maximum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels higher than maxNativeZoom will be loaded
+from maxNativeZoom level and auto-scaled.
+
+
+ minNativeZoom
+ Number
+ undefined
+ Minimum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels lower than minNativeZoom will be loaded
+from minNativeZoom level and auto-scaled.
+
+
+ noWrap
+ Boolean
+ false
+ Whether the layer is wrapped around the antimeridian. If true, the
+GridLayer will only be displayed once at low zoom levels. Has no
+effect when the map CRS doesn't wrap around. Can be used
+in combination with bounds to prevent requesting
+tiles outside the CRS limits.
+
+
+ pane
+ String
+ 'tilePane'
+ Map pane where the grid layer will be added.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the tile layer. Empty by default.
+
+
+ keepBuffer
+ Number
+ 2
+ When panning the map, keep this many rows and columns of tiles before unloading them.
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ loading
+ Event
+ Fired when the grid layer starts loading tiles.
+
+
+ tileunload
+ TileEvent
+ Fired when a tile is removed (e.g. when a tile goes off the screen).
+
+
+ tileloadstart
+ TileEvent
+ Fired when a tile is requested and starts loading.
+
+
+ tileerror
+ TileErrorEvent
+ Fired when there is an error loading a tile.
+
+
+ tileload
+ TileEvent
+ Fired when a tile loads.
+
+
+ load
+ Event
+ Fired when the grid layer loaded all visible tiles.
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bringToFront ()
+ this
+ Brings the tile layer to the top of all tile layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the tile layer to the bottom of all tile layers.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTML element that contains the tiles for this layer.
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Changes the opacity of the grid layer.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Changes the zIndex of the grid layer.
+
+
+
+ isLoading ()
+ Boolean
+ Returns true if any tile in the grid layer has not finished loading.
+
+
+
+ redraw ()
+ this
+ Causes the layer to clear all the tiles and request them again.
+
+
+
+ getTileSize ()
+ Point
+ Normalizes the tileSize option into a point. Used by the createTile() method.
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ createTile (<Object> coords , <Function> done? )
+ HTMLElement
+ Called only internally, must be overridden by classes extending GridLayer .
+Returns the HTMLElement corresponding to the given coords. If the done callback
+is specified, it must be called when the tile has finished loading and drawing.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ LatLng Represents a geographical point with a certain latitude and longitude.
+
+
+Usage example
+
+
+
+
+
+
+
+var latlng = L.latLng(50.5, 30.5);
+All Leaflet methods that accept LatLng objects also accept them in a simple Array form and simple object form (unless noted otherwise), so these lines are equivalent:
+map.panTo([50, 30]);
+map.panTo({lon: 30, lat: 50});
+map.panTo({lat: 50, lng: 30});
+map.panTo(L.latLng(50, 30));
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.latLng (<Number> latitude , <Number> longitude , <Number> altitude? )
+ Creates an object representing a geographical point with the given latitude and longitude (and optionally altitude).
+
+
+ L.latLng (<Array> coords )
+ Expects an array of the form [Number, Number] or [Number, Number, Number] instead.
+
+
+ L.latLng (<Object> coords )
+ Expects an plain object of the form {lat: Number, lng: Number} or {lat: Number, lng: Number, alt: Number} instead.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ equals (<LatLng > otherLatLng , <Number> maxMargin? )
+ Boolean
+ Returns true if the given LatLng point is at the same position (within a small margin of error). The margin of error can be overridden by setting maxMargin to a small number.
+
+
+
+ toString ()
+ String
+ Returns a string representation of the point (for debugging purposes).
+
+
+
+ distanceTo (<LatLng > otherLatLng )
+ Number
+ Returns the distance (in meters) to the given LatLng calculated using the Haversine formula .
+
+
+
+ wrap ()
+ LatLng
+ Returns a new LatLng object with the longitude wrapped so it's always between -180 and +180 degrees.
+
+
+
+ toBounds (<Number> sizeInMeters )
+ LatLngBounds
+ Returns a new LatLngBounds object in which each boundary is sizeInMeters/2 meters apart from the LatLng .
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ lat
+ Number
+ Latitude in degrees
+
+
+ lng
+ Number
+ Longitude in degrees
+
+
+ alt
+ Number
+ Altitude in meters (optional)
+
+
+
+
+
+
+ LatLngBounds Represents a rectangular geographical area on a map.
+
+
+Usage example
+
+
+
+
+
+
+
+var corner1 = L.latLng(40.712, -74.227),
+corner2 = L.latLng(40.774, -74.125),
+bounds = L.latLngBounds(corner1, corner2);
+
+All Leaflet methods that accept LatLngBounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:
+map.fitBounds([
+ [40.712, -74.227],
+ [40.774, -74.125]
+]);
+
+Caution: if the area crosses the antimeridian (often confused with the International Date Line), you must specify corners outside the [-180, 180] degrees longitude range.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.latLngBounds (<LatLng > corner1 , <LatLng > corner2 )
+ Creates a LatLngBounds object by defining two diagonally opposite corners of the rectangle.
+
+
+ L.latLngBounds (<LatLng[]> latlngs )
+ Creates a LatLngBounds object defined by the geographical points it contains. Very useful for zooming the map to fit a particular set of locations with fitBounds .
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ extend (<LatLng > latlng )
+ this
+ Extend the bounds to contain the given point
+
+
+
+ extend (<LatLngBounds > otherBounds )
+ this
+ Extend the bounds to contain the given bounds
+
+
+
+ pad (<Number> bufferRatio )
+ LatLngBounds
+ Returns bigger bounds created by extending the current bounds by a given percentage in each direction.
+
+
+
+ getCenter ()
+ LatLng
+ Returns the center point of the bounds.
+
+
+
+ getSouthWest ()
+ LatLng
+ Returns the south-west point of the bounds.
+
+
+
+ getNorthEast ()
+ LatLng
+ Returns the north-east point of the bounds.
+
+
+
+ getNorthWest ()
+ LatLng
+ Returns the north-west point of the bounds.
+
+
+
+ getSouthEast ()
+ LatLng
+ Returns the south-east point of the bounds.
+
+
+
+ getWest ()
+ Number
+ Returns the west longitude of the bounds
+
+
+
+ getSouth ()
+ Number
+ Returns the south latitude of the bounds
+
+
+
+ getEast ()
+ Number
+ Returns the east longitude of the bounds
+
+
+
+ getNorth ()
+ Number
+ Returns the north latitude of the bounds
+
+
+
+ contains (<LatLngBounds > otherBounds )
+ Boolean
+ Returns true if the rectangle contains the given one.
+
+
+
+ contains (<LatLng > latlng )
+ Boolean
+ Returns true if the rectangle contains the given point.
+
+
+
+ intersects (<LatLngBounds > otherBounds )
+ Boolean
+ Returns true if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common.
+
+
+
+ overlaps (<Bounds > otherBounds )
+ Boolean
+ Returns true if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area.
+
+
+
+ toBBoxString ()
+ String
+ Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format. Useful for sending requests to web services that return geo data.
+
+
+
+ equals (<LatLngBounds > otherBounds , <Number> maxMargin? )
+ Boolean
+ Returns true if the rectangle is equivalent (within a small margin of error) to the given bounds. The margin of error can be overridden by setting maxMargin to a small number.
+
+
+
+ isValid ()
+ Boolean
+ Returns true if the bounds are properly initialized.
+
+
+
+
+
+
+
+ Point Represents a point with x and y coordinates in pixels.
+
+
+Usage example
+
+
+
+
+
+
+
+var point = L.point(200, 300);
+
+All Leaflet methods and options that accept Point objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent:
+map.panBy([200, 300]);
+map.panBy(L.point(200, 300));
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.point (<Number> x , <Number> y , <Boolean> round? )
+ Creates a Point object with the given x and y coordinates. If optional round is set to true, rounds the x and y values.
+
+
+ L.point (<Number[]> coords )
+ Expects an array of the form [x, y] instead.
+
+
+ L.point (<Object> coords )
+ Expects a plain object of the form {x: Number, y: Number} instead.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ clone ()
+ Point
+ Returns a copy of the current point.
+
+
+
+ add (<Point > otherPoint )
+ Point
+ Returns the result of addition of the current and the given points.
+
+
+
+ subtract (<Point > otherPoint )
+ Point
+ Returns the result of subtraction of the given point from the current.
+
+
+
+ divideBy (<Number> num )
+ Point
+ Returns the result of division of the current point by the given number.
+
+
+
+ multiplyBy (<Number> num )
+ Point
+ Returns the result of multiplication of the current point by the given number.
+
+
+
+ scaleBy (<Point > scale )
+ Point
+ Multiply each coordinate of the current point by each coordinate of
+scale. In linear algebra terms, multiply the point by the
+scaling matrix
+defined by scale.
+
+
+
+ unscaleBy (<Point > scale )
+ Point
+ Inverse of scaleBy. Divide each coordinate of the current point by
+each coordinate of scale.
+
+
+
+ round ()
+ Point
+ Returns a copy of the current point with rounded coordinates.
+
+
+
+ floor ()
+ Point
+ Returns a copy of the current point with floored coordinates (rounded down).
+
+
+
+ ceil ()
+ Point
+ Returns a copy of the current point with ceiled coordinates (rounded up).
+
+
+
+ distanceTo (<Point > otherPoint )
+ Number
+ Returns the cartesian distance between the current and the given points.
+
+
+
+ equals (<Point > otherPoint )
+ Boolean
+ Returns true if the given point has the same coordinates.
+
+
+
+ contains (<Point > otherPoint )
+ Boolean
+ Returns true if both coordinates of the given point are less than the corresponding current point coordinates (in absolute values).
+
+
+
+ toString ()
+ String
+ Returns a string representation of the point for debugging purposes.
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ x
+ Number
+ The x coordinate of the point
+
+
+ y
+ Number
+ The y coordinate of the point
+
+
+
+
+
+
+ Bounds Represents a rectangular area in pixel coordinates.
+
+
+Usage example
+
+
+
+
+
+
+
+var p1 = L.point(10, 10),
+p2 = L.point(40, 60),
+bounds = L.bounds(p1, p2);
+
+All Leaflet methods that accept Bounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:
+otherBounds.intersects([[10, 10], [40, 60]]);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.bounds (<Point > corner1 , <Point > corner2 )
+ Creates a Bounds object from two corners coordinate pairs.
+
+
+ L.bounds (<Point[]> points )
+ Creates a Bounds object from the given array of points.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ extend (<Point > point )
+ this
+ Extends the bounds to contain the given point.
+
+
+
+ getCenter (<Boolean> round? )
+ Point
+ Returns the center point of the bounds.
+
+
+
+ getBottomLeft ()
+ Point
+ Returns the bottom-left point of the bounds.
+
+
+
+ getTopRight ()
+ Point
+ Returns the top-right point of the bounds.
+
+
+
+ getTopLeft ()
+ Point
+ Returns the top-left point of the bounds (i.e. this.min ).
+
+
+
+ getBottomRight ()
+ Point
+ Returns the bottom-right point of the bounds (i.e. this.max ).
+
+
+
+ getSize ()
+ Point
+ Returns the size of the given bounds
+
+
+
+ contains (<Bounds > otherBounds )
+ Boolean
+ Returns true if the rectangle contains the given one.
+
+
+
+ contains (<Point > point )
+ Boolean
+ Returns true if the rectangle contains the given point.
+
+
+
+ intersects (<Bounds > otherBounds )
+ Boolean
+ Returns true if the rectangle intersects the given bounds. Two bounds
+intersect if they have at least one point in common.
+
+
+
+ overlaps (<Bounds > otherBounds )
+ Boolean
+ Returns true if the rectangle overlaps the given bounds. Two bounds
+overlap if their intersection is an area.
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ min
+ Point
+ The top left corner of the rectangle.
+
+
+ max
+ Point
+ The bottom right corner of the rectangle.
+
+
+
+
+
+
+ Icon Represents an icon to provide when creating a marker.
+
+
+Usage example
+
+
+
+
+
+
+
+var myIcon = L.icon({
+ iconUrl: 'my-icon.png',
+ iconSize: [38, 95],
+ iconAnchor: [22, 94],
+ popupAnchor: [-3, -76],
+ shadowUrl: 'my-icon-shadow.png',
+ shadowSize: [68, 95],
+ shadowAnchor: [22, 94]
+});
+L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
+
+L.Icon.Default extends L.Icon and is the blue icon Leaflet uses for markers by default.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.icon (<Icon options > options )
+ Creates an icon instance with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ iconUrl
+ String
+ null
+ (required) The URL to the icon image (absolute or relative to your script path).
+
+
+ iconRetinaUrl
+ String
+ null
+ The URL to a retina sized version of the icon image (absolute or relative to your
+script path). Used for Retina screen devices.
+
+
+ iconSize
+ Point
+ null
+ Size of the icon image in pixels.
+
+
+ iconAnchor
+ Point
+ null
+ The coordinates of the "tip" of the icon (relative to its top left corner). The icon
+will be aligned so that this point is at the marker's geographical location. Centered
+by default if size is specified, also can be set in CSS with negative margins.
+
+
+
+ shadowUrl
+ String
+ null
+ The URL to the icon shadow image. If not specified, no shadow image will be created.
+
+
+ shadowRetinaUrl
+ String
+ null
+
+
+
+ shadowSize
+ Point
+ null
+ Size of the shadow image in pixels.
+
+
+ shadowAnchor
+ Point
+ null
+ The coordinates of the "tip" of the shadow (relative to its top left corner) (the same
+as iconAnchor if not specified).
+
+
+ className
+ String
+ ''
+ A custom class name to assign to both icon and shadow images. Empty by default.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ createIcon (<HTMLElement> oldIcon? )
+ HTMLElement
+ Called internally when the icon has to be shown, returns a <img> HTML element
+styled according to the options.
+
+
+
+ createShadow (<HTMLElement> oldIcon? )
+ HTMLElement
+ As createIcon, but for the shadow beneath it.
+
+
+
+
+
+
+
+
+
+
+Icon.Default
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ imagePath
+ String
+
+ Icon.Default will try to auto-detect the absolute location of the
+blue icon images. If you are placing these images in a non-standard
+way, set this option to point to the right absolute path.
+
+
+
+
+
+
+ DivIcon Represents a lightweight icon for markers that uses a simple <div>
+element instead of an image. Inherits from Icon but ignores the iconUrl and shadow options.
+
+
+Usage example
+
+
+
+
+
+
+
+var myIcon = L.divIcon({className: 'my-div-icon'});
+// you can set .my-div-icon styles in CSS
+L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
+
+By default, it has a 'leaflet-div-icon' CSS class and is styled as a little white square with a shadow.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.divIcon (<DivIcon options > options )
+ Creates a DivIcon instance with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ html
+ String
+ ''
+ Custom HTML code to put inside the div element, empty by default.
+
+
+ bgPos
+ Point
+ [0, 0]
+ Optional relative position of the background, in pixels
+
+
+
+
+
+
+
+
▶ Options inherited from Icon
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ iconUrl
+ String
+ null
+ (required) The URL to the icon image (absolute or relative to your script path).
+
+
+ iconRetinaUrl
+ String
+ null
+ The URL to a retina sized version of the icon image (absolute or relative to your
+script path). Used for Retina screen devices.
+
+
+ iconSize
+ Point
+ null
+ Size of the icon image in pixels.
+
+
+ iconAnchor
+ Point
+ null
+ The coordinates of the "tip" of the icon (relative to its top left corner). The icon
+will be aligned so that this point is at the marker's geographical location. Centered
+by default if size is specified, also can be set in CSS with negative margins.
+
+
+
+ shadowUrl
+ String
+ null
+ The URL to the icon shadow image. If not specified, no shadow image will be created.
+
+
+ shadowRetinaUrl
+ String
+ null
+
+
+
+ shadowSize
+ Point
+ null
+ Size of the shadow image in pixels.
+
+
+ shadowAnchor
+ Point
+ null
+ The coordinates of the "tip" of the shadow (relative to its top left corner) (the same
+as iconAnchor if not specified).
+
+
+ className
+ String
+ ''
+ A custom class name to assign to both icon and shadow images. Empty by default.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Icon
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ createIcon (<HTMLElement> oldIcon? )
+ HTMLElement
+ Called internally when the icon has to be shown, returns a <img> HTML element
+styled according to the options.
+
+
+
+ createShadow (<HTMLElement> oldIcon? )
+ HTMLElement
+ As createIcon, but for the shadow beneath it.
+
+
+
+
+
+
+
+
+ Control.Zoom A basic zoom control with two buttons (zoom in and zoom out). It is put on the map by default unless you set its zoomControl option to false. Extends Control .
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.control.zoom (<Control.Zoom options > options )
+ Creates a zoom control
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ zoomInText
+ String
+ '+'
+ The text set on the 'zoom in' button.
+
+
+ zoomInTitle
+ String
+ 'Zoom in'
+ The title set on the 'zoom in' button.
+
+
+ zoomOutText
+ String
+ '−
+ '
+The text set on the 'zoom out' button.
+
+
+ zoomOutTitle
+ String
+ 'Zoom out'
+ The title set on the 'zoom out' button.
+
+
+
+
+
+
+
+
▶ Options inherited from Control
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Control
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+
+
+ Control.Attribution The attribution control allows you to display attribution data in a small text box on a map. It is put on the map by default unless you set its attributionControl option to false, and it fetches attribution texts from layers with the getAttribution method automatically. Extends Control.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ prefix
+ String
+ 'Leaflet'
+ The HTML text shown before the attributions. Pass false to disable.
+
+
+
+
+
+
+
+
▶ Options inherited from Control
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setPrefix (<String> prefix )
+ this
+ Sets the text before the attributions.
+
+
+
+ addAttribution (<String> text )
+ this
+ Adds an attribution text (e.g. 'Vector data © Mapbox').
+
+
+
+ removeAttribution (<String> text )
+ this
+ Removes an attribution text.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Control
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+
+
+ Control.Layers The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the detailed example ). Extends Control .
+
+
+Usage example
+
+
+
+
+
+
+
+var baseLayers = {
+ "Mapbox": mapbox,
+ "OpenStreetMap": osm
+};
+var overlays = {
+ "Marker": marker,
+ "Roads": roadsLayer
+};
+L.control.layers(baseLayers, overlays).addTo(map);
+
+The baseLayers and overlays parameters are object literals with layer names as keys and Layer objects as values:
+{
+ "<someName1>": layer1,
+ "<someName2>": layer2
+}
+
+The layer names can contain HTML, which allows you to add additional styling to the items:
+{"<img src='my-layer-icon' /> <span class='my-layer-item'>My Layer</span>": myLayer}
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.control.layers (<Object> baselayers? , <Object> overlays? , <Control.Layers options > options? )
+ Creates an attribution control with the given layers. Base layers will be switched with radio buttons, while overlays will be switched with checkboxes. Note that all base layers should be passed in the base layers object, but only one should be added to the map during map instantiation.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ collapsed
+ Boolean
+ true
+ If true, the control will be collapsed into an icon and expanded on mouse hover or touch.
+
+
+ autoZIndex
+ Boolean
+ true
+ If true, the control will assign zIndexes in increasing order to all of its layers so that the order is preserved when switching them on/off.
+
+
+ hideSingleBase
+ Boolean
+ false
+ If true, the base layers in the control will be hidden when there is only one.
+
+
+ sortLayers
+ Boolean
+ false
+ Whether to sort the layers. When false, layers will keep the order
+in which they were added to the control.
+
+
+ sortFunction
+ Function
+ *
+ A compare function
+that will be used for sorting the layers, when sortLayers is true.
+The function receives both the L.Layer instances and their names, as in
+sortFunction(layerA, layerB, nameA, nameB).
+By default, it sorts layers alphabetically by their name.
+
+
+
+
+
+
+
+
▶ Options inherited from Control
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addBaseLayer (<Layer > layer , <String> name )
+ this
+ Adds a base layer (radio button entry) with the given name to the control.
+
+
+
+ addOverlay (<Layer > layer , <String> name )
+ this
+ Adds an overlay (checkbox entry) with the given name to the control.
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Remove the given layer from the control.
+
+
+
+ expand ()
+ this
+ Expand the control container if collapsed.
+
+
+
+ collapse ()
+ this
+ Collapse the control container if expanded.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Control
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+
+
+ Control.Scale A simple scale control that shows the scale of the current center of screen in metric (m/km) and imperial (mi/ft) systems. Extends Control .
+
+
+Usage example
+
+
+
+
+
+
+
+L.control.scale().addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.control.scale (<Control.Scale options > options? )
+ Creates an scale control with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ maxWidth
+ Number
+ 100
+ Maximum width of the control in pixels. The width is set dynamically to show round values (e.g. 100, 200, 500).
+
+
+ metric
+ Boolean
+ True
+ Whether to show the metric scale line (m/km).
+
+
+ imperial
+ Boolean
+ True
+ Whether to show the imperial scale line (mi/ft).
+
+
+ updateWhenIdle
+ Boolean
+ false
+ If true, the control is updated on moveend , otherwise it's always up-to-date (updated on move ).
+
+
+
+
+
+
+
+
▶ Options inherited from Control
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Control
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+
+
+ Browser A namespace with static properties for browser/feature detection used by Leaflet internally.
+
+
+Usage example
+
+
+
+
+
+
+
+if (L.Browser.ielt9) {
+ alert('Upgrade your browser, dude!');
+}
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ ie
+ Boolean
+ true for all Internet Explorer versions (not Edge).
+
+
+ ielt9
+ Boolean
+ true for Internet Explorer versions less than 9.
+
+
+ edge
+ Boolean
+ true for the Edge web browser.
+
+
+ webkit
+ Boolean
+ true for webkit-based browsers like Chrome and Safari (including mobile versions).
+
+
+ android
+ Boolean
+ true for any browser running on an Android platform.
+
+
+ android23
+ Boolean
+ true for browsers running on Android 2 or Android 3.
+
+
+ opera
+ Boolean
+ true for the Opera browser
+
+
+ chrome
+ Boolean
+ true for the Chrome browser.
+
+
+ gecko
+ Boolean
+ true for gecko-based browsers like Firefox.
+
+
+ safari
+ Boolean
+ true for the Safari browser.
+
+
+ opera12
+ Boolean
+ true for the Opera browser supporting CSS transforms (version 12 or later).
+
+
+ win
+ Boolean
+ true when the browser is running in a Windows platform
+
+
+ ie3d
+ Boolean
+ true for all Internet Explorer versions supporting CSS transforms.
+
+
+ webkit3d
+ Boolean
+ true for webkit-based browsers supporting CSS transforms.
+
+
+ gecko3d
+ Boolean
+ true for gecko-based browsers supporting CSS transforms.
+
+
+ any3d
+ Boolean
+ true for all browsers supporting CSS transforms.
+
+
+ mobile
+ Boolean
+ true for all browsers running in a mobile device.
+
+
+ mobileWebkit
+ Boolean
+ true for all webkit-based browsers in a mobile device.
+
+
+ mobileWebkit3d
+ Boolean
+ true for all webkit-based browsers in a mobile device supporting CSS transforms.
+
+
+ msPointer
+ Boolean
+ true for browsers implementing the Microsoft touch events model (notably IE10).
+
+
+ pointer
+ Boolean
+ true for all browsers supporting pointer events .
+
+
+ touch
+ Boolean
+ true for all browsers supporting touch events .
+This does not necessarily mean that the browser is running in a computer with
+a touchscreen, it only means that the browser is capable of understanding
+touch events.
+
+
+ mobileOpera
+ Boolean
+ true for the Opera browser in a mobile device.
+
+
+ mobileGecko
+ Boolean
+ true for gecko-based browsers running in a mobile device.
+
+
+ retina
+ Boolean
+ true for browsers on a high-resolution "retina" screen.
+
+
+ canvas
+ Boolean
+ true when the browser supports <canvas> .
+
+
+ svg
+ Boolean
+ true when the browser supports SVG .
+
+
+ vml
+ Boolean
+ true if the browser supports VML .
+
+
+
+
+
+
+ Util Various utility functions, used by Leaflet internally.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ extend (<Object> dest , <Object> src? )
+ Object
+ Merges the properties of the src object (or multiple objects) into dest object and returns the latter. Has an L.extend shortcut.
+
+
+ create (<Object> proto , <Object> properties? )
+ Object
+ Compatibility polyfill for Object.create
+
+
+ bind (<Function> fn , … )
+ Function
+ Returns a new function bound to the arguments passed, like Function.prototype.bind .
+Has a L.bind() shortcut.
+
+
+ stamp (<Object> obj )
+ Number
+ Returns the unique ID of an object, assigning it one if it doesn't have it.
+
+
+ throttle (<Function> fn , <Number> time , <Object> context )
+ Function
+ Returns a function which executes function fn with the given scope context
+(so that the this keyword refers to context inside fn's code). The function
+fn will be called no more than one time per given amount of time. The arguments
+received by the bound function will be any arguments passed when binding the
+function, followed by any arguments passed when invoking the bound function.
+Has an L.throttle shortcut.
+
+
+ wrapNum (<Number> num , <Number[]> range , <Boolean> includeMax? )
+ Number
+ Returns the number num modulo range in such a way so it lies within
+range[0] and range[1]. The returned value will be always smaller than
+range[1] unless includeMax is set to true.
+
+
+ falseFn ()
+ Function
+ Returns a function which always returns false.
+
+
+ formatNum (<Number> num , <Number> digits? )
+ Number
+ Returns the number num rounded to digits decimals, or to 5 decimals by default.
+
+
+ trim (<String> str )
+ String
+ Compatibility polyfill for String.prototype.trim
+
+
+ splitWords (<String> str )
+ String[]
+ Trims and splits the string on whitespace and returns the array of parts.
+
+
+ setOptions (<Object> obj , <Object> options )
+ Object
+ Merges the given properties to the options of the obj object, returning the resulting options. See Class options. Has an L.setOptions shortcut.
+
+
+ getParamString (<Object> obj , <String> existingUrl? , <Boolean> uppercase? )
+ String
+ Converts an object into a parameter URL string, e.g. {a: "foo", b: "bar"}
+translates to '?a=foo&b=bar'. If existingUrl is set, the parameters will
+be appended at the end. If uppercase is true, the parameter names will
+be uppercased (e.g. '?A=foo&B=bar')
+
+
+ template (<String> str , <Object> data )
+ String
+ Simple templating facility, accepts a template string of the form 'Hello {a}, {b}'
+and a data object like {a: 'foo', b: 'bar'}, returns evaluated string
+('Hello foo, bar'). You can also specify functions instead of strings for
+data values — they will be evaluated passing data as an argument.
+
+
+ isArray (obj )
+ Boolean
+ Compatibility polyfill for Array.isArray
+
+
+ indexOf (<Array> array , <Object> el )
+ Number
+ Compatibility polyfill for Array.prototype.indexOf
+
+
+ requestAnimFrame (<Function> fn , <Object> context? , <Boolean> immediate? )
+ Number
+ Schedules fn to be executed when the browser repaints. fn is bound to
+context if given. When immediate is set, fn is called immediately if
+the browser doesn't have native support for
+window.requestAnimationFrame ,
+otherwise it's delayed. Returns a request ID that can be used to cancel the request.
+
+
+ cancelAnimFrame (<Number> id )
+ undefined
+ Cancels a previous requestAnimFrame. See also window.cancelAnimationFrame .
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ lastId
+ Number
+ Last unique ID used by stamp()
+
+
+ emptyImageUrl
+ String
+ Data URI string containing a base64-encoded empty GIF image.
+Used as a hack to free memory from unused images on WebKit-powered
+mobile devices (by setting image src to this string).
+
+
+
+
+
+
+ Represents an affine transformation: a set of coefficients a, b, c, d
+for transforming a point of a form (x, y) into (a*x + b, c*y + d) and doing
+the reverse. Used by Leaflet in its projections code.
+
+
+
+
+
+
+
+
+
+
+var transformation = L.transformation(2, 5, -1, 10),
+ p = L.point(1, 2),
+ p2 = transformation.transform(p), // L.point(7, 8)
+ p3 = transformation.untransform(p2); // L.point(1, 2)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.transformation (<Number> a , <Number> b , <Number> c , <Number> d )
+ Instantiates a Transformation object with the given coefficients.
+
+
+ L.transformation (<Array> coefficients )
+ Expects an coefficients array of the form
+[a: Number, b: Number, c: Number, d: Number].
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ transform (<Point > point , <Number> scale? )
+ Point
+ Returns a transformed point, optionally multiplied by the given scale.
+Only accepts actual L.Point instances, not arrays.
+
+
+
+ untransform (<Point > point , <Number> scale? )
+ Point
+ Returns the reverse transformation of the given point, optionally divided
+by the given scale. Only accepts actual L.Point instances, not arrays.
+
+
+
+
+
+
+
+ LineUtil Various utility functions for polyline points processing, used by Leaflet internally to make polylines lightning-fast.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ simplify (<Point[]> points , <Number> tolerance )
+ Point[]
+ Dramatically reduces the number of points in a polyline while retaining
+its shape and returns a new array of simplified points, using the
+Douglas-Peucker algorithm .
+Used for a huge performance boost when processing/displaying Leaflet polylines for
+each zoom level and also reducing visual noise. tolerance affects the amount of
+simplification (lesser value means higher quality but slower and with more points).
+Also released as a separated micro-library Simplify.js .
+
+
+ pointToSegmentDistance (<Point > p , <Point > p1 , <Point > p2 )
+ Number
+ Returns the distance between point p and segment p1 to p2.
+
+
+ closestPointOnSegment (<Point > p , <Point > p1 , <Point > p2 )
+ Number
+ Returns the closest point from a point p on a segment p1 to p2.
+
+
+ clipSegment (<Point > a , <Point > b , <Bounds > bounds , <Boolean> useLastCode? , <Boolean> round? )
+ Point[]|Boolean
+ Clips the segment a to b by rectangular bounds with the
+Cohen-Sutherland algorithm
+(modifying the segment points directly!). Used by Leaflet to only show polyline
+points that are on the screen or near, increasing performance.
+
+
+
+
+
+
+ PolyUtil Various utility functions for polygon geometries.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ clipPolygon (<Point[]> points , <Bounds > bounds , <Boolean> round? )
+ Point[]
+ Clips the polygon geometry defined by the given points by the given bounds (using the Sutherland-Hodgeman algorithm ).
+Used by Leaflet to only show polygon points that are on the screen or near, increasing
+performance. Note that polygon points needs different algorithm for clipping
+than polyline, so there's a separate method for it.
+
+
+
+
+
+
+ DomEvent Utility functions to work with the DOM events , used by Leaflet internally.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ on (<HTMLElement> el , <String> types , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular DOM event type of the
+element el. You can optionally specify the context of the listener
+(object the this keyword will point to). You can also pass several
+space-separated types (e.g. 'click dblclick').
+
+
+ on (<HTMLElement> el , <Object> eventMap , <Object> context? )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+ off (<HTMLElement> el , <String> types , <Function> fn , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified,
+it will remove all the listeners of that particular DOM event from the element.
+Note that if you passed a custom context to on, you must pass the same
+context to off in order to remove the listener.
+
+
+ off (<HTMLElement> el , <Object> eventMap , <Object> context? )
+ this
+ Removes a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+ off (<HTMLElement> el )
+ this
+ Removes all known event listeners
+
+
+ stopPropagation (<DOMEvent> ev )
+ this
+ Stop the given event from propagation to parent elements. Used inside the listener functions:
+L.DomEvent.on(div, 'click', function (ev) {
+ L.DomEvent.stopPropagation(ev);
+});
+
+
+
+ disableScrollPropagation (<HTMLElement> el )
+ this
+ Adds stopPropagation to the element's 'mousewheel' events (plus browser variants).
+
+
+ disableClickPropagation (<HTMLElement> el )
+ this
+ Adds stopPropagation to the element's 'click', 'doubleclick',
+'mousedown' and 'touchstart' events (plus browser variants).
+
+
+ preventDefault (<DOMEvent> ev )
+ this
+ Prevents the default action of the DOM Event ev from happening (such as
+following a link in the href of the a element, or doing a POST request
+with page reload when a <form> is submitted).
+Use it inside listener functions.
+
+
+ stop (ev )
+ this
+ Does stopPropagation and preventDefault at the same time.
+
+
+ getMousePosition (<DOMEvent> ev , <HTMLElement> container? )
+ Point
+ Gets normalized mouse position from a DOM event relative to the
+container or to the whole page if not specified.
+
+
+ getWheelDelta (<DOMEvent> ev )
+ Number
+ Gets normalized wheel delta from a mousewheel DOM event, in vertical
+pixels scrolled (negative if scrolling down).
+Events from pointing devices without precise scrolling are mapped to
+a best guess of 60 pixels.
+
+
+ addListener (… )
+ this
+ Alias to L.DomEvent.on
+
+
+ removeListener (… )
+ this
+ Alias to L.DomEvent.off
+
+
+
+
+
+
+ DomUtil Utility functions to work with the DOM
+tree, used by Leaflet internally.
+Most functions expecting or returning a HTMLElement also work for
+SVG elements. The only difference is that classes refer to CSS classes
+in HTML and SVG classes in SVG.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ get (<String|HTMLElement> id )
+ HTMLElement
+ Returns an element given its DOM id, or returns the element itself
+if it was passed directly.
+
+
+ getStyle (<HTMLElement> el , <String> styleAttrib )
+ String
+ Returns the value for a certain style attribute on an element,
+including computed values or values set through CSS.
+
+
+ create (<String> tagName , <String> className? , <HTMLElement> container? )
+ HTMLElement
+ Creates an HTML element with tagName, sets its class to className, and optionally appends it to container element.
+
+
+ remove (<HTMLElement> el )
+
+ Removes el from its parent element
+
+
+ empty (<HTMLElement> el )
+
+ Removes all of el's children elements from el
+
+
+ toFront (<HTMLElement> el )
+
+ Makes el the last child of its parent, so it renders in front of the other children.
+
+
+ toBack (<HTMLElement> el )
+
+ Makes el the first child of its parent, so it renders behind the other children.
+
+
+ hasClass (<HTMLElement> el , <String> name )
+ Boolean
+ Returns true if the element's class attribute contains name.
+
+
+ addClass (<HTMLElement> el , <String> name )
+
+ Adds name to the element's class attribute.
+
+
+ removeClass (<HTMLElement> el , <String> name )
+
+ Removes name from the element's class attribute.
+
+
+ setClass (<HTMLElement> el , <String> name )
+
+ Sets the element's class.
+
+
+ getClass (<HTMLElement> el )
+ String
+ Returns the element's class.
+
+
+ setOpacity (<HTMLElement> el , <Number> opacity )
+
+ Set the opacity of an element (including old IE support).
+opacity must be a number from 0 to 1.
+
+
+ testProp (<String[]> props )
+ String|false
+ Goes through the array of style names and returns the first name
+that is a valid style name for an element. If no such name is found,
+it returns false. Useful for vendor-prefixed styles like transform.
+
+
+ setTransform (<HTMLElement> el , <Point > offset , <Number> scale? )
+
+ Resets the 3D CSS transform of el so it is translated by offset pixels
+and optionally scaled by scale. Does not have an effect if the
+browser doesn't support 3D CSS transforms.
+
+
+ setPosition (<HTMLElement> el , <Point > position )
+
+ Sets the position of el to coordinates specified by position,
+using CSS translate or top/left positioning depending on the browser
+(used by Leaflet internally to position its layers).
+
+
+ getPosition (<HTMLElement> el )
+ Point
+ Returns the coordinates of an element previously positioned with setPosition.
+
+
+ disableTextSelection ()
+
+ Prevents the user from generating selectstart DOM events, usually generated
+when the user drags the mouse through a page with text. Used internally
+by Leaflet to override the behaviour of any click-and-drag interaction on
+the map. Affects drag interactions on the whole document.
+
+
+ enableTextSelection ()
+
+ Cancels the effects of a previous L.DomUtil.disableTextSelection .
+
+
+ disableImageDrag ()
+
+ As L.DomUtil.disableTextSelection , but
+for dragstart DOM events, usually generated when the user drags an image.
+
+
+ enableImageDrag ()
+
+ Cancels the effects of a previous L.DomUtil.disableImageDrag .
+
+
+ preventOutline (<HTMLElement> el )
+
+ Makes the outline
+of the element el invisible. Used internally by Leaflet to prevent
+focusable elements from displaying an outline when the user performs a
+drag interaction on them.
+
+
+ restoreOutline ()
+
+ Cancels the effects of a previous L.DomUtil.preventOutline .
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ TRANSFORM
+ String
+ Vendor-prefixed transform style name (e.g. 'webkitTransform' for WebKit).
+
+
+ TRANSITION
+ String
+ Vendor-prefixed transition style name.
+
+
+ TRANSITION_END
+ String
+ Vendor-prefixed transitionend event name.
+
+
+
+
+
+
+ PosAnimation Used internally for panning animations, utilizing CSS3 Transitions for modern browsers and a timer fallback for IE6-9.
+
+
+Usage example
+
+
+
+
+
+
+
+var fx = new L.PosAnimation();
+fx.run(el, [300, 500], 0.5);
+
+
+
+
+
+
+
+
+Constructor
+
+
+
+
+
+
+
+
+ Constructor
+ Description
+
+
+
+ L.PosAnimation ()
+ Creates a PosAnimation object.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ start
+ Event
+ Fired when the animation starts
+
+
+ step
+ Event
+ Fired continuously during the animation.
+
+
+ end
+ Event
+ Fired when the animation ends.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ run (<HTMLElement> el , <Point > newPos , <Number> duration? , <Number> easeLinearity? )
+
+ Run an animation of a given element to a new position, optionally setting
+duration in seconds (0.25 by default) and easing linearity factor (3rd
+argument of the cubic bezier curve ,
+0.5 by default).
+
+
+
+ stop ()
+
+ Stops the animation (if currently running).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Draggable A class for making DOM elements draggable (including touch support).
+Used internally for map and marker dragging. Only works for elements
+that were positioned with L.DomUtil.setPosition .
+
+
+Usage example
+
+
+
+
+
+
+
+var draggable = new L.Draggable(elementToDrag);
+draggable.enable();
+
+
+
+
+
+
+
+
+Constructor
+
+
+
+
+
+
+
+
+ Constructor
+ Description
+
+
+
+ L.Draggable (<HTMLElement> el , <HTMLElement> dragHandle? , <Boolean> preventOutline? , <Draggable options > options? )
+ Creates a Draggable object for moving el when you start dragging the dragHandle element (equals el itself by default).
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ clickTolerance
+ Number
+ 3
+ The max number of pixels a user can shift the mouse pointer during a click
+for it to be considered a valid click (as opposed to a mouse drag).
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ down
+ Event
+ Fired when a drag is about to start.
+
+
+ dragstart
+ Event
+ Fired when a drag starts
+
+
+ predrag
+ Event
+ Fired continuously during dragging before each corresponding
+update of the element's position.
+
+
+ drag
+ Event
+ Fired continuously during dragging.
+
+
+ dragend
+ DragEndEvent
+ Fired when the drag ends.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ enable ()
+
+ Enables the dragging ability
+
+
+
+ disable ()
+
+ Disables the dragging ability
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Class L.Class powers the OOP facilities of Leaflet and is used to create almost all of the Leaflet classes documented here.
+In addition to implementing a simple classical inheritance model, it introduces several special properties for convenient code organization — options, includes and statics.
+
+
+Usage example
+
+
+
+
+
+
+
+var MyClass = L.Class.extend({
+initialize: function (greeter) {
+ this.greeter = greeter;
+ // class constructor
+},
+greet: function (name) {
+ alert(this.greeter + ', ' + name)
+ }
+});
+// create instance of MyClass, passing "Hello" to the constructor
+var a = new MyClass("Hello");
+// call greet method, alerting "Hello, World"
+a.greet("World");
+
+
+
+
+
+
+Class Factories
+
+
+
+You may have noticed that Leaflet objects are created without using
+the new keyword. This is achieved by complementing each class with a
+lowercase factory method:
+new L.Map('map'); // becomes:
+L.map('map');
+
+The factories are implemented very easily, and you can do this for your own classes:
+L.map = function (id, options) {
+ return new L.Map(id, options);
+};
+
+
+
+
+
+
+Inheritance
+
+
+
+You use L.Class.extend to define new classes, but you can use the same method on any class to inherit from it:
+var MyChildClass = MyClass.extend({
+ // ... new properties and methods
+});
+
+This will create a class that inherits all methods and properties of the parent class (through a proper prototype chain), adding or overriding the ones you pass to extend. It will also properly react to instanceof:
+var a = new MyChildClass();
+a instanceof MyChildClass; // true
+a instanceof MyClass; // true
+
+You can call parent methods (including constructor) from corresponding child ones (as you do with super calls in other languages) by accessing parent class prototype and using JavaScript's call or apply:
+var MyChildClass = MyClass.extend({
+ initialize: function () {
+ MyClass.prototype.initialize.call(this, "Yo");
+ },
+ greet: function (name) {
+ MyClass.prototype.greet.call(this, 'bro ' + name + '!');
+ }
+});
+var a = new MyChildClass();
+a.greet('Jason'); // alerts "Yo, bro Jason!"
+
+
+
+
+
+Options
+
+
+
+options is a special property that unlike other objects that you pass
+to extend will be merged with the parent one instead of overriding it
+completely, which makes managing configuration of objects and default
+values convenient:
+var MyClass = L.Class.extend({
+ options: {
+ myOption1: 'foo',
+ myOption2: 'bar'
+ }
+});
+var MyChildClass = MyClass.extend({
+ options: {
+ myOption1: 'baz',
+ myOption3: 5
+ }
+});
+var a = new MyChildClass();
+a.options.myOption1; // 'baz'
+a.options.myOption2; // 'bar'
+a.options.myOption3; // 5
+
+There's also L.Util.setOptions , a method for
+conveniently merging options passed to constructor with the defaults
+defines in the class:
+var MyClass = L.Class.extend({
+ options: {
+ foo: 'bar',
+ bla: 5
+ },
+ initialize: function (options) {
+ L.Util.setOptions(this, options);
+ ...
+ }
+});
+var a = new MyClass({bla: 10});
+a.options; // {foo: 'bar', bla: 10}
+
+
+
+
+
+
+Includes
+
+
+
+includes is a special class property that merges all specified objects into the class (such objects are called mixins).
+ var MyMixin = {
+ foo: function () { ... },
+ bar: 5
+};
+var MyClass = L.Class.extend({
+ includes: MyMixin
+});
+var a = new MyClass();
+a.foo();
+
+You can also do such includes in runtime with the include method:
+MyClass.include(MyMixin);
+
+statics is just a convenience property that injects specified object properties as the static properties of the class, useful for defining constants:
+var MyClass = L.Class.extend({
+ statics: {
+ FOO: 'bar',
+ BLA: 5
+ }
+});
+MyClass.FOO; // 'bar'
+
+
+
+
+
+
+Constructor hooks
+
+
+
+If you're a plugin developer, you often need to add additional initialization code to existing classes (e.g. editing hooks for L.Polyline ). Leaflet comes with a way to do it easily using the addInitHook method:
+MyClass.addInitHook(function () {
+ // ... do something in constructor additionally
+ // e.g. add event listeners, set custom properties etc.
+});
+
+You can also use the following shortcut when you just need to make one additional method call:
+MyClass.addInitHook('methodName', arg1, arg2, …);
+
+
+
+
+
+
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ extend (<Object> props )
+ Function
+ Extends the current class given the properties to be included.
+Returns a Javascript function that is a class constructor (to be called with new).
+
+
+ include (<Object> properties )
+ this
+ Includes a mixin into the current class.
+
+
+ mergeOptions (<Object> options )
+ this
+ Merges options into the defaults of the class.
+
+
+ addInitHook (<Function> fn )
+ this
+ Adds a constructor hook to the class.
+
+
+
+
+
+
+ Evented A set of methods shared between event-powered classes (like Map and Marker ). Generally, events allow you to execute some function when something happens with an object (e.g. the user clicks on the map, causing the map to fire 'click' event).
+
+
+Usage example
+
+
+
+
+
+
+
+map.on('click', function(e) {
+ alert(e.latlng);
+} );
+
+Leaflet deals with event listeners by reference, so if you want to add a listener and then remove it, define it as a function:
+function onClick(e) { ... }
+map.on('click', onClick);
+map.off('click', onClick);
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+ Layer A set of methods from the Layer base class that all Leaflet layers use.
+Inherits all methods, options and events from L.Evented .
+
+
+Usage example
+
+
+
+
+
+
+
+var layer = L.Marker(latlng).addTo(map);
+layer.addTo(map);
+layer.remove();
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ onAdd (<Map > map )
+ this
+ Should contain code that creates DOM elements for the layer, adds them to map panes where they should belong and puts listeners on relevant map events. Called on map.addLayer(layer) .
+
+
+
+ onRemove (<Map > map )
+ this
+ Should contain all clean up code that removes the layer's elements from the DOM and removes listeners previously added in onAdd . Called on map.removeLayer(layer) .
+
+
+
+ getEvents ()
+ Object
+ This optional method should return an object like { viewreset: this._reset } for addEventListener . The event handlers in this object will be automatically added and removed from the map with your layer.
+
+
+
+ getAttribution ()
+ String
+ This optional method should return a string containing HTML to be shown on the Attribution control whenever the layer is visible.
+
+
+
+ beforeAdd (<Map > map )
+ this
+ Optional method. Called on map.addLayer(layer) , before the layer is added to the map, before events are initialized, without waiting until the map is in a usable state. Use for early initialization only.
+
+
+
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Interactive layer Some Layer s can be made interactive - when the user interacts
+with such a layer, mouse events like click and mouseover can be handled.
+Use the event handling methods to handle these events.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this layer will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+Mouse events
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Control L.Control is a base class for implementing map controls. Handles positioning.
+All other controls extend from this class.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ onAdd (<Map > map )
+ HTMLElement
+ Should return the container DOM element for the control and add listeners on relevant map events. Called on control.addTo(map) .
+
+
+
+ onRemove (<Map > map )
+
+ Optional method. Should contain all clean up code that removes the listeners previously added in onAdd . Called on control.remove() .
+
+
+
+
+
+
+
+ Handler Abstract class for map interaction handlers
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ enable ()
+ this
+ Enables the handler
+
+
+
+ disable ()
+ this
+ Disables the handler
+
+
+
+ enabled ()
+ Boolean
+ Returns true if the handler is enabled
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addHooks ()
+
+ Called when the handler is enabled, should add event hooks.
+
+
+
+ removeHooks ()
+
+ Called when the handler is disabled, should remove the event hooks added previously.
+
+
+
+
+
+
+
+ Projection An object with methods for projecting geographical coordinates of the world onto
+a flat surface (and back). See Map projection .
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ project (<LatLng > latlng )
+ Point
+ Projects geographical coordinates into a 2D point.
+Only accepts actual L.LatLng instances, not arrays.
+
+
+
+ unproject (<Point > point )
+ LatLng
+ The inverse of project. Projects a 2D point into a geographical location.
+Only accepts actual L.Point instances, not arrays.
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ bounds
+ Bounds
+ The bounds (specified in CRS units) where the projection is valid
+
+
+
+
+
+
+
+Defined projections
+
+
+
+
+
+
+
+
+
+ Projection
+ Description
+
+
+
+ L.Projection.LonLat
+ Equirectangular, or Plate Carree projection — the most simple projection,
+mostly used by GIS enthusiasts. Directly maps x as longitude, and y as
+latitude. Also suitable for flat worlds, e.g. game maps. Used by the
+EPSG:4326 and Simple CRS.
+
+
+ L.Projection.Mercator
+ Elliptical Mercator projection — more complex than Spherical Mercator. Takes into account that Earth is a geoid, not a perfect sphere. Used by the EPSG:3395 CRS.
+
+
+ L.Projection.SphericalMercator
+ Spherical Mercator projection — the most common projection for online maps,
+used by almost all free and commercial tile providers. Assumes that Earth is
+a sphere. Used by the EPSG:3857 CRS.
+
+
+
+
+
+
+ CRS
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ latLngToPoint (<LatLng > latlng , <Number> zoom )
+ Point
+ Projects geographical coordinates into pixel coordinates for a given zoom.
+
+
+
+ pointToLatLng (<Point > point , <Number> zoom )
+ LatLng
+ The inverse of latLngToPoint. Projects pixel coordinates on a given
+zoom into geographical coordinates.
+
+
+
+ project (<LatLng > latlng )
+ Point
+ Projects geographical coordinates into coordinates in units accepted for
+this CRS (e.g. meters for EPSG:3857, for passing it to WMS services).
+
+
+
+ unproject (<Point > point )
+ LatLng
+ Given a projected coordinate returns the corresponding LatLng.
+The inverse of project.
+
+
+
+ scale (<Number> zoom )
+ Number
+ Returns the scale used when transforming projected coordinates into
+pixel coordinates for a particular zoom. For example, it returns
+256 * 2^zoom for Mercator-based CRS.
+
+
+
+ zoom (<Number> scale )
+ Number
+ Inverse of scale(), returns the zoom level corresponding to a scale
+factor of scale.
+
+
+
+ getProjectedBounds (<Number> zoom )
+ Bounds
+ Returns the projection's bounds scaled and transformed for the provided zoom.
+
+
+
+ distance (<LatLng > latlng1 , <LatLng > latlng2 )
+ Number
+ Returns the distance between two geographical coordinates.
+
+
+
+ wrapLatLng (<LatLng > latlng )
+ LatLng
+ Returns a LatLng where lat and lng has been wrapped according to the
+CRS's wrapLat and wrapLng properties, if they are outside the CRS's bounds.
+
+
+
+ wrapLatLngBounds (<LatLngBounds > bounds )
+ LatLngBounds
+ Returns a LatLngBounds with the same size as the given one, ensuring
+that its center is within the CRS's bounds.
+Only accepts actual L.LatLngBounds instances, not arrays.
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ code
+ String
+ Standard code name of the CRS passed into WMS services (e.g. 'EPSG:3857')
+
+
+ wrapLng
+ Number[]
+ An array of two numbers defining whether the longitude (horizontal) coordinate
+axis wraps around a given range and how. Defaults to [-180, 180] in most
+geographical CRSs. If undefined, the longitude axis does not wrap around.
+
+
+ wrapLat
+ Number[]
+ Like wrapLng, but for the latitude (vertical) axis.
+
+
+ infinite
+ Boolean
+ If true, the coordinate space will be unbounded (infinite in both axes)
+
+
+
+
+
+
+
+Defined CRSs
+
+
+
+
+
+
+
+
+ CRS
+ Description
+
+
+
+ L.CRS.EPSG3395
+ Rarely used by some commercial tile providers. Uses Elliptical Mercator projection.
+
+
+ L.CRS.EPSG3857
+ The most common CRS for online maps, used by almost all free and commercial
+tile providers. Uses Spherical Mercator projection. Set in by default in
+Map's crs option.
+
+
+ L.CRS.EPSG4326
+ A common CRS among GIS enthusiasts. Uses simple Equirectangular projection.
+Leaflet 1.0.x complies with the TMS coordinate scheme for EPSG:4326 ,
+which is a breaking change from 0.7.x behaviour. If you are using a TileLayer
+with this CRS, ensure that there are two 256x256 pixel tiles covering the
+whole earth at zoom level zero, and that the tile coordinate origin is (-180,+90),
+or (-180,-90) for TileLayers with the tms option set.
+
+
+ L.CRS.Earth
+ Serves as the base for CRS that are global such that they cover the earth.
+Can only be used as the base for other CRS and cannot be used directly,
+since it does not have a code, projection or transformation . distance() returns
+meters.
+
+
+ L.CRS.Simple
+ A simple CRS that maps longitude and latitude into x and y directly.
+May be used for maps of flat surfaces (e.g. game maps). Note that the y
+axis should still be inverted (going from bottom to top). distance() returns
+simple euclidean distance.
+
+
+ L.CRS.Base
+ Object that defines coordinate reference systems for projecting
+geographical points into pixel (screen) coordinates and back (and to
+coordinates in other units for WMS services). See
+spatial reference system .
+Leaflet defines the most usual CRSs by default. If you want to use a
+CRS not defined by default, take a look at the
+Proj4Leaflet plugin.
+
+
+
+
+
+
+ Renderer Base class for vector renderer implementations (SVG , Canvas ). Handles the
+DOM container of the renderer, its bounds, and its zoom animation.
+A Renderer works as an implicit layer group for all Path s - the renderer
+itself can be added or removed to the map. All paths use a renderer, which can
+be implicit (the map will decide the type of renderer and use it automatically)
+or explicit (using the renderer option of the path).
+Do not use this class directly, use SVG and Canvas instead.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ padding
+ Number
+ 0.1
+ How much to extend the clip area around the map view (relative to its size)
+e.g. 0.1 would be 10% of map view in each direction
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ update
+ Event
+ Fired when the renderer updates its bounds, center and zoom, for example when
+its map has moved
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Event objects Whenever a class inheriting from Evented fires an event, a listener function
+will be called with an event argument, which is a plain object containing
+information about the event. For example:
+
map.on('click', function(ev) {
+ alert(ev.latlng); // ev is an event object (MouseEvent in this case)
+});
+
+
The information available depends on the event type:
+
+
+
+
+Event
+
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+KeyboardEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ originalEvent
+ DOMEvent
+ The original DOM KeyboardEvent that triggered this Leaflet event.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+MouseEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ latlng
+ LatLng
+ The geographical point where the mouse event occurred.
+
+
+ layerPoint
+ Point
+ Pixel coordinates of the point where the mouse event occurred relative to the map layer.
+
+
+ containerPoint
+ Point
+ Pixel coordinates of the point where the mouse event occurred relative to the map сontainer.
+
+
+ originalEvent
+ DOMEvent
+ The original DOM MouseEvent or DOM TouchEvent that triggered this Leaflet event.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+LocationEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ latlng
+ LatLng
+ Detected geographical location of the user.
+
+
+ bounds
+ LatLngBounds
+ Geographical bounds of the area user is located in (with respect to the accuracy of location).
+
+
+ accuracy
+ Number
+ Accuracy of location in meters.
+
+
+ altitude
+ Number
+ Height of the position above the WGS84 ellipsoid in meters.
+
+
+ altitudeAccuracy
+ Number
+ Accuracy of altitude in meters.
+
+
+ heading
+ Number
+ The direction of travel in degrees counting clockwise from true North.
+
+
+ speed
+ Number
+ Current velocity in meters per second.
+
+
+ timestamp
+ Number
+ The time when the position was acquired.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+ErrorEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ message
+ String
+ Error message.
+
+
+ code
+ Number
+ Error code (if applicable).
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+LayerEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ layer
+ Layer
+ The layer that was added or removed.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+LayersControlEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ layer
+ Layer
+ The layer that was added or removed.
+
+
+ name
+ String
+ The name of the layer that was added or removed.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+TileEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ tile
+ HTMLElement
+ The tile element (image).
+
+
+ coords
+ Point
+ Point object with the tile's x, y, and z (zoom level) coordinates.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+TileErrorEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ tile
+ HTMLElement
+ The tile element (image).
+
+
+ coords
+ Point
+ Point object with the tile's x, y, and z (zoom level) coordinates.
+
+
+ error
+ *
+ Error passed to the tile's done() callback.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+ResizeEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ oldSize
+ Point
+ The old size before resize event.
+
+
+ newSize
+ Point
+ The new size after the resize event.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+GeoJSONEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ layer
+ Layer
+ The layer for the GeoJSON feature that is being added to the map.
+
+
+ properties
+ Object
+ GeoJSON properties of the feature.
+
+
+ geometryType
+ String
+ GeoJSON geometry type of the feature.
+
+
+ id
+ String
+ GeoJSON ID of the feature (if present).
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ tooltip
+ Tooltip
+ The tooltip that was opened or closed.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+DragEndEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ distance
+ Number
+ The distance in pixels the draggable element was moved by.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+ZoomAnimEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ center
+ LatLng
+ The current center of the map
+
+
+ zoom
+ Number
+ The current zoom level of the map
+
+
+ noUpdate
+ Boolean
+ Whether layers should update their contents due to this event
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+ DivOverlay Base model for L.Popup and L.Tooltip. Inherit from it for custom popup like plugins.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ offset
+ Point
+ Point(0, 7)
+ The offset of the popup position. Useful to control the anchor
+of the popup when opening it on some overlays.
+
+
+ className
+ String
+ ''
+ A custom CSS class name to assign to the popup.
+
+
+ pane
+ String
+ 'popupPane'
+ Map pane where the popup will be added.
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the layer to the given map
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Global Switches Global switches are created for rare cases and generally make
+Leaflet to not detect a particular browser feature even if it's
+there. You need to set the switch as a global variable to true
+before including Leaflet on the page, like this:
+
<script>L_NO_TOUCH = true;</script>
+<script src="leaflet.js"></script>
+
+
+
+
+Switch
+Description
+
+
+
+
+L_NO_TOUCH
+Forces Leaflet to not use touch events even if it detects them.
+
+
+L_DISABLE_3D
+Forces Leaflet to not use hardware-accelerated CSS 3D transforms for positioning (which may cause glitches in some rare environments) even if they're supported.
+
+
+
+
+
noConflict This method restores the L global variable to the original value
+it had before Leaflet inclusion, and returns the real Leaflet
+namespace so you can put it elsewhere, like this:
+
<script src='libs/l.js'>
+<!-- L points to some other library -->
+<script src='leaflet.js'>
+<!-- you include Leaflet, it replaces the L variable to Leaflet namespace -->
+<script>
+var Leaflet = L.noConflict();
+// now L points to that other library again, and you can use Leaflet.Map etc.
+</script>
+
+
+
version A constant that represents the Leaflet version in use.
+
L.version; // contains "1.0.0" (or whatever version is currently in use)
+
diff --git a/src/public/Leaflet-1.7.1/docs/reference-1.2.0.html b/src/public/Leaflet-1.7.1/docs/reference-1.2.0.html
new file mode 100644
index 0000000..fa0fa81
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/reference-1.2.0.html
@@ -0,0 +1,23471 @@
+---
+layout: v2
+title: Documentation
+bodyclass: api-page
+---
+
+
Leaflet API reference
+
+
This reference reflects Leaflet 1.2.0 . Check this list if you are using a different version of Leaflet.
+
+
+
+
Map
+
+
Map Methods
+
+
Map Misc
+
+
+
+
UI Layers
+
+
Raster Layers
+
+
Vector Layers
+
+
+
+
Other Layers
+
+
Basic Types
+
+
Controls
+
+
+
+
+
+
+
+
+
+
Utility
+
+
DOM Utility
+
+
+
+
Base Classes
+
+
+
Misc
+
+
+
+
+
Map The central class of the API — it is used to create a map on a page and manipulate it.
+
+
+Usage example
+
+
+
+
+
+
+
+// initialize the map on the "map" div with a given center and zoom
+var map = L.map('map', {
+ center: [51.505, -0.09],
+ zoom: 13
+});
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.map (<String> id , <Map options> options? )
+ Instantiates a map object given the DOM ID of a <div> element
+and optionally an object literal with Map options.
+
+
+ L.map (<HTMLElement> el , <Map options> options? )
+ Instantiates a map object given an instance of a <div> HTML element
+and optionally an object literal with Map options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ preferCanvas
+ Boolean
+ false
+ Whether Path s should be rendered on a Canvas renderer.
+By default, all Paths are rendered in a SVG renderer.
+
+
+
+
+
+Control options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attributionControl
+ Boolean
+ true
+ Whether a attribution control is added to the map by default.
+
+
+ zoomControl
+ Boolean
+ true
+ Whether a zoom control is added to the map by default.
+
+
+
+
+
+Interaction Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+
+ zoomSnap
+ Number
+ 1
+ Forces the map's zoom level to always be a multiple of this, particularly
+right after a fitBounds() or a pinch-zoom.
+By default, the zoom level snaps to the nearest integer; lower values
+(e.g. 0.5 or 0.1) allow for greater granularity. A value of 0
+means the zoom level will not be snapped after fitBounds or a pinch-zoom.
+
+
+ zoomDelta
+ Number
+ 1
+ Controls how much the map's zoom level will change after a
+zoomIn() , zoomOut() , pressing +
+or - on the keyboard, or using the zoom controls .
+Values smaller than 1 (e.g. 0.5) allow for greater granularity.
+
+
+ trackResize
+ Boolean
+ true
+ Whether the map automatically handles browser window resize to update itself.
+
+
+ boxZoom
+ Boolean
+ true
+ Whether the map can be zoomed to a rectangular area specified by
+dragging the mouse while pressing the shift key.
+
+
+ doubleClickZoom
+ Boolean|String
+ true
+ Whether the map can be zoomed in by double clicking on it and
+zoomed out by double clicking while holding shift. If passed
+'center', double-click zoom will zoom to the center of the
+ view regardless of where the mouse was.
+
+
+ dragging
+ Boolean
+ true
+ Whether the map be draggable with mouse/touch or not.
+
+
+
+
+
+Map State Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ crs
+ CRS
+ L.CRS.EPSG3857
+ The Coordinate Reference System to use. Don't change this if you're not
+sure what it means.
+
+
+ center
+ LatLng
+ undefined
+ Initial geographic center of the map
+
+
+ zoom
+ Number
+ undefined
+ Initial map zoom level
+
+
+ minZoom
+ Number
+ *
+ Minimum zoom level of the map.
+If not specified and at least one GridLayer or TileLayer is in the map,
+the lowest of their minZoom options will be used instead.
+
+
+ maxZoom
+ Number
+ *
+ Maximum zoom level of the map.
+If not specified and at least one GridLayer or TileLayer is in the map,
+the highest of their maxZoom options will be used instead.
+
+
+ layers
+ Layer[]
+ []
+ Array of layers that will be added to the map initially
+
+
+ maxBounds
+ LatLngBounds
+ null
+ When this option is set, the map restricts the view to the given
+geographical bounds, bouncing the user back if the user tries to pan
+outside the view. To set the restriction dynamically, use
+setMaxBounds method.
+
+
+ renderer
+ Renderer
+ *
+ The default method for drawing vector layers on the map. L.SVG
+or L.Canvas by default depending on browser support.
+
+
+
+
+
+Animation Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ zoomAnimation
+ Boolean
+ true
+ Whether the map zoom animation is enabled. By default it's enabled
+in all browsers that support CSS3 Transitions except Android.
+
+
+ zoomAnimationThreshold
+ Number
+ 4
+ Won't animate zoom if the zoom difference exceeds this value.
+
+
+ fadeAnimation
+ Boolean
+ true
+ Whether the tile fade animation is enabled. By default it's enabled
+in all browsers that support CSS3 Transitions except Android.
+
+
+ markerZoomAnimation
+ Boolean
+ true
+ Whether markers animate their zoom with the zoom animation, if disabled
+they will disappear for the length of the animation. By default it's
+enabled in all browsers that support CSS3 Transitions except Android.
+
+
+ transform3DLimit
+ Number
+ 2^23
+ Defines the maximum size of a CSS translation transform. The default
+value should not be changed unless a web browser positions layers in
+the wrong place after doing a large panBy.
+
+
+
+
+
+Panning Inertia Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ inertia
+ Boolean
+ *
+ If enabled, panning of the map will have an inertia effect where
+the map builds momentum while dragging and continues moving in
+the same direction for some time. Feels especially nice on touch
+devices. Enabled by default unless running on old Android devices.
+
+
+ inertiaDeceleration
+ Number
+ 3000
+ The rate with which the inertial movement slows down, in pixels/second².
+
+
+ inertiaMaxSpeed
+ Number
+ Infinity
+ Max speed of the inertial movement, in pixels/second.
+
+
+ easeLinearity
+ Number
+ 0.2
+
+
+
+ worldCopyJump
+ Boolean
+ false
+ With this option enabled, the map tracks when you pan to another "copy"
+of the world and seamlessly jumps to the original one so that all overlays
+like markers and vector layers are still visible.
+
+
+ maxBoundsViscosity
+ Number
+ 0.0
+ If maxBounds is set, this option will control how solid the bounds
+are when dragging the map around. The default value of 0.0 allows the
+user to drag outside the bounds at normal speed, higher values will
+slow down map dragging outside bounds, and 1.0 makes the bounds fully
+solid, preventing the user from dragging outside the bounds.
+
+
+
+
+
+Keyboard Navigation Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ keyboard
+ Boolean
+ true
+ Makes the map focusable and allows users to navigate the map with keyboard
+arrows and +/- keys.
+
+
+ keyboardPanDelta
+ Number
+ 80
+ Amount of pixels to pan when pressing an arrow key.
+
+
+
+
+
+Mousewheel options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ scrollWheelZoom
+ Boolean|String
+ true
+ Whether the map can be zoomed by using the mouse wheel. If passed 'center',
+it will zoom to the center of the view regardless of where the mouse was.
+
+
+ wheelDebounceTime
+ Number
+ 40
+ Limits the rate at which a wheel can fire (in milliseconds). By default
+user can't zoom via wheel more often than once per 40 ms.
+
+
+ wheelPxPerZoomLevel
+ Number
+ 60
+ How many scroll pixels (as reported by L.DomEvent.getWheelDelta )
+mean a change of one full zoom level. Smaller values will make wheel-zooming
+faster (and vice versa).
+
+
+
+
+
+Touch interaction options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ tap
+ Boolean
+ true
+ Enables mobile hacks for supporting instant taps (fixing 200ms click
+delay on iOS/Android) and touch holds (fired as contextmenu events).
+
+
+ tapTolerance
+ Number
+ 15
+ The max number of pixels a user can shift his finger during touch
+for it to be considered a valid tap.
+
+
+ touchZoom
+ Boolean|String
+ *
+ Whether the map can be zoomed by touch-dragging with two fingers. If
+passed 'center', it will zoom to the center of the view regardless of
+where the touch events (fingers) were. Enabled for touch-capable web
+browsers except for old Androids.
+
+
+ bounceAtZoomLimits
+ Boolean
+ true
+ Set it to false if you don't want the map to zoom beyond min/max zoom
+and then bounce back when pinch-zooming.
+
+
+
+
+
+
+
+Events
+
+
+
+Layer events
+
+
+
+
+
+
+Map state change events
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ zoomlevelschange
+ Event
+ Fired when the number of zoomlevels on the map is changed due
+to adding or removing a layer.
+
+
+ resize
+ ResizeEvent
+ Fired when the map is resized.
+
+
+ unload
+ Event
+ Fired when the map is destroyed with remove method.
+
+
+ viewreset
+ Event
+ Fired when the map needs to redraw its content (this usually happens
+on map zoom or load). Very useful for creating custom overlays.
+
+
+ load
+ Event
+ Fired when the map is initialized (when its center and zoom are set
+for the first time).
+
+
+ zoomstart
+ Event
+ Fired when the map zoom is about to change (e.g. before zoom animation).
+
+
+ movestart
+ Event
+ Fired when the view of the map starts changing (e.g. user starts dragging the map).
+
+
+ zoom
+ Event
+ Fired repeatedly during any change in zoom level, including zoom
+and fly animations.
+
+
+ move
+ Event
+ Fired repeatedly during any movement of the map, including pan and
+fly animations.
+
+
+ zoomend
+ Event
+ Fired when the map has changed, after any animations.
+
+
+ moveend
+ Event
+ Fired when the center of the map stops changing (e.g. user stopped
+dragging the map).
+
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+ autopanstart
+ Event
+ Fired when the map starts autopanning when opening a popup.
+
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip is opened in the map.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip in the map is closed.
+
+
+
+
+
+Location events
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ locationerror
+ ErrorEvent
+ Fired when geolocation (using the locate method) failed.
+
+
+ locationfound
+ LocationEvent
+ Fired when geolocation (using the locate method)
+went successfully.
+
+
+
+
+
+Interaction events
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the map.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the map.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the map.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button on the map.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the map.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the map.
+
+
+ mousemove
+ MouseEvent
+ Fired while the mouse moves over the map.
+
+
+
+ keypress
+ KeyboardEvent
+ Fired when the user presses a key from the keyboard while the map is focused.
+
+
+ preclick
+ MouseEvent
+ Fired before mouse click on the map (sometimes useful when you
+want something to happen on click before any existing click
+handlers start running).
+
+
+
+
+
+Other Methods
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ zoomanim
+ ZoomAnimEvent
+ Fired on every frame of a zoom animation
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getRenderer (<Path > layer )
+ Renderer
+ Returns the instance of Renderer that should be used to render the given
+Path . It will ensure that the renderer options of the map and paths
+are respected, and that the renderers do exist on the map.
+
+
+
+
+
+
+Methods for Layers and Controls
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addControl (<Control > control )
+ this
+ Adds the given control to the map
+
+
+
+ removeControl (<Control > control )
+ this
+ Removes the given control from the map
+
+
+
+ addLayer (<Layer > layer )
+ this
+ Adds the given layer to the map
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Removes the given layer from the map.
+
+
+
+ hasLayer (<Layer > layer )
+ Boolean
+ Returns true if the given layer is currently added to the map
+
+
+
+ eachLayer (<Function> fn , <Object> context? )
+ this
+ Iterates over the layers of the map, optionally specifying context of the iterator function.
+map.eachLayer(function(layer){
+ layer.bindPopup('Hello');
+});
+
+
+
+
+
+
+ openTooltip (<Tooltip > tooltip )
+ this
+ Opens the specified tooltip.
+
+
+
+ openTooltip (<String|HTMLElement> content , <LatLng > latlng , <Tooltip options > options? )
+ this
+ Creates a tooltip with the specified content and options and open it.
+
+
+
+ closeTooltip (<Tooltip > tooltip? )
+ this
+ Closes the tooltip given as parameter.
+
+
+
+
+
+
+Methods for modifying map state
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setView (<LatLng > center , <Number> zoom , <Zoom/pan options > options? )
+ this
+ Sets the view of the map (geographical center and zoom) with the given
+animation options.
+
+
+
+ setZoom (<Number> zoom , <Zoom/pan options > options? )
+ this
+ Sets the zoom of the map.
+
+
+
+ zoomIn (<Number> delta? , <Zoom options > options? )
+ this
+ Increases the zoom of the map by delta (zoomDelta by default).
+
+
+
+ zoomOut (<Number> delta? , <Zoom options > options? )
+ this
+ Decreases the zoom of the map by delta (zoomDelta by default).
+
+
+
+ setZoomAround (<LatLng > latlng , <Number> zoom , <Zoom options > options )
+ this
+ Zooms the map while keeping a specified geographical point on the map
+stationary (e.g. used internally for scroll zoom and double-click zoom).
+
+
+
+ setZoomAround (<Point > offset , <Number> zoom , <Zoom options > options )
+ this
+ Zooms the map while keeping a specified pixel on the map (relative to the top-left corner) stationary.
+
+
+
+ fitBounds (<LatLngBounds > bounds , <fitBounds options > options? )
+ this
+ Sets a map view that contains the given geographical bounds with the
+maximum zoom level possible.
+
+
+
+ fitWorld (<fitBounds options > options? )
+ this
+ Sets a map view that mostly contains the whole world with the maximum
+zoom level possible.
+
+
+
+ panTo (<LatLng > latlng , <Pan options > options? )
+ this
+ Pans the map to a given center.
+
+
+
+ panBy (<Point > offset , <Pan options > options? )
+ this
+ Pans the map by a given number of pixels (animated).
+
+
+
+ flyTo (<LatLng > latlng , <Number> zoom? , <Zoom/pan options > options? )
+ this
+ Sets the view of the map (geographical center and zoom) performing a smooth
+pan-zoom animation.
+
+
+
+ flyToBounds (<LatLngBounds > bounds , <fitBounds options > options? )
+ this
+ Sets the view of the map with a smooth animation like flyTo ,
+but takes a bounds parameter like fitBounds .
+
+
+
+ setMaxBounds (<Bounds > bounds )
+ this
+ Restricts the map view to the given bounds (see the maxBounds option).
+
+
+
+ setMinZoom (<Number> zoom )
+ this
+ Sets the lower limit for the available zoom levels (see the minZoom option).
+
+
+
+ setMaxZoom (<Number> zoom )
+ this
+ Sets the upper limit for the available zoom levels (see the maxZoom option).
+
+
+
+ panInsideBounds (<LatLngBounds > bounds , <Pan options > options? )
+ this
+ Pans the map to the closest view that would lie inside the given bounds (if it's not already), controlling the animation using the options specific, if any.
+
+
+
+ invalidateSize (<Zoom/Pan options> options )
+ this
+ Checks if the map container size changed and updates the map if so —
+call it after you've changed the map size dynamically, also animating
+pan by default. If options.pan is false, panning will not occur.
+If options.debounceMoveend is true, it will delay moveend event so
+that it doesn't happen often even if the method is called many
+times in a row.
+
+
+
+ invalidateSize (<Boolean> animate )
+ this
+ Checks if the map container size changed and updates the map if so —
+call it after you've changed the map size dynamically, also animating
+pan by default.
+
+
+
+ stop ()
+ this
+ Stops the currently running panTo or flyTo animation, if any.
+
+
+
+
+
+
+Geolocation methods
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ locate (<Locate options > options? )
+ this
+ Tries to locate the user using the Geolocation API, firing a locationfound
+event with location data on success or a locationerror event on failure,
+and optionally sets the map view to the user's location with respect to
+detection accuracy (or to the world view if geolocation failed).
+Note that, if your page doesn't use HTTPS, this method will fail in
+modern browsers (Chrome 50 and newer )
+See Locate options for more details.
+
+
+
+ stopLocate ()
+ this
+ Stops watching location previously initiated by map.locate({watch: true})
+and aborts resetting the map view if map.locate was called with
+{setView: true}.
+
+
+
+
+
+
+Other Methods
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addHandler (<String> name , <Function> HandlerClass )
+ this
+ Adds a new Handler to the map, given its name and constructor function.
+
+
+
+ remove ()
+ this
+ Destroys the map and clears all related event listeners.
+
+
+
+ createPane (<String> name , <HTMLElement> container? )
+ HTMLElement
+ Creates a new map pane with the given name if it doesn't exist already,
+then returns it. The pane is created as a child of container, or
+as a child of the main map pane if not set.
+
+
+
+ getPane (<String|HTMLElement> pane )
+ HTMLElement
+ Returns a map pane , given its name or its HTML element (its identity).
+
+
+
+ getPanes ()
+ Object
+ Returns a plain object containing the names of all panes as keys and
+the panes as values.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTML element that contains the map.
+
+
+
+ whenReady (<Function> fn , <Object> context? )
+ this
+ Runs the given function fn when the map gets initialized with
+a view (center and zoom) and at least one layer, or immediately
+if it's already initialized, optionally passing a function context.
+
+
+
+
+
+
+Methods for Getting Map State
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getCenter ()
+ LatLng
+ Returns the geographical center of the map view
+
+
+
+ getZoom ()
+ Number
+ Returns the current zoom level of the map view
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the geographical bounds visible in the current map view
+
+
+
+ getMinZoom ()
+ Number
+ Returns the minimum zoom level of the map (if set in the minZoom option of the map or of any layers), or 0 by default.
+
+
+
+ getMaxZoom ()
+ Number
+ Returns the maximum zoom level of the map (if set in the maxZoom option of the map or of any layers).
+
+
+
+ getBoundsZoom (<LatLngBounds > bounds , <Boolean> inside? )
+ Number
+ Returns the maximum zoom level on which the given bounds fit to the map
+view in its entirety. If inside (optional) is set to true, the method
+instead returns the minimum zoom level on which the map view fits into
+the given bounds in its entirety.
+
+
+
+ getSize ()
+ Point
+ Returns the current size of the map container (in pixels).
+
+
+
+ getPixelBounds ()
+ Bounds
+ Returns the bounds of the current map view in projected pixel
+coordinates (sometimes useful in layer and overlay implementations).
+
+
+
+ getPixelOrigin ()
+ Point
+ Returns the projected pixel coordinates of the top left point of
+the map layer (useful in custom layer and overlay implementations).
+
+
+
+ getPixelWorldBounds (<Number> zoom? )
+ Bounds
+ Returns the world's bounds in pixel coordinates for zoom level zoom.
+If zoom is omitted, the map's current zoom level is used.
+
+
+
+
+
+
+Conversion Methods
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getZoomScale (<Number> toZoom , <Number> fromZoom )
+ Number
+ Returns the scale factor to be applied to a map transition from zoom level
+fromZoom to toZoom. Used internally to help with zoom animations.
+
+
+
+ getScaleZoom (<Number> scale , <Number> fromZoom )
+ Number
+ Returns the zoom level that the map would end up at, if it is at fromZoom
+level and everything is scaled by a factor of scale. Inverse of
+getZoomScale .
+
+
+
+ project (<LatLng > latlng , <Number> zoom )
+ Point
+ Projects a geographical coordinate LatLng according to the projection
+of the map's CRS, then scales it according to zoom and the CRS's
+Transformation . The result is pixel coordinate relative to
+the CRS origin.
+
+
+
+ unproject (<Point > point , <Number> zoom )
+ LatLng
+ Inverse of project .
+
+
+
+ layerPointToLatLng (<Point > point )
+ LatLng
+ Given a pixel coordinate relative to the origin pixel ,
+returns the corresponding geographical coordinate (for the current zoom level).
+
+
+
+ latLngToLayerPoint (<LatLng > latlng )
+ Point
+ Given a geographical coordinate, returns the corresponding pixel coordinate
+relative to the origin pixel .
+
+
+
+ wrapLatLng (<LatLng > latlng )
+ LatLng
+ Returns a LatLng where lat and lng has been wrapped according to the
+map's CRS's wrapLat and wrapLng properties, if they are outside the
+CRS's bounds.
+By default this means longitude is wrapped around the dateline so its
+value is between -180 and +180 degrees.
+
+
+
+ wrapLatLngBounds (<LatLngBounds > bounds )
+ LatLngBounds
+ Returns a LatLngBounds with the same size as the given one, ensuring that
+its center is within the CRS's bounds.
+By default this means the center longitude is wrapped around the dateline so its
+value is between -180 and +180 degrees, and the majority of the bounds
+overlaps the CRS's bounds.
+
+
+
+ distance (<LatLng > latlng1 , <LatLng > latlng2 )
+ Number
+ Returns the distance between two geographical coordinates according to
+the map's CRS. By default this measures distance in meters.
+
+
+
+ containerPointToLayerPoint (<Point > point )
+ Point
+ Given a pixel coordinate relative to the map container, returns the corresponding
+pixel coordinate relative to the origin pixel .
+
+
+
+ layerPointToContainerPoint (<Point > point )
+ Point
+ Given a pixel coordinate relative to the origin pixel ,
+returns the corresponding pixel coordinate relative to the map container.
+
+
+
+ containerPointToLatLng (<Point > point )
+ LatLng
+ Given a pixel coordinate relative to the map container, returns
+the corresponding geographical coordinate (for the current zoom level).
+
+
+
+ latLngToContainerPoint (<LatLng > latlng )
+ Point
+ Given a geographical coordinate, returns the corresponding pixel coordinate
+relative to the map container.
+
+
+
+ mouseEventToContainerPoint (<MouseEvent > ev )
+ Point
+ Given a MouseEvent object, returns the pixel coordinate relative to the
+map container where the event took place.
+
+
+
+ mouseEventToLayerPoint (<MouseEvent > ev )
+ Point
+ Given a MouseEvent object, returns the pixel coordinate relative to
+the origin pixel where the event took place.
+
+
+
+ mouseEventToLatLng (<MouseEvent > ev )
+ LatLng
+ Given a MouseEvent object, returns geographical coordinate where the
+event took place.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+
+Properties
+
+
+
+Handlers
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ boxZoom
+ Handler
+ Box (shift-drag with mouse) zoom handler.
+
+
+ doubleClickZoom
+ Handler
+ Double click zoom handler.
+
+
+ dragging
+ Handler
+ Map dragging handler (by both mouse and touch).
+
+
+ keyboard
+ Handler
+ Keyboard navigation handler.
+
+
+ scrollWheelZoom
+ Handler
+ Scroll wheel zoom handler.
+
+
+ tap
+ Handler
+ Mobile touch hacks (quick tap and touch hold) handler.
+
+
+ touchZoom
+ Handler
+ Touch zoom handler.
+
+
+
+
+
+
+
+Map panes
+
+
+
+
+
+
+
+
+
+ Pane
+ Type
+ Z-index
+ Description
+
+
+
+ mapPane
+ HTMLElement
+ 'auto'
+ Pane that contains all other map panes
+
+
+ tilePane
+ HTMLElement
+ 200
+ Pane for GridLayer s and TileLayer s
+
+
+ overlayPane
+ HTMLElement
+ 400
+ Pane for vector overlays (Path s), like Polyline s and Polygon s
+
+
+ shadowPane
+ HTMLElement
+ 500
+ Pane for overlay shadows (e.g. Marker shadows)
+
+
+ markerPane
+ HTMLElement
+ 600
+ Pane for Icon s of Marker s
+
+
+ tooltipPane
+ HTMLElement
+ 650
+ Pane for tooltip.
+
+
+
+
+
+
+
+
+
+
+Locate options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ watch
+ Boolean
+ false
+ If true, starts continuous watching of location changes (instead of detecting it
+once) using W3C watchPosition method. You can later stop watching using
+map.stopLocate() method.
+
+
+ setView
+ Boolean
+ false
+ If true, automatically sets the map view to the user location with respect to
+detection accuracy, or to world view if geolocation failed.
+
+
+ maxZoom
+ Number
+ Infinity
+ The maximum zoom for automatic view setting when using setView option.
+
+
+ timeout
+ Number
+ 10000
+ Number of milliseconds to wait for a response from geolocation before firing a
+locationerror event.
+
+
+ maximumAge
+ Number
+ 0
+ Maximum age of detected location. If less than this amount of milliseconds
+passed since last geolocation response, locate will return a cached location.
+
+
+ enableHighAccuracy
+ Boolean
+ false
+ Enables high accuracy, see description in the W3C spec .
+
+
+
+
+
+
+
+
+
+Zoom options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ animate
+ Boolean
+
+ If not specified, zoom animation will happen if the zoom origin is inside the
+current view. If true, the map will attempt animating zoom disregarding where
+zoom origin is. Setting false will make it always reset the view completely
+without animation.
+
+
+
+
+
+
+
+
+
+Pan options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ animate
+ Boolean
+
+ If true, panning will always be animated if possible. If false, it will
+not animate panning, either resetting the map view if panning more than a
+screen away, or just setting a new offset for the map pane (except for panBy
+which always does the latter).
+
+
+ duration
+ Number
+ 0.25
+ Duration of animated panning, in seconds.
+
+
+ easeLinearity
+ Number
+ 0.25
+ The curvature factor of panning animation easing (third parameter of the
+Cubic Bezier curve ). 1.0 means linear animation,
+and the smaller this number, the more bowed the curve.
+
+
+ noMoveStart
+ Boolean
+ false
+ If true, panning won't fire movestart event on start (used internally for
+panning inertia).
+
+
+
+
+
+
+
+
+
+Zoom/pan options
+
+
+
+
+
+
▶ Options inherited from Zoom options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ animate
+ Boolean
+
+ If not specified, zoom animation will happen if the zoom origin is inside the
+current view. If true, the map will attempt animating zoom disregarding where
+zoom origin is. Setting false will make it always reset the view completely
+without animation.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Pan options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ duration
+ Number
+ 0.25
+ Duration of animated panning, in seconds.
+
+
+ easeLinearity
+ Number
+ 0.25
+ The curvature factor of panning animation easing (third parameter of the
+Cubic Bezier curve ). 1.0 means linear animation,
+and the smaller this number, the more bowed the curve.
+
+
+ noMoveStart
+ Boolean
+ false
+ If true, panning won't fire movestart event on start (used internally for
+panning inertia).
+
+
+
+
+
+
+
+
+
+
+FitBounds options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ paddingTopLeft
+ Point
+ [0, 0]
+ Sets the amount of padding in the top left corner of a map container that
+shouldn't be accounted for when setting the view to fit bounds. Useful if you
+have some control overlays on the map like a sidebar and you don't want them
+to obscure objects you're zooming to.
+
+
+ paddingBottomRight
+ Point
+ [0, 0]
+ The same for the bottom right corner of the map.
+
+
+ padding
+ Point
+ [0, 0]
+ Equivalent of setting both top left and bottom right padding to the same value.
+
+
+ maxZoom
+ Number
+ null
+ The maximum possible zoom to use.
+
+
+
+
+
+
+
+
▶ Options inherited from Zoom options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ animate
+ Boolean
+
+ If not specified, zoom animation will happen if the zoom origin is inside the
+current view. If true, the map will attempt animating zoom disregarding where
+zoom origin is. Setting false will make it always reset the view completely
+without animation.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Pan options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ duration
+ Number
+ 0.25
+ Duration of animated panning, in seconds.
+
+
+ easeLinearity
+ Number
+ 0.25
+ The curvature factor of panning animation easing (third parameter of the
+Cubic Bezier curve ). 1.0 means linear animation,
+and the smaller this number, the more bowed the curve.
+
+
+ noMoveStart
+ Boolean
+ false
+ If true, panning won't fire movestart event on start (used internally for
+panning inertia).
+
+
+
+
+
+
+
+ Marker L.Marker is used to display clickable/draggable icons on the map. Extends Layer .
+
+
+Usage example
+
+
+
+
+
+
+
+L.marker([50.5, 30.5]).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.marker (<LatLng > latlng , <Marker options > options? )
+ Instantiates a Marker object given a geographical point and optionally an options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ icon
+ Icon
+ *
+ Icon instance to use for rendering the marker.
+See Icon documentation for details on how to customize the marker icon.
+If not specified, a common instance of L.Icon.Default is used.
+
+
+ draggable
+ Boolean
+ false
+ Whether the marker is draggable with mouse/touch or not.
+
+
+ keyboard
+ Boolean
+ true
+ Whether the marker can be tabbed to with a keyboard and clicked by pressing enter.
+
+
+ title
+ String
+ ''
+ Text for the browser tooltip that appear on marker hover (no tooltip by default).
+
+
+ alt
+ String
+ ''
+ Text for the alt attribute of the icon image (useful for accessibility).
+
+
+ zIndexOffset
+ Number
+ 0
+ By default, marker images zIndex is set automatically based on its latitude. Use this option if you want to put the marker on top of all others (or below), specifying a high value like 1000 (or high negative value, respectively).
+
+
+ opacity
+ Number
+ 1.0
+ The opacity of the marker.
+
+
+ riseOnHover
+ Boolean
+ false
+ If true, the marker will get on top of others when you hover the mouse over it.
+
+
+ riseOffset
+ Number
+ 250
+ The z-index offset used for the riseOnHover feature.
+
+
+ pane
+ String
+ 'markerPane'
+ Map pane where the markers icon will be added.
+
+
+ bubblingMouseEvents
+ Boolean
+ false
+ When true, a mouse event on this marker will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ move
+ Event
+ Fired when the marker is moved via setLatLng or by dragging . Old and new coordinates are included in event arguments as oldLatLng, latlng .
+
+
+
+
+
+Dragging events
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ dragstart
+ Event
+ Fired when the user starts dragging the marker.
+
+
+ movestart
+ Event
+ Fired when the marker starts moving (because of dragging).
+
+
+ drag
+ Event
+ Fired repeatedly while the user drags the marker.
+
+
+ dragend
+ DragEndEvent
+ Fired when the user stops dragging the marker.
+
+
+ moveend
+ Event
+ Fired when the marker stops moving (because of dragging).
+
+
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the marker (as a GeoJSON Point Feature).
+
+
+
+ getLatLng ()
+ LatLng
+ Returns the current geographical position of the marker.
+
+
+
+ setLatLng (<LatLng > latlng )
+ this
+ Changes the marker position to the given point.
+
+
+
+ setZIndexOffset (<Number> offset )
+ this
+ Changes the zIndex offset of the marker.
+
+
+
+ setIcon (<Icon > icon )
+ this
+ Changes the marker icon.
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Changes the opacity of the marker.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+
+Properties
+
+
+
+Interaction handlers
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ dragging
+ Handler
+ Marker dragging handler (by both mouse and touch). Only valid when the marker is on the map (Otherwise set marker.options.draggable ).
+
+
+
+
+
+
+ Used to open popups in certain places of the map. Use Map.openPopup to
+open popups while making sure that only one popup is open at one time
+(recommended for usability), or use Map.addLayer to open as many as you want.
+
+
+
+
+
+
+
+
+
+
+If you want to just bind a popup to marker click and then open it, it's really easy:
+marker.bindPopup(popupContent).openPopup();
+
+Path overlays like polylines also have a bindPopup method.
+Here's a more complicated way to open a popup on a map:
+var popup = L.popup()
+ .setLatLng(latlng)
+ .setContent('<p>Hello world!<br />This is a nice popup.</p>')
+ .openOn(map);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Options inherited from DivOverlay
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Used to display small texts on top of map layers.
+
+
+
+
+
+
+
+
+
+
+marker.bindTooltip("my tooltip text").openTooltip();
+
+Note about tooltip offset. Leaflet takes two options in consideration
+for computing tooltip offseting:
+
+the offset Tooltip option: it defaults to [0, 0], and it's specific to one tooltip.
+Add a positive x offset to move the tooltip to the right, and a positive y offset to
+move it to the bottom. Negatives will move to the left and top.
+the tooltipAnchor Icon option: this will only be considered for Marker. You
+should adapt this value if you use a custom icon.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.tooltip (<Tooltip options > options? , <Layer > source? )
+ Instantiates a Tooltip object given an optional options object that describes its appearance and location and an optional source object that is used to tag the tooltip with a reference to the Layer to which it refers.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'tooltipPane'
+ Map pane where the tooltip will be added.
+
+
+ offset
+ Point
+ Point(0, 0)
+ Optional offset of the tooltip position.
+
+
+ direction
+ String
+ 'auto'
+ Direction where to open the tooltip. Possible values are: right, left,
+top, bottom, center, auto.
+auto will dynamically switch between right and left according to the tooltip
+position on the map.
+
+
+ permanent
+ Boolean
+ false
+ Whether to open the tooltip permanently or only on mouseover.
+
+
+ sticky
+ Boolean
+ false
+ If true, the tooltip will follow the mouse instead of being fixed at the feature center.
+
+
+ interactive
+ Boolean
+ false
+ If true, the tooltip will listen to the feature events.
+
+
+ opacity
+ Number
+ 0.9
+ Tooltip container opacity.
+
+
+
+
+
+
+
+
▶ Options inherited from DivOverlay
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ className
+ String
+ ''
+ A custom CSS class name to assign to the popup.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ TileLayer Used to load and display tile layers on the map. Extends GridLayer .
+
+
+Usage example
+
+
+
+
+
+
+
+L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png?{foo}', {foo: 'bar'}).addTo(map);
+
+
+
+
+
+
+URL template
+
+
+
+A string of the following form:
+'http://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png'
+{s} means one of the available subdomains (used sequentially to help with browser parallel requests per domain limitation; subdomain values are specified in options; a, b or c by default, can be omitted), {z} — zoom level, {x} and {y} — tile coordinates. {r} can be used to add "@2x" to the URL to load retina tiles.
+You can use custom keys in the template, which will be evaluated from TileLayer options, like this:
+L.tileLayer('http://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png', {foo: 'bar'});
+
+
+
+
+
+
+
+Creation
+
+
+
+Extension methods
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.tilelayer (<String> urlTemplate , <TileLayer options > options? )
+ Instantiates a tile layer object given a URL template and optionally an options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ minZoom
+ Number
+ 0
+ The minimum zoom level down to which this layer will be displayed (inclusive).
+
+
+ maxZoom
+ Number
+ 18
+ The maximum zoom level up to which this layer will be displayed (inclusive).
+
+
+ subdomains
+ String|String[]
+ 'abc'
+ Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.
+
+
+ errorTileUrl
+ String
+ ''
+ URL to the tile image to show in place of the tile that failed to load.
+
+
+ zoomOffset
+ Number
+ 0
+ The zoom number used in tile URLs will be offset with this value.
+
+
+ tms
+ Boolean
+ false
+ If true, inverses Y axis numbering for tiles (turn this on for TMS services).
+
+
+ zoomReverse
+ Boolean
+ false
+ If set to true, the zoom number used in tile URLs will be reversed (maxZoom - zoom instead of zoom)
+
+
+ detectRetina
+ Boolean
+ false
+ If true and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.
+
+
+ crossOrigin
+ Boolean
+ false
+ If true, all tiles will have their crossOrigin attribute set to ''. This is needed if you want to access tile pixel data.
+
+
+
+
+
+
+
+
▶ Options inherited from GridLayer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ tileSize
+ Number|Point
+ 256
+ Width and height of tiles in the grid. Use a number if width and height are equal, or L.point(width, height) otherwise.
+
+
+ opacity
+ Number
+ 1.0
+ Opacity of the tiles. Can be used in the createTile() function.
+
+
+ updateWhenIdle
+ Boolean
+ (depends)
+ Load new tiles only when panning ends.
+true by default on mobile browsers, in order to avoid too many requests and keep smooth navigation.
+false otherwise in order to display new tiles during panning, since it is easy to pan outside the
+keepBuffer option in desktop browsers.
+
+
+ updateWhenZooming
+ Boolean
+ true
+ By default, a smooth zoom animation (during a touch zoom or a flyTo() ) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends.
+
+
+ updateInterval
+ Number
+ 200
+ Tiles will not update more than once every updateInterval milliseconds when panning.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the tile layer.
+
+
+ bounds
+ LatLngBounds
+ undefined
+ If set, tiles will only be loaded inside the set LatLngBounds .
+
+
+ maxNativeZoom
+ Number
+ undefined
+ Maximum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels higher than maxNativeZoom will be loaded
+from maxNativeZoom level and auto-scaled.
+
+
+ minNativeZoom
+ Number
+ undefined
+ Minimum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels lower than minNativeZoom will be loaded
+from minNativeZoom level and auto-scaled.
+
+
+ noWrap
+ Boolean
+ false
+ Whether the layer is wrapped around the antimeridian. If true, the
+GridLayer will only be displayed once at low zoom levels. Has no
+effect when the map CRS doesn't wrap around. Can be used
+in combination with bounds to prevent requesting
+tiles outside the CRS limits.
+
+
+ pane
+ String
+ 'tilePane'
+ Map pane where the grid layer will be added.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the tile layer. Empty by default.
+
+
+ keepBuffer
+ Number
+ 2
+ When panning the map, keep this many rows and columns of tiles before unloading them.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from GridLayer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ loading
+ Event
+ Fired when the grid layer starts loading tiles.
+
+
+ tileunload
+ TileEvent
+ Fired when a tile is removed (e.g. when a tile goes off the screen).
+
+
+ tileloadstart
+ TileEvent
+ Fired when a tile is requested and starts loading.
+
+
+ tileerror
+ TileErrorEvent
+ Fired when there is an error loading a tile.
+
+
+ tileload
+ TileEvent
+ Fired when a tile loads.
+
+
+ load
+ Event
+ Fired when the grid layer loaded all visible tiles.
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setUrl (<String> url , <Boolean> noRedraw? )
+ this
+ Updates the layer's URL template and redraws it (unless noRedraw is set to true).
+
+
+
+ createTile (<Object> coords , <Function> done? )
+ HTMLElement
+ Called only internally, overrides GridLayer's createTile()
+to return an <img> HTML element with the appropriate image URL given coords. The done
+callback is called when the tile has been loaded.
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getTileUrl (<Object> coords )
+ String
+ Called only internally, returns the URL for a tile given its coordinates.
+Classes extending TileLayer can override this function to provide custom tile URL naming schemes.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from GridLayer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bringToFront ()
+ this
+ Brings the tile layer to the top of all tile layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the tile layer to the bottom of all tile layers.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTML element that contains the tiles for this layer.
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Changes the opacity of the grid layer.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Changes the zIndex of the grid layer.
+
+
+
+ isLoading ()
+ Boolean
+ Returns true if any tile in the grid layer has not finished loading.
+
+
+
+ redraw ()
+ this
+ Causes the layer to clear all the tiles and request them again.
+
+
+
+ getTileSize ()
+ Point
+ Normalizes the tileSize option into a point. Used by the createTile() method.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ TileLayer.WMS Used to display WMS services as tile layers on the map. Extends TileLayer .
+
+
+Usage example
+
+
+
+
+
+
+
+var nexrad = L.tileLayer.wms("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi", {
+ layers: 'nexrad-n0r-900913',
+ format: 'image/png',
+ transparent: true,
+ attribution: "Weather data © 2012 IEM Nexrad"
+});
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.tileLayer.wms (<String> baseUrl , <TileLayer.WMS options > options )
+ Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ layers
+ String
+ ''
+ (required) Comma-separated list of WMS layers to show.
+
+
+ styles
+ String
+ ''
+ Comma-separated list of WMS styles.
+
+
+ format
+ String
+ 'image/jpeg'
+ WMS image format (use 'image/png' for layers with transparency).
+
+
+ transparent
+ Boolean
+ false
+ If true, the WMS service will return images with transparency.
+
+
+ version
+ String
+ '1.1.1'
+ Version of the WMS service to use
+
+
+ crs
+ CRS
+ null
+ Coordinate Reference System to use for the WMS requests, defaults to
+map CRS. Don't change this if you're not sure what it means.
+
+
+ uppercase
+ Boolean
+ false
+ If true, WMS request parameter keys will be uppercase.
+
+
+
+
+
+
+
+
▶ Options inherited from TileLayer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ minZoom
+ Number
+ 0
+ The minimum zoom level down to which this layer will be displayed (inclusive).
+
+
+ maxZoom
+ Number
+ 18
+ The maximum zoom level up to which this layer will be displayed (inclusive).
+
+
+ subdomains
+ String|String[]
+ 'abc'
+ Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.
+
+
+ errorTileUrl
+ String
+ ''
+ URL to the tile image to show in place of the tile that failed to load.
+
+
+ zoomOffset
+ Number
+ 0
+ The zoom number used in tile URLs will be offset with this value.
+
+
+ tms
+ Boolean
+ false
+ If true, inverses Y axis numbering for tiles (turn this on for TMS services).
+
+
+ zoomReverse
+ Boolean
+ false
+ If set to true, the zoom number used in tile URLs will be reversed (maxZoom - zoom instead of zoom)
+
+
+ detectRetina
+ Boolean
+ false
+ If true and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.
+
+
+ crossOrigin
+ Boolean
+ false
+ If true, all tiles will have their crossOrigin attribute set to ''. This is needed if you want to access tile pixel data.
+
+
+
+
+
+
+
+
+
▶ Options inherited from GridLayer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ tileSize
+ Number|Point
+ 256
+ Width and height of tiles in the grid. Use a number if width and height are equal, or L.point(width, height) otherwise.
+
+
+ opacity
+ Number
+ 1.0
+ Opacity of the tiles. Can be used in the createTile() function.
+
+
+ updateWhenIdle
+ Boolean
+ (depends)
+ Load new tiles only when panning ends.
+true by default on mobile browsers, in order to avoid too many requests and keep smooth navigation.
+false otherwise in order to display new tiles during panning, since it is easy to pan outside the
+keepBuffer option in desktop browsers.
+
+
+ updateWhenZooming
+ Boolean
+ true
+ By default, a smooth zoom animation (during a touch zoom or a flyTo() ) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends.
+
+
+ updateInterval
+ Number
+ 200
+ Tiles will not update more than once every updateInterval milliseconds when panning.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the tile layer.
+
+
+ bounds
+ LatLngBounds
+ undefined
+ If set, tiles will only be loaded inside the set LatLngBounds .
+
+
+ maxNativeZoom
+ Number
+ undefined
+ Maximum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels higher than maxNativeZoom will be loaded
+from maxNativeZoom level and auto-scaled.
+
+
+ minNativeZoom
+ Number
+ undefined
+ Minimum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels lower than minNativeZoom will be loaded
+from minNativeZoom level and auto-scaled.
+
+
+ noWrap
+ Boolean
+ false
+ Whether the layer is wrapped around the antimeridian. If true, the
+GridLayer will only be displayed once at low zoom levels. Has no
+effect when the map CRS doesn't wrap around. Can be used
+in combination with bounds to prevent requesting
+tiles outside the CRS limits.
+
+
+ pane
+ String
+ 'tilePane'
+ Map pane where the grid layer will be added.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the tile layer. Empty by default.
+
+
+ keepBuffer
+ Number
+ 2
+ When panning the map, keep this many rows and columns of tiles before unloading them.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from GridLayer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ loading
+ Event
+ Fired when the grid layer starts loading tiles.
+
+
+ tileunload
+ TileEvent
+ Fired when a tile is removed (e.g. when a tile goes off the screen).
+
+
+ tileloadstart
+ TileEvent
+ Fired when a tile is requested and starts loading.
+
+
+ tileerror
+ TileErrorEvent
+ Fired when there is an error loading a tile.
+
+
+ tileload
+ TileEvent
+ Fired when a tile loads.
+
+
+ load
+ Event
+ Fired when the grid layer loaded all visible tiles.
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setParams (<Object> params , <Boolean> noRedraw? )
+ this
+ Merges an object with the new parameters and re-requests tiles on the current screen (unless noRedraw was set to true).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from TileLayer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setUrl (<String> url , <Boolean> noRedraw? )
+ this
+ Updates the layer's URL template and redraws it (unless noRedraw is set to true).
+
+
+
+ createTile (<Object> coords , <Function> done? )
+ HTMLElement
+ Called only internally, overrides GridLayer's createTile()
+to return an <img> HTML element with the appropriate image URL given coords. The done
+callback is called when the tile has been loaded.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from GridLayer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bringToFront ()
+ this
+ Brings the tile layer to the top of all tile layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the tile layer to the bottom of all tile layers.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTML element that contains the tiles for this layer.
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Changes the opacity of the grid layer.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Changes the zIndex of the grid layer.
+
+
+
+ isLoading ()
+ Boolean
+ Returns true if any tile in the grid layer has not finished loading.
+
+
+
+ redraw ()
+ this
+ Causes the layer to clear all the tiles and request them again.
+
+
+
+ getTileSize ()
+ Point
+ Normalizes the tileSize option into a point. Used by the createTile() method.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ ImageOverlay Used to load and display a single image over specific bounds of the map. Extends Layer .
+
+
+Usage example
+
+
+
+
+
+
+
+var imageUrl = 'http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg',
+ imageBounds = [[40.712216, -74.22655], [40.773941, -74.12544]];
+L.imageOverlay(imageUrl, imageBounds).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.imageOverlay (<String> imageUrl , <LatLngBounds > bounds , <ImageOverlay options > options? )
+ Instantiates an image overlay object given the URL of the image and the
+geographical bounds it is tied to.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ opacity
+ Number
+ 1.0
+ The opacity of the image overlay.
+
+
+ alt
+ String
+ ''
+ Text for the alt attribute of the image (useful for accessibility).
+
+
+ interactive
+ Boolean
+ false
+ If true, the image overlay will emit mouse events when clicked or hovered.
+
+
+ crossOrigin
+ Boolean
+ false
+ If true, the image will have its crossOrigin attribute set to ''. This is needed if you want to access image pixel data.
+
+
+ errorOverlayUrl
+ String
+ ''
+ URL to the overlay image to show in place of the overlay that failed to load.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the tile layer.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the image. Empty by default.
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this layer will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ load
+ Event
+ Fired when the ImageOverlay layer has loaded its image
+
+
+ error
+ Event
+ Fired when the ImageOverlay layer has loaded its image
+
+
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Sets the opacity of the overlay.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all overlays.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all overlays.
+
+
+
+ setUrl (<String> url )
+ this
+ Changes the URL of the image.
+
+
+
+ setBounds (<LatLngBounds > bounds )
+ this
+ Update the bounds that this ImageOverlay covers
+Changes the zIndex of the image overlay.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Get the bounds that this ImageOverlay covers
+
+
+
+ getElement ()
+ HTMLElement
+ Returns the instance of HTMLImageElement
+used by this overlay.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ VideoOverlay Used to load and display a video player over specific bounds of the map. Extends ImageOverlay .
+A video overlay uses the <video>
+HTML5 element.
+
+
+Usage example
+
+
+
+
+
+
+
+var videoUrl = 'https://www.mapbox.com/bites/00188/patricia_nasa.webm',
+ videoBounds = [[ 32, -130], [ 13, -100]];
+L.VideoOverlay(videoUrl, videoBounds ).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.videoOverlay (<String|Array|HTMLVideoElement> video , <LatLngBounds > bounds , <VideoOverlay options > options? )
+ Instantiates an image overlay object given the URL of the video (or array of URLs, or even a video element) and the
+geographical bounds it is tied to.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ autoplay
+ Boolean
+ true
+ Whether the video starts playing automatically when loaded.
+
+
+ loop
+ Boolean
+ true
+ Whether the video will loop back to the beginning when played.
+
+
+
+
+
+
+
+
▶ Options inherited from ImageOverlay
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ opacity
+ Number
+ 1.0
+ The opacity of the image overlay.
+
+
+ alt
+ String
+ ''
+ Text for the alt attribute of the image (useful for accessibility).
+
+
+ interactive
+ Boolean
+ false
+ If true, the image overlay will emit mouse events when clicked or hovered.
+
+
+ crossOrigin
+ Boolean
+ false
+ If true, the image will have its crossOrigin attribute set to ''. This is needed if you want to access image pixel data.
+
+
+ errorOverlayUrl
+ String
+ ''
+ URL to the overlay image to show in place of the overlay that failed to load.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the tile layer.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the image. Empty by default.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this layer will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ load
+ Event
+ Fired when the video has finished loading the first frame
+
+
+
+
+
+
+
+
▶ Events inherited from ImageOverlay
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ error
+ Event
+ Fired when the ImageOverlay layer has loaded its image
+
+
+
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getElement ()
+ HTMLVideoElement
+ Returns the instance of HTMLVideoElement
+used by this overlay.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from ImageOverlay
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Sets the opacity of the overlay.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all overlays.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all overlays.
+
+
+
+ setUrl (<String> url )
+ this
+ Changes the URL of the image.
+
+
+
+ setBounds (<LatLngBounds > bounds )
+ this
+ Update the bounds that this ImageOverlay covers
+Changes the zIndex of the image overlay.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Get the bounds that this ImageOverlay covers
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Path An abstract class that contains options and constants shared between vector
+overlays (Polygon, Polyline, Circle). Do not use it directly. Extends Layer .
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.svg (<Renderer options > options? )
+ Creates a SVG renderer with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Polyline A class for drawing polyline overlays on a map. Extends Path .
+
+
+Usage example
+
+
+
+
+
+
+
+// create a red polyline from an array of LatLng points
+var latlngs = [
+ [45.51, -122.68],
+ [37.77, -122.43],
+ [34.04, -118.2]
+];
+var polyline = L.polyline(latlngs, {color: 'red'}).addTo(map);
+// zoom the map to the polyline
+map.fitBounds(polyline.getBounds());
+
+You can also pass a multi-dimensional array to represent a MultiPolyline shape:
+// create a red polyline from an array of arrays of LatLng points
+var latlngs = [
+ [[45.51, -122.68],
+ [37.77, -122.43],
+ [34.04, -118.2]],
+ [[40.78, -73.91],
+ [41.83, -87.62],
+ [32.76, -96.72]]
+];
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.polyline (<LatLng[]> latlngs , <Polyline options > options? )
+ Instantiates a polyline object given an array of geographical points and
+optionally an options object. You can create a Polyline object with
+multiple separate lines (MultiPolyline) by passing an array of arrays
+of geographic points.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ smoothFactor
+ Number
+ 1.0
+ How much to simplify the polyline on each zoom level. More means
+better performance and smoother look, and less means more accurate representation.
+
+
+ noClip
+ Boolean
+ false
+ Disable polyline clipping.
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the polyline (as a GeoJSON LineString or MultiLineString Feature).
+
+
+
+ getLatLngs ()
+ LatLng[]
+ Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.
+
+
+
+ setLatLngs (<LatLng[]> latlngs )
+ this
+ Replaces all the points in the polyline with the given array of geographical points.
+
+
+
+ isEmpty ()
+ Boolean
+ Returns true if the Polyline has no LatLngs.
+
+
+
+ getCenter ()
+ LatLng
+ Returns the center (centroid ) of the polyline.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the path.
+
+
+
+ addLatLng (<LatLng > latlng )
+ this
+ Adds a given point to the polyline. By default, adds to the first ring of
+the polyline in case of a multi-polyline, but can be overridden by passing
+a specific ring as a LatLng array (that you can earlier access with getLatLngs ).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Polygon A class for drawing polygon overlays on a map. Extends Polyline .
+Note that points you pass when creating a polygon shouldn't have an additional last point equal to the first one — it's better to filter out such points.
+
+
+Usage example
+
+
+
+
+
+
+
+// create a red polygon from an array of LatLng points
+var latlngs = [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]];
+var polygon = L.polygon(latlngs, {color: 'red'}).addTo(map);
+// zoom the map to the polygon
+map.fitBounds(polygon.getBounds());
+
+You can also pass an array of arrays of latlngs, with the first array representing the outer shape and the other arrays representing holes in the outer shape:
+var latlngs = [
+ [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring
+ [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole
+];
+
+Additionally, you can pass a multi-dimensional array to represent a MultiPolygon shape.
+var latlngs = [
+ [ // first polygon
+ [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring
+ [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole
+ ],
+ [ // second polygon
+ [[41, -111.03],[45, -111.04],[45, -104.05],[41, -104.05]]
+ ]
+];
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.polygon (<LatLng[]> latlngs , <Polyline options > options? )
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Polyline
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ smoothFactor
+ Number
+ 1.0
+ How much to simplify the polyline on each zoom level. More means
+better performance and smoother look, and less means more accurate representation.
+
+
+ noClip
+ Boolean
+ false
+ Disable polyline clipping.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the polygon (as a GeoJSON Polygon or MultiPolygon Feature).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Polyline
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getLatLngs ()
+ LatLng[]
+ Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.
+
+
+
+ setLatLngs (<LatLng[]> latlngs )
+ this
+ Replaces all the points in the polyline with the given array of geographical points.
+
+
+
+ isEmpty ()
+ Boolean
+ Returns true if the Polyline has no LatLngs.
+
+
+
+ getCenter ()
+ LatLng
+ Returns the center (centroid ) of the polyline.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the path.
+
+
+
+ addLatLng (<LatLng > latlng )
+ this
+ Adds a given point to the polyline. By default, adds to the first ring of
+the polyline in case of a multi-polyline, but can be overridden by passing
+a specific ring as a LatLng array (that you can earlier access with getLatLngs ).
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Rectangle A class for drawing rectangle overlays on a map. Extends Polygon .
+
+
+Usage example
+
+
+
+
+
+
+
+// define rectangle geographical bounds
+var bounds = [[54.559322, -5.767822], [56.1210604, -3.021240]];
+// create an orange rectangle
+L.rectangle(bounds, {color: "#ff7800", weight: 1}).addTo(map);
+// zoom the map to the rectangle bounds
+map.fitBounds(bounds);
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Polyline
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ smoothFactor
+ Number
+ 1.0
+ How much to simplify the polyline on each zoom level. More means
+better performance and smoother look, and less means more accurate representation.
+
+
+ noClip
+ Boolean
+ false
+ Disable polyline clipping.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setBounds (<LatLngBounds > latLngBounds )
+ this
+ Redraws the rectangle with the passed bounds.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Polygon
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the polygon (as a GeoJSON Polygon or MultiPolygon Feature).
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Polyline
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getLatLngs ()
+ LatLng[]
+ Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.
+
+
+
+ setLatLngs (<LatLng[]> latlngs )
+ this
+ Replaces all the points in the polyline with the given array of geographical points.
+
+
+
+ isEmpty ()
+ Boolean
+ Returns true if the Polyline has no LatLngs.
+
+
+
+ getCenter ()
+ LatLng
+ Returns the center (centroid ) of the polyline.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the path.
+
+
+
+ addLatLng (<LatLng > latlng )
+ this
+ Adds a given point to the polyline. By default, adds to the first ring of
+the polyline in case of a multi-polyline, but can be overridden by passing
+a specific ring as a LatLng array (that you can earlier access with getLatLngs ).
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Circle A class for drawing circle overlays on a map. Extends CircleMarker .
+It's an approximation and starts to diverge from a real circle closer to poles (due to projection distortion).
+
+
+Usage example
+
+
+
+
+
+
+
+L.circle([50.5, 30.5], {radius: 200}).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.circle (<LatLng > latlng , <Circle options > options? )
+ Instantiates a circle object given a geographical point, and an options object
+which contains the circle radius.
+
+
+ L.circle (<LatLng > latlng , <Number> radius , <Circle options > options? )
+ Obsolete way of instantiating a circle, for compatibility with 0.7.x code.
+Do not use in new applications or plugins.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ radius
+ Number
+
+ Radius of the circle, in meters.
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setRadius (<Number> radius )
+ this
+ Sets the radius of a circle. Units are in meters.
+
+
+
+ getRadius ()
+ Number
+ Returns the current radius of a circle. Units are in meters.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the path.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from CircleMarker
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the circle marker (as a GeoJSON Point Feature).
+
+
+
+ setLatLng (<LatLng > latLng )
+ this
+ Sets the position of a circle marker to a new location.
+
+
+
+ getLatLng ()
+ LatLng
+ Returns the current geographical position of the circle marker
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ CircleMarker A circle of a fixed size with radius specified in pixels. Extends Path .
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.circleMarker (<LatLng > latlng , <CircleMarker options > options? )
+ Instantiates a circle marker object given a geographical point, and an optional options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ radius
+ Number
+ 10
+ Radius of the circle marker, in pixels
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the circle marker (as a GeoJSON Point Feature).
+
+
+
+ setLatLng (<LatLng > latLng )
+ this
+ Sets the position of a circle marker to a new location.
+
+
+
+ getLatLng ()
+ LatLng
+ Returns the current geographical position of the circle marker
+
+
+
+ setRadius (<Number> radius )
+ this
+ Sets the radius of a circle marker. Units are in pixels.
+
+
+
+ getRadius ()
+ Number
+ Returns the current radius of the circle
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ SVG Although SVG is not available on IE7 and IE8, these browsers support VML , and the SVG renderer will fall back to VML in this case.
+VML was deprecated in 2012, which means VML functionality exists only for backwards compatibility
+with old versions of Internet Explorer.
+
Allows vector layers to be displayed with SVG .
+Inherits Renderer .
+Due to technical limitations , SVG is not
+available in all web browsers, notably Android 2.x and 3.x.
+Although SVG is not available on IE7 and IE8, these browsers support
+VML
+(a now deprecated technology), and the SVG renderer will fall back to VML in
+this case.
+
+
+Usage example
+
+
+
+
+
+
+
+Use SVG by default for all paths in the map:
+var map = L.map('map', {
+ renderer: L.svg()
+});
+
+Use a SVG renderer with extra padding for specific vector geometries:
+var map = L.map('map');
+var myRenderer = L.svg({ padding: 0.5 });
+var line = L.polyline( coordinates, { renderer: myRenderer } );
+var circle = L.circle( center, { renderer: myRenderer } );
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Renderer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ padding
+ Number
+ 0.1
+ How much to extend the clip area around the map view (relative to its size)
+e.g. 0.1 would be 10% of map view in each direction
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Renderer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ update
+ Event
+ Fired when the renderer updates its bounds, center and zoom, for example when
+its map has moved
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+
+Functions
+
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ create (<String> name )
+ SVGElement
+ Returns a instance of SVGElement ,
+corresponding to the class name passed. For example, using 'line' will return
+an instance of SVGLineElement .
+
+
+ pointsToPath (<Point[]> rings , <Boolean> closed )
+ String
+ Generates a SVG path string for multiple rings, with each ring turning
+into "M..L..L.." instructions
+
+
+
+
+
+
+ Canvas Allows vector layers to be displayed with <canvas> .
+Inherits Renderer .
+Due to technical limitations , Canvas is not
+available in all web browsers, notably IE8, and overlapping geometries might
+not display properly in some edge cases.
+
+
+Usage example
+
+
+
+
+
+
+
+Use Canvas by default for all paths in the map:
+var map = L.map('map', {
+ renderer: L.canvas()
+});
+
+Use a Canvas renderer with extra padding for specific vector geometries:
+var map = L.map('map');
+var myRenderer = L.canvas({ padding: 0.5 });
+var line = L.polyline( coordinates, { renderer: myRenderer } );
+var circle = L.circle( center, { renderer: myRenderer } );
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.canvas (<Renderer options > options? )
+ Creates a Canvas renderer with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Renderer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ padding
+ Number
+ 0.1
+ How much to extend the clip area around the map view (relative to its size)
+e.g. 0.1 would be 10% of map view in each direction
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Renderer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ update
+ Event
+ Fired when the renderer updates its bounds, center and zoom, for example when
+its map has moved
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ LayerGroup Used to group several layers and handle them as one. If you add it to the map,
+any layers added or removed from the group will be added/removed on the map as
+well. Extends Layer .
+
+
+Usage example
+
+
+
+
+
+
+
+L.layerGroup([marker1, marker2])
+ .addLayer(polyline)
+ .addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.layerGroup (<Layer[]> layers? )
+ Create a layer group, optionally given an initial set of layers.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the layer group (as a GeoJSON FeatureCollection, GeometryCollection, or MultiPoint).
+
+
+
+ addLayer (<Layer > layer )
+ this
+ Adds the given layer to the group.
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Removes the given layer from the group.
+
+
+
+ removeLayer (<Number> id )
+ this
+ Removes the layer with the given internal ID from the group.
+
+
+
+ hasLayer (<Layer > layer )
+ Boolean
+ Returns true if the given layer is currently added to the group.
+
+
+
+ hasLayer (<Number> id )
+ Boolean
+ Returns true if the given internal ID is currently added to the group.
+
+
+
+ clearLayers ()
+ this
+ Removes all the layers from the group.
+
+
+
+ invoke (<String> methodName , … )
+ this
+ Calls methodName on every layer contained in this group, passing any
+additional parameters. Has no effect if the layers contained do not
+implement methodName.
+
+
+
+ eachLayer (<Function> fn , <Object> context? )
+ this
+ Iterates over the layers of the group, optionally specifying context of the iterator function.
+group.eachLayer(function (layer) {
+ layer.bindPopup('Hello');
+});
+
+
+
+
+ getLayer (<Number> id )
+ Layer
+ Returns the layer with the given internal ID.
+
+
+
+ getLayers ()
+ Layer[]
+ Returns an array of all the layers added to the group.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Calls setZIndex on every layer contained in this group, passing the z-index.
+
+
+
+ getLayerId (<Layer > layer )
+ Number
+ Returns the internal ID for a layer
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ FeatureGroup Extended LayerGroup that makes it easier to do the same thing to all its member layers:
+
+bindPopup binds a popup to all of the layers at once (likewise with bindTooltip )
+Events are propagated to the FeatureGroup , so if the group has an event
+handler, it will handle events from any of the layers. This includes mouse events
+and custom events.
+Has layeradd and layerremove events
+
+
+
+Usage example
+
+
+
+
+
+
+
+L.featureGroup([marker1, marker2, polyline])
+ .bindPopup('Hello world!')
+ .on('click', function() { alert('Clicked on a member of the group!'); })
+ .addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.featureGroup (<Layer[]> layers )
+ Create a feature group, optionally given an initial set of layers.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setStyle (<Path options > style )
+ this
+ Sets the given path options to each layer of the group that has a setStyle method.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer group to the top of all other layers
+
+
+
+ bringToBack ()
+ this
+ Brings the layer group to the back of all other layers
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from LayerGroup
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the layer group (as a GeoJSON FeatureCollection, GeometryCollection, or MultiPoint).
+
+
+
+ addLayer (<Layer > layer )
+ this
+ Adds the given layer to the group.
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Removes the given layer from the group.
+
+
+
+ removeLayer (<Number> id )
+ this
+ Removes the layer with the given internal ID from the group.
+
+
+
+ hasLayer (<Layer > layer )
+ Boolean
+ Returns true if the given layer is currently added to the group.
+
+
+
+ hasLayer (<Number> id )
+ Boolean
+ Returns true if the given internal ID is currently added to the group.
+
+
+
+ clearLayers ()
+ this
+ Removes all the layers from the group.
+
+
+
+ invoke (<String> methodName , … )
+ this
+ Calls methodName on every layer contained in this group, passing any
+additional parameters. Has no effect if the layers contained do not
+implement methodName.
+
+
+
+ eachLayer (<Function> fn , <Object> context? )
+ this
+ Iterates over the layers of the group, optionally specifying context of the iterator function.
+group.eachLayer(function (layer) {
+ layer.bindPopup('Hello');
+});
+
+
+
+
+ getLayer (<Number> id )
+ Layer
+ Returns the layer with the given internal ID.
+
+
+
+ getLayers ()
+ Layer[]
+ Returns an array of all the layers added to the group.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Calls setZIndex on every layer contained in this group, passing the z-index.
+
+
+
+ getLayerId (<Layer > layer )
+ Number
+ Returns the internal ID for a layer
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ GeoJSON Represents a GeoJSON object or an array of GeoJSON objects. Allows you to parse
+GeoJSON data and display it on the map. Extends FeatureGroup .
+
+
+Usage example
+
+
+
+
+
+
+
+L.geoJSON(data, {
+ style: function (feature) {
+ return {color: feature.properties.color};
+ }
+}).bindPopup(function (layer) {
+ return layer.feature.properties.description;
+}).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.geoJSON (<Object> geojson? , <GeoJSON options > options? )
+ Creates a GeoJSON layer. Optionally accepts an object in
+GeoJSON format to display on the map
+(you can alternatively add it later with addData method) and an options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pointToLayer
+ Function
+ *
+ A Function defining how GeoJSON points spawn Leaflet layers. It is internally
+called when data is added, passing the GeoJSON point feature and its LatLng .
+The default is to spawn a default Marker :
+function(geoJsonPoint, latlng) {
+ return L.marker(latlng);
+}
+
+
+
+ style
+ Function
+ *
+ A Function defining the Path options for styling GeoJSON lines and polygons,
+called internally when data is added.
+The default value is to not override any defaults:
+function (geoJsonFeature) {
+ return {}
+}
+
+
+
+ onEachFeature
+ Function
+ *
+ A Function that will be called once for each created Feature, after it has
+been created and styled. Useful for attaching events and popups to features.
+The default is to do nothing with the newly created layers:
+function (feature, layer) {}
+
+
+
+ filter
+ Function
+ *
+ A Function that will be used to decide whether to include a feature or not.
+The default is to include all features:
+function (geoJsonFeature) {
+ return true;
+}
+
+Note: dynamically changing the filter option will have effect only on newly
+added data. It will not re-evaluate already included features.
+
+
+ coordsToLatLng
+ Function
+ *
+ A Function that will be used for converting GeoJSON coordinates to LatLng s.
+The default is the coordsToLatLng static method.
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addData (data )
+ this
+ Adds a GeoJSON object to the layer.
+
+
+
+ resetStyle (layer )
+ this
+ Resets the given vector layer's style to the original GeoJSON style, useful for resetting style after hover events.
+
+
+
+ setStyle (style )
+ this
+ Changes styles of GeoJSON vector layers with the given style function.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from FeatureGroup
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bringToFront ()
+ this
+ Brings the layer group to the top of all other layers
+
+
+
+ bringToBack ()
+ this
+ Brings the layer group to the back of all other layers
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from LayerGroup
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the layer group (as a GeoJSON FeatureCollection, GeometryCollection, or MultiPoint).
+
+
+
+ addLayer (<Layer > layer )
+ this
+ Adds the given layer to the group.
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Removes the given layer from the group.
+
+
+
+ removeLayer (<Number> id )
+ this
+ Removes the layer with the given internal ID from the group.
+
+
+
+ hasLayer (<Layer > layer )
+ Boolean
+ Returns true if the given layer is currently added to the group.
+
+
+
+ hasLayer (<Number> id )
+ Boolean
+ Returns true if the given internal ID is currently added to the group.
+
+
+
+ clearLayers ()
+ this
+ Removes all the layers from the group.
+
+
+
+ invoke (<String> methodName , … )
+ this
+ Calls methodName on every layer contained in this group, passing any
+additional parameters. Has no effect if the layers contained do not
+implement methodName.
+
+
+
+ eachLayer (<Function> fn , <Object> context? )
+ this
+ Iterates over the layers of the group, optionally specifying context of the iterator function.
+group.eachLayer(function (layer) {
+ layer.bindPopup('Hello');
+});
+
+
+
+
+ getLayer (<Number> id )
+ Layer
+ Returns the layer with the given internal ID.
+
+
+
+ getLayers ()
+ Layer[]
+ Returns an array of all the layers added to the group.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Calls setZIndex on every layer contained in this group, passing the z-index.
+
+
+
+ getLayerId (<Layer > layer )
+ Number
+ Returns the internal ID for a layer
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+
+Functions
+
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ geometryToLayer (<Object> featureData , <GeoJSON options > options? )
+ Layer
+ Creates a Layer from a given GeoJSON feature. Can use a custom
+pointToLayer and/or coordsToLatLng
+functions if provided as options.
+
+
+ coordsToLatLng (<Array> coords )
+ LatLng
+ Creates a LatLng object from an array of 2 numbers (longitude, latitude)
+or 3 numbers (longitude, latitude, altitude) used in GeoJSON for points.
+
+
+ coordsToLatLngs (<Array> coords , <Number> levelsDeep? , <Function> coordsToLatLng? )
+ Array
+ Creates a multidimensional array of LatLng s from a GeoJSON coordinates array.
+levelsDeep specifies the nesting level (0 is for an array of points, 1 for an array of arrays of points, etc., 0 by default).
+Can use a custom coordsToLatLng function.
+
+
+ latLngToCoords (<LatLng > latlng , <Number> precision? )
+ Array
+ Reverse of coordsToLatLng
+
+
+ latLngsToCoords (<Array> latlngs , <Number> levelsDeep? , <Boolean> closed? )
+ Array
+ Reverse of coordsToLatLngs
+closed determines whether the first point should be appended to the end of the array to close the feature, only used when levelsDeep is 0. False by default.
+
+
+ asFeature (<Object> geojson )
+ Object
+ Normalize GeoJSON geometries/features into GeoJSON features.
+
+
+
+
+
+
+ GridLayer Generic class for handling a tiled grid of HTML elements. This is the base class for all tile layers and replaces TileLayer.Canvas.
+GridLayer can be extended to create a tiled grid of HTML elements like <canvas>, <img> or <div>. GridLayer will handle creating and animating these DOM elements for you.
+
+
+Usage example
+
+
+
+Synchronous usage
+
+
+
+To create a custom layer, extend GridLayer and implement the createTile() method, which will be passed a Point object with the x, y, and z (zoom level) coordinates to draw your tile.
+var CanvasLayer = L.GridLayer.extend({
+ createTile: function(coords){
+ // create a <canvas> element for drawing
+ var tile = L.DomUtil.create('canvas', 'leaflet-tile');
+ // setup tile width and height according to the options
+ var size = this.getTileSize();
+ tile.width = size.x;
+ tile.height = size.y;
+ // get a canvas context and draw something on it using coords.x, coords.y and coords.z
+ var ctx = tile.getContext('2d');
+ // return the tile so it can be rendered on screen
+ return tile;
+ }
+});
+
+
+
+
+
+
+Asynchronous usage
+
+
+
+Tile creation can also be asynchronous, this is useful when using a third-party drawing library. Once the tile is finished drawing it can be passed to the done() callback.
+var CanvasLayer = L.GridLayer.extend({
+ createTile: function(coords, done){
+ var error;
+ // create a <canvas> element for drawing
+ var tile = L.DomUtil.create('canvas', 'leaflet-tile');
+ // setup tile width and height according to the options
+ var size = this.getTileSize();
+ tile.width = size.x;
+ tile.height = size.y;
+ // draw something asynchronously and pass the tile to the done() callback
+ setTimeout(function() {
+ done(error, tile);
+ }, 1000);
+ return tile;
+ }
+});
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.gridLayer (<GridLayer options > options? )
+ Creates a new instance of GridLayer with the supplied options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ tileSize
+ Number|Point
+ 256
+ Width and height of tiles in the grid. Use a number if width and height are equal, or L.point(width, height) otherwise.
+
+
+ opacity
+ Number
+ 1.0
+ Opacity of the tiles. Can be used in the createTile() function.
+
+
+ updateWhenIdle
+ Boolean
+ (depends)
+ Load new tiles only when panning ends.
+true by default on mobile browsers, in order to avoid too many requests and keep smooth navigation.
+false otherwise in order to display new tiles during panning, since it is easy to pan outside the
+keepBuffer option in desktop browsers.
+
+
+ updateWhenZooming
+ Boolean
+ true
+ By default, a smooth zoom animation (during a touch zoom or a flyTo() ) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends.
+
+
+ updateInterval
+ Number
+ 200
+ Tiles will not update more than once every updateInterval milliseconds when panning.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the tile layer.
+
+
+ bounds
+ LatLngBounds
+ undefined
+ If set, tiles will only be loaded inside the set LatLngBounds .
+
+
+ minZoom
+ Number
+ 0
+ The minimum zoom level down to which this layer will be displayed (inclusive).
+
+
+ maxZoom
+ Number
+ undefined
+ The maximum zoom level up to which this layer will be displayed (inclusive).
+
+
+ maxNativeZoom
+ Number
+ undefined
+ Maximum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels higher than maxNativeZoom will be loaded
+from maxNativeZoom level and auto-scaled.
+
+
+ minNativeZoom
+ Number
+ undefined
+ Minimum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels lower than minNativeZoom will be loaded
+from minNativeZoom level and auto-scaled.
+
+
+ noWrap
+ Boolean
+ false
+ Whether the layer is wrapped around the antimeridian. If true, the
+GridLayer will only be displayed once at low zoom levels. Has no
+effect when the map CRS doesn't wrap around. Can be used
+in combination with bounds to prevent requesting
+tiles outside the CRS limits.
+
+
+ pane
+ String
+ 'tilePane'
+ Map pane where the grid layer will be added.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the tile layer. Empty by default.
+
+
+ keepBuffer
+ Number
+ 2
+ When panning the map, keep this many rows and columns of tiles before unloading them.
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ loading
+ Event
+ Fired when the grid layer starts loading tiles.
+
+
+ tileunload
+ TileEvent
+ Fired when a tile is removed (e.g. when a tile goes off the screen).
+
+
+ tileloadstart
+ TileEvent
+ Fired when a tile is requested and starts loading.
+
+
+ tileerror
+ TileErrorEvent
+ Fired when there is an error loading a tile.
+
+
+ tileload
+ TileEvent
+ Fired when a tile loads.
+
+
+ load
+ Event
+ Fired when the grid layer loaded all visible tiles.
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bringToFront ()
+ this
+ Brings the tile layer to the top of all tile layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the tile layer to the bottom of all tile layers.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTML element that contains the tiles for this layer.
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Changes the opacity of the grid layer.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Changes the zIndex of the grid layer.
+
+
+
+ isLoading ()
+ Boolean
+ Returns true if any tile in the grid layer has not finished loading.
+
+
+
+ redraw ()
+ this
+ Causes the layer to clear all the tiles and request them again.
+
+
+
+ getTileSize ()
+ Point
+ Normalizes the tileSize option into a point. Used by the createTile() method.
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ createTile (<Object> coords , <Function> done? )
+ HTMLElement
+ Called only internally, must be overridden by classes extending GridLayer .
+Returns the HTMLElement corresponding to the given coords. If the done callback
+is specified, it must be called when the tile has finished loading and drawing.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ LatLng Represents a geographical point with a certain latitude and longitude.
+
+
+Usage example
+
+
+
+
+
+
+
+var latlng = L.latLng(50.5, 30.5);
+All Leaflet methods that accept LatLng objects also accept them in a simple Array form and simple object form (unless noted otherwise), so these lines are equivalent:
+map.panTo([50, 30]);
+map.panTo({lon: 30, lat: 50});
+map.panTo({lat: 50, lng: 30});
+map.panTo(L.latLng(50, 30));
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.latLng (<Number> latitude , <Number> longitude , <Number> altitude? )
+ Creates an object representing a geographical point with the given latitude and longitude (and optionally altitude).
+
+
+ L.latLng (<Array> coords )
+ Expects an array of the form [Number, Number] or [Number, Number, Number] instead.
+
+
+ L.latLng (<Object> coords )
+ Expects an plain object of the form {lat: Number, lng: Number} or {lat: Number, lng: Number, alt: Number} instead.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ equals (<LatLng > otherLatLng , <Number> maxMargin? )
+ Boolean
+ Returns true if the given LatLng point is at the same position (within a small margin of error). The margin of error can be overridden by setting maxMargin to a small number.
+
+
+
+ toString ()
+ String
+ Returns a string representation of the point (for debugging purposes).
+
+
+
+ distanceTo (<LatLng > otherLatLng )
+ Number
+ Returns the distance (in meters) to the given LatLng calculated using the Haversine formula .
+
+
+
+ wrap ()
+ LatLng
+ Returns a new LatLng object with the longitude wrapped so it's always between -180 and +180 degrees.
+
+
+
+ toBounds (<Number> sizeInMeters )
+ LatLngBounds
+ Returns a new LatLngBounds object in which each boundary is sizeInMeters/2 meters apart from the LatLng .
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ lat
+ Number
+ Latitude in degrees
+
+
+ lng
+ Number
+ Longitude in degrees
+
+
+ alt
+ Number
+ Altitude in meters (optional)
+
+
+
+
+
+
+ LatLngBounds Represents a rectangular geographical area on a map.
+
+
+Usage example
+
+
+
+
+
+
+
+var corner1 = L.latLng(40.712, -74.227),
+corner2 = L.latLng(40.774, -74.125),
+bounds = L.latLngBounds(corner1, corner2);
+
+All Leaflet methods that accept LatLngBounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:
+map.fitBounds([
+ [40.712, -74.227],
+ [40.774, -74.125]
+]);
+
+Caution: if the area crosses the antimeridian (often confused with the International Date Line), you must specify corners outside the [-180, 180] degrees longitude range.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.latLngBounds (<LatLng > corner1 , <LatLng > corner2 )
+ Creates a LatLngBounds object by defining two diagonally opposite corners of the rectangle.
+
+
+ L.latLngBounds (<LatLng[]> latlngs )
+ Creates a LatLngBounds object defined by the geographical points it contains. Very useful for zooming the map to fit a particular set of locations with fitBounds .
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ extend (<LatLng > latlng )
+ this
+ Extend the bounds to contain the given point
+
+
+
+ extend (<LatLngBounds > otherBounds )
+ this
+ Extend the bounds to contain the given bounds
+
+
+
+ pad (<Number> bufferRatio )
+ LatLngBounds
+ Returns bigger bounds created by extending the current bounds by a given percentage in each direction.
+
+
+
+ getCenter ()
+ LatLng
+ Returns the center point of the bounds.
+
+
+
+ getSouthWest ()
+ LatLng
+ Returns the south-west point of the bounds.
+
+
+
+ getNorthEast ()
+ LatLng
+ Returns the north-east point of the bounds.
+
+
+
+ getNorthWest ()
+ LatLng
+ Returns the north-west point of the bounds.
+
+
+
+ getSouthEast ()
+ LatLng
+ Returns the south-east point of the bounds.
+
+
+
+ getWest ()
+ Number
+ Returns the west longitude of the bounds
+
+
+
+ getSouth ()
+ Number
+ Returns the south latitude of the bounds
+
+
+
+ getEast ()
+ Number
+ Returns the east longitude of the bounds
+
+
+
+ getNorth ()
+ Number
+ Returns the north latitude of the bounds
+
+
+
+ contains (<LatLngBounds > otherBounds )
+ Boolean
+ Returns true if the rectangle contains the given one.
+
+
+
+ contains (<LatLng > latlng )
+ Boolean
+ Returns true if the rectangle contains the given point.
+
+
+
+ intersects (<LatLngBounds > otherBounds )
+ Boolean
+ Returns true if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common.
+
+
+
+ overlaps (<Bounds > otherBounds )
+ Boolean
+ Returns true if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area.
+
+
+
+ toBBoxString ()
+ String
+ Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format. Useful for sending requests to web services that return geo data.
+
+
+
+ equals (<LatLngBounds > otherBounds , <Number> maxMargin? )
+ Boolean
+ Returns true if the rectangle is equivalent (within a small margin of error) to the given bounds. The margin of error can be overridden by setting maxMargin to a small number.
+
+
+
+ isValid ()
+ Boolean
+ Returns true if the bounds are properly initialized.
+
+
+
+
+
+
+
+ Point Represents a point with x and y coordinates in pixels.
+
+
+Usage example
+
+
+
+
+
+
+
+var point = L.point(200, 300);
+
+All Leaflet methods and options that accept Point objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent:
+map.panBy([200, 300]);
+map.panBy(L.point(200, 300));
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.point (<Number> x , <Number> y , <Boolean> round? )
+ Creates a Point object with the given x and y coordinates. If optional round is set to true, rounds the x and y values.
+
+
+ L.point (<Number[]> coords )
+ Expects an array of the form [x, y] instead.
+
+
+ L.point (<Object> coords )
+ Expects a plain object of the form {x: Number, y: Number} instead.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ clone ()
+ Point
+ Returns a copy of the current point.
+
+
+
+ add (<Point > otherPoint )
+ Point
+ Returns the result of addition of the current and the given points.
+
+
+
+ subtract (<Point > otherPoint )
+ Point
+ Returns the result of subtraction of the given point from the current.
+
+
+
+ divideBy (<Number> num )
+ Point
+ Returns the result of division of the current point by the given number.
+
+
+
+ multiplyBy (<Number> num )
+ Point
+ Returns the result of multiplication of the current point by the given number.
+
+
+
+ scaleBy (<Point > scale )
+ Point
+ Multiply each coordinate of the current point by each coordinate of
+scale. In linear algebra terms, multiply the point by the
+scaling matrix
+defined by scale.
+
+
+
+ unscaleBy (<Point > scale )
+ Point
+ Inverse of scaleBy. Divide each coordinate of the current point by
+each coordinate of scale.
+
+
+
+ round ()
+ Point
+ Returns a copy of the current point with rounded coordinates.
+
+
+
+ floor ()
+ Point
+ Returns a copy of the current point with floored coordinates (rounded down).
+
+
+
+ ceil ()
+ Point
+ Returns a copy of the current point with ceiled coordinates (rounded up).
+
+
+
+ distanceTo (<Point > otherPoint )
+ Number
+ Returns the cartesian distance between the current and the given points.
+
+
+
+ equals (<Point > otherPoint )
+ Boolean
+ Returns true if the given point has the same coordinates.
+
+
+
+ contains (<Point > otherPoint )
+ Boolean
+ Returns true if both coordinates of the given point are less than the corresponding current point coordinates (in absolute values).
+
+
+
+ toString ()
+ String
+ Returns a string representation of the point for debugging purposes.
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ x
+ Number
+ The x coordinate of the point
+
+
+ y
+ Number
+ The y coordinate of the point
+
+
+
+
+
+
+ Bounds Represents a rectangular area in pixel coordinates.
+
+
+Usage example
+
+
+
+
+
+
+
+var p1 = L.point(10, 10),
+p2 = L.point(40, 60),
+bounds = L.bounds(p1, p2);
+
+All Leaflet methods that accept Bounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:
+otherBounds.intersects([[10, 10], [40, 60]]);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.bounds (<Point > corner1 , <Point > corner2 )
+ Creates a Bounds object from two corners coordinate pairs.
+
+
+ L.bounds (<Point[]> points )
+ Creates a Bounds object from the given array of points.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ extend (<Point > point )
+ this
+ Extends the bounds to contain the given point.
+
+
+
+ getCenter (<Boolean> round? )
+ Point
+ Returns the center point of the bounds.
+
+
+
+ getBottomLeft ()
+ Point
+ Returns the bottom-left point of the bounds.
+
+
+
+ getTopRight ()
+ Point
+ Returns the top-right point of the bounds.
+
+
+
+ getTopLeft ()
+ Point
+ Returns the top-left point of the bounds (i.e. this.min ).
+
+
+
+ getBottomRight ()
+ Point
+ Returns the bottom-right point of the bounds (i.e. this.max ).
+
+
+
+ getSize ()
+ Point
+ Returns the size of the given bounds
+
+
+
+ contains (<Bounds > otherBounds )
+ Boolean
+ Returns true if the rectangle contains the given one.
+
+
+
+ contains (<Point > point )
+ Boolean
+ Returns true if the rectangle contains the given point.
+
+
+
+ intersects (<Bounds > otherBounds )
+ Boolean
+ Returns true if the rectangle intersects the given bounds. Two bounds
+intersect if they have at least one point in common.
+
+
+
+ overlaps (<Bounds > otherBounds )
+ Boolean
+ Returns true if the rectangle overlaps the given bounds. Two bounds
+overlap if their intersection is an area.
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ min
+ Point
+ The top left corner of the rectangle.
+
+
+ max
+ Point
+ The bottom right corner of the rectangle.
+
+
+
+
+
+
+ Icon Represents an icon to provide when creating a marker.
+
+
+Usage example
+
+
+
+
+
+
+
+var myIcon = L.icon({
+ iconUrl: 'my-icon.png',
+ iconSize: [38, 95],
+ iconAnchor: [22, 94],
+ popupAnchor: [-3, -76],
+ shadowUrl: 'my-icon-shadow.png',
+ shadowSize: [68, 95],
+ shadowAnchor: [22, 94]
+});
+L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
+
+L.Icon.Default extends L.Icon and is the blue icon Leaflet uses for markers by default.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.icon (<Icon options > options )
+ Creates an icon instance with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ iconUrl
+ String
+ null
+ (required) The URL to the icon image (absolute or relative to your script path).
+
+
+ iconRetinaUrl
+ String
+ null
+ The URL to a retina sized version of the icon image (absolute or relative to your
+script path). Used for Retina screen devices.
+
+
+ iconSize
+ Point
+ null
+ Size of the icon image in pixels.
+
+
+ iconAnchor
+ Point
+ null
+ The coordinates of the "tip" of the icon (relative to its top left corner). The icon
+will be aligned so that this point is at the marker's geographical location. Centered
+by default if size is specified, also can be set in CSS with negative margins.
+
+
+
+ shadowUrl
+ String
+ null
+ The URL to the icon shadow image. If not specified, no shadow image will be created.
+
+
+ shadowRetinaUrl
+ String
+ null
+
+
+
+ shadowSize
+ Point
+ null
+ Size of the shadow image in pixels.
+
+
+ shadowAnchor
+ Point
+ null
+ The coordinates of the "tip" of the shadow (relative to its top left corner) (the same
+as iconAnchor if not specified).
+
+
+ className
+ String
+ ''
+ A custom class name to assign to both icon and shadow images. Empty by default.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ createIcon (<HTMLElement> oldIcon? )
+ HTMLElement
+ Called internally when the icon has to be shown, returns a <img> HTML element
+styled according to the options.
+
+
+
+ createShadow (<HTMLElement> oldIcon? )
+ HTMLElement
+ As createIcon, but for the shadow beneath it.
+
+
+
+
+
+
+
+
+
+
+Icon.Default
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ imagePath
+ String
+
+ Icon.Default will try to auto-detect the absolute location of the
+blue icon images. If you are placing these images in a non-standard
+way, set this option to point to the right absolute path.
+
+
+
+
+
+
+ DivIcon Represents a lightweight icon for markers that uses a simple <div>
+element instead of an image. Inherits from Icon but ignores the iconUrl and shadow options.
+
+
+Usage example
+
+
+
+
+
+
+
+var myIcon = L.divIcon({className: 'my-div-icon'});
+// you can set .my-div-icon styles in CSS
+L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
+
+By default, it has a 'leaflet-div-icon' CSS class and is styled as a little white square with a shadow.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.divIcon (<DivIcon options > options )
+ Creates a DivIcon instance with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ html
+ String
+ ''
+ Custom HTML code to put inside the div element, empty by default.
+
+
+ bgPos
+ Point
+ [0, 0]
+ Optional relative position of the background, in pixels
+
+
+
+
+
+
+
+
▶ Options inherited from Icon
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ iconUrl
+ String
+ null
+ (required) The URL to the icon image (absolute or relative to your script path).
+
+
+ iconRetinaUrl
+ String
+ null
+ The URL to a retina sized version of the icon image (absolute or relative to your
+script path). Used for Retina screen devices.
+
+
+ iconSize
+ Point
+ null
+ Size of the icon image in pixels.
+
+
+ iconAnchor
+ Point
+ null
+ The coordinates of the "tip" of the icon (relative to its top left corner). The icon
+will be aligned so that this point is at the marker's geographical location. Centered
+by default if size is specified, also can be set in CSS with negative margins.
+
+
+
+ shadowUrl
+ String
+ null
+ The URL to the icon shadow image. If not specified, no shadow image will be created.
+
+
+ shadowRetinaUrl
+ String
+ null
+
+
+
+ shadowSize
+ Point
+ null
+ Size of the shadow image in pixels.
+
+
+ shadowAnchor
+ Point
+ null
+ The coordinates of the "tip" of the shadow (relative to its top left corner) (the same
+as iconAnchor if not specified).
+
+
+ className
+ String
+ ''
+ A custom class name to assign to both icon and shadow images. Empty by default.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Icon
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ createIcon (<HTMLElement> oldIcon? )
+ HTMLElement
+ Called internally when the icon has to be shown, returns a <img> HTML element
+styled according to the options.
+
+
+
+ createShadow (<HTMLElement> oldIcon? )
+ HTMLElement
+ As createIcon, but for the shadow beneath it.
+
+
+
+
+
+
+
+
+ Control.Zoom A basic zoom control with two buttons (zoom in and zoom out). It is put on the map by default unless you set its zoomControl option to false. Extends Control .
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.control.zoom (<Control.Zoom options > options )
+ Creates a zoom control
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ zoomInText
+ String
+ '+'
+ The text set on the 'zoom in' button.
+
+
+ zoomInTitle
+ String
+ 'Zoom in'
+ The title set on the 'zoom in' button.
+
+
+ zoomOutText
+ String
+ '−
+ '
+The text set on the 'zoom out' button.
+
+
+ zoomOutTitle
+ String
+ 'Zoom out'
+ The title set on the 'zoom out' button.
+
+
+
+
+
+
+
+
▶ Options inherited from Control
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Control
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+
+
+ Control.Attribution The attribution control allows you to display attribution data in a small text box on a map. It is put on the map by default unless you set its attributionControl option to false, and it fetches attribution texts from layers with the getAttribution method automatically. Extends Control.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ prefix
+ String
+ 'Leaflet'
+ The HTML text shown before the attributions. Pass false to disable.
+
+
+
+
+
+
+
+
▶ Options inherited from Control
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setPrefix (<String> prefix )
+ this
+ Sets the text before the attributions.
+
+
+
+ addAttribution (<String> text )
+ this
+ Adds an attribution text (e.g. 'Vector data © Mapbox').
+
+
+
+ removeAttribution (<String> text )
+ this
+ Removes an attribution text.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Control
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+
+
+ Control.Layers The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the detailed example ). Extends Control .
+
+
+Usage example
+
+
+
+
+
+
+
+var baseLayers = {
+ "Mapbox": mapbox,
+ "OpenStreetMap": osm
+};
+var overlays = {
+ "Marker": marker,
+ "Roads": roadsLayer
+};
+L.control.layers(baseLayers, overlays).addTo(map);
+
+The baseLayers and overlays parameters are object literals with layer names as keys and Layer objects as values:
+{
+ "<someName1>": layer1,
+ "<someName2>": layer2
+}
+
+The layer names can contain HTML, which allows you to add additional styling to the items:
+{"<img src='my-layer-icon' /> <span class='my-layer-item'>My Layer</span>": myLayer}
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.control.layers (<Object> baselayers? , <Object> overlays? , <Control.Layers options > options? )
+ Creates an attribution control with the given layers. Base layers will be switched with radio buttons, while overlays will be switched with checkboxes. Note that all base layers should be passed in the base layers object, but only one should be added to the map during map instantiation.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ collapsed
+ Boolean
+ true
+ If true, the control will be collapsed into an icon and expanded on mouse hover or touch.
+
+
+ autoZIndex
+ Boolean
+ true
+ If true, the control will assign zIndexes in increasing order to all of its layers so that the order is preserved when switching them on/off.
+
+
+ hideSingleBase
+ Boolean
+ false
+ If true, the base layers in the control will be hidden when there is only one.
+
+
+ sortLayers
+ Boolean
+ false
+ Whether to sort the layers. When false, layers will keep the order
+in which they were added to the control.
+
+
+ sortFunction
+ Function
+ *
+ A compare function
+that will be used for sorting the layers, when sortLayers is true.
+The function receives both the L.Layer instances and their names, as in
+sortFunction(layerA, layerB, nameA, nameB).
+By default, it sorts layers alphabetically by their name.
+
+
+
+
+
+
+
+
▶ Options inherited from Control
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addBaseLayer (<Layer > layer , <String> name )
+ this
+ Adds a base layer (radio button entry) with the given name to the control.
+
+
+
+ addOverlay (<Layer > layer , <String> name )
+ this
+ Adds an overlay (checkbox entry) with the given name to the control.
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Remove the given layer from the control.
+
+
+
+ expand ()
+ this
+ Expand the control container if collapsed.
+
+
+
+ collapse ()
+ this
+ Collapse the control container if expanded.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Control
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+
+
+ Control.Scale A simple scale control that shows the scale of the current center of screen in metric (m/km) and imperial (mi/ft) systems. Extends Control .
+
+
+Usage example
+
+
+
+
+
+
+
+L.control.scale().addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.control.scale (<Control.Scale options > options? )
+ Creates an scale control with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ maxWidth
+ Number
+ 100
+ Maximum width of the control in pixels. The width is set dynamically to show round values (e.g. 100, 200, 500).
+
+
+ metric
+ Boolean
+ True
+ Whether to show the metric scale line (m/km).
+
+
+ imperial
+ Boolean
+ True
+ Whether to show the imperial scale line (mi/ft).
+
+
+ updateWhenIdle
+ Boolean
+ false
+ If true, the control is updated on moveend , otherwise it's always up-to-date (updated on move ).
+
+
+
+
+
+
+
+
▶ Options inherited from Control
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Control
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+
+
+ Browser A namespace with static properties for browser/feature detection used by Leaflet internally.
+
+
+Usage example
+
+
+
+
+
+
+
+if (L.Browser.ielt9) {
+ alert('Upgrade your browser, dude!');
+}
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ ie
+ Boolean
+ true for all Internet Explorer versions (not Edge).
+
+
+ ielt9
+ Boolean
+ true for Internet Explorer versions less than 9.
+
+
+ edge
+ Boolean
+ true for the Edge web browser.
+
+
+ webkit
+ Boolean
+ true for webkit-based browsers like Chrome and Safari (including mobile versions).
+
+
+ android
+ Boolean
+ true for any browser running on an Android platform.
+
+
+ android23
+ Boolean
+ true for browsers running on Android 2 or Android 3.
+
+
+ opera
+ Boolean
+ true for the Opera browser
+
+
+ chrome
+ Boolean
+ true for the Chrome browser.
+
+
+ gecko
+ Boolean
+ true for gecko-based browsers like Firefox.
+
+
+ safari
+ Boolean
+ true for the Safari browser.
+
+
+ opera12
+ Boolean
+ true for the Opera browser supporting CSS transforms (version 12 or later).
+
+
+ win
+ Boolean
+ true when the browser is running in a Windows platform
+
+
+ ie3d
+ Boolean
+ true for all Internet Explorer versions supporting CSS transforms.
+
+
+ webkit3d
+ Boolean
+ true for webkit-based browsers supporting CSS transforms.
+
+
+ gecko3d
+ Boolean
+ true for gecko-based browsers supporting CSS transforms.
+
+
+ any3d
+ Boolean
+ true for all browsers supporting CSS transforms.
+
+
+ mobile
+ Boolean
+ true for all browsers running in a mobile device.
+
+
+ mobileWebkit
+ Boolean
+ true for all webkit-based browsers in a mobile device.
+
+
+ mobileWebkit3d
+ Boolean
+ true for all webkit-based browsers in a mobile device supporting CSS transforms.
+
+
+ msPointer
+ Boolean
+ true for browsers implementing the Microsoft touch events model (notably IE10).
+
+
+ pointer
+ Boolean
+ true for all browsers supporting pointer events .
+
+
+ touch
+ Boolean
+ true for all browsers supporting touch events .
+This does not necessarily mean that the browser is running in a computer with
+a touchscreen, it only means that the browser is capable of understanding
+touch events.
+
+
+ mobileOpera
+ Boolean
+ true for the Opera browser in a mobile device.
+
+
+ mobileGecko
+ Boolean
+ true for gecko-based browsers running in a mobile device.
+
+
+ retina
+ Boolean
+ true for browsers on a high-resolution "retina" screen.
+
+
+ canvas
+ Boolean
+ true when the browser supports <canvas> .
+
+
+ svg
+ Boolean
+ true when the browser supports SVG .
+
+
+ vml
+ Boolean
+ true if the browser supports VML .
+
+
+
+
+
+
+ Util Various utility functions, used by Leaflet internally.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ extend (<Object> dest , <Object> src? )
+ Object
+ Merges the properties of the src object (or multiple objects) into dest object and returns the latter. Has an L.extend shortcut.
+
+
+ create (<Object> proto , <Object> properties? )
+ Object
+ Compatibility polyfill for Object.create
+
+
+ bind (<Function> fn , … )
+ Function
+ Returns a new function bound to the arguments passed, like Function.prototype.bind .
+Has a L.bind() shortcut.
+
+
+ stamp (<Object> obj )
+ Number
+ Returns the unique ID of an object, assigning it one if it doesn't have it.
+
+
+ throttle (<Function> fn , <Number> time , <Object> context )
+ Function
+ Returns a function which executes function fn with the given scope context
+(so that the this keyword refers to context inside fn's code). The function
+fn will be called no more than one time per given amount of time. The arguments
+received by the bound function will be any arguments passed when binding the
+function, followed by any arguments passed when invoking the bound function.
+Has an L.throttle shortcut.
+
+
+ wrapNum (<Number> num , <Number[]> range , <Boolean> includeMax? )
+ Number
+ Returns the number num modulo range in such a way so it lies within
+range[0] and range[1]. The returned value will be always smaller than
+range[1] unless includeMax is set to true.
+
+
+ falseFn ()
+ Function
+ Returns a function which always returns false.
+
+
+ formatNum (<Number> num , <Number> digits? )
+ Number
+ Returns the number num rounded to digits decimals, or to 5 decimals by default.
+
+
+ trim (<String> str )
+ String
+ Compatibility polyfill for String.prototype.trim
+
+
+ splitWords (<String> str )
+ String[]
+ Trims and splits the string on whitespace and returns the array of parts.
+
+
+ setOptions (<Object> obj , <Object> options )
+ Object
+ Merges the given properties to the options of the obj object, returning the resulting options. See Class options. Has an L.setOptions shortcut.
+
+
+ getParamString (<Object> obj , <String> existingUrl? , <Boolean> uppercase? )
+ String
+ Converts an object into a parameter URL string, e.g. {a: "foo", b: "bar"}
+translates to '?a=foo&b=bar'. If existingUrl is set, the parameters will
+be appended at the end. If uppercase is true, the parameter names will
+be uppercased (e.g. '?A=foo&B=bar')
+
+
+ template (<String> str , <Object> data )
+ String
+ Simple templating facility, accepts a template string of the form 'Hello {a}, {b}'
+and a data object like {a: 'foo', b: 'bar'}, returns evaluated string
+('Hello foo, bar'). You can also specify functions instead of strings for
+data values — they will be evaluated passing data as an argument.
+
+
+ isArray (obj )
+ Boolean
+ Compatibility polyfill for Array.isArray
+
+
+ indexOf (<Array> array , <Object> el )
+ Number
+ Compatibility polyfill for Array.prototype.indexOf
+
+
+ requestAnimFrame (<Function> fn , <Object> context? , <Boolean> immediate? )
+ Number
+ Schedules fn to be executed when the browser repaints. fn is bound to
+context if given. When immediate is set, fn is called immediately if
+the browser doesn't have native support for
+window.requestAnimationFrame ,
+otherwise it's delayed. Returns a request ID that can be used to cancel the request.
+
+
+ cancelAnimFrame (<Number> id )
+ undefined
+ Cancels a previous requestAnimFrame. See also window.cancelAnimationFrame .
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ lastId
+ Number
+ Last unique ID used by stamp()
+
+
+ emptyImageUrl
+ String
+ Data URI string containing a base64-encoded empty GIF image.
+Used as a hack to free memory from unused images on WebKit-powered
+mobile devices (by setting image src to this string).
+
+
+
+
+
+
+ Represents an affine transformation: a set of coefficients a, b, c, d
+for transforming a point of a form (x, y) into (a*x + b, c*y + d) and doing
+the reverse. Used by Leaflet in its projections code.
+
+
+
+
+
+
+
+
+
+
+var transformation = L.transformation(2, 5, -1, 10),
+ p = L.point(1, 2),
+ p2 = transformation.transform(p), // L.point(7, 8)
+ p3 = transformation.untransform(p2); // L.point(1, 2)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.transformation (<Number> a , <Number> b , <Number> c , <Number> d )
+ Instantiates a Transformation object with the given coefficients.
+
+
+ L.transformation (<Array> coefficients )
+ Expects an coefficients array of the form
+[a: Number, b: Number, c: Number, d: Number].
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ transform (<Point > point , <Number> scale? )
+ Point
+ Returns a transformed point, optionally multiplied by the given scale.
+Only accepts actual L.Point instances, not arrays.
+
+
+
+ untransform (<Point > point , <Number> scale? )
+ Point
+ Returns the reverse transformation of the given point, optionally divided
+by the given scale. Only accepts actual L.Point instances, not arrays.
+
+
+
+
+
+
+
+ LineUtil Various utility functions for polyline points processing, used by Leaflet internally to make polylines lightning-fast.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ simplify (<Point[]> points , <Number> tolerance )
+ Point[]
+ Dramatically reduces the number of points in a polyline while retaining
+its shape and returns a new array of simplified points, using the
+Douglas-Peucker algorithm .
+Used for a huge performance boost when processing/displaying Leaflet polylines for
+each zoom level and also reducing visual noise. tolerance affects the amount of
+simplification (lesser value means higher quality but slower and with more points).
+Also released as a separated micro-library Simplify.js .
+
+
+ pointToSegmentDistance (<Point > p , <Point > p1 , <Point > p2 )
+ Number
+ Returns the distance between point p and segment p1 to p2.
+
+
+ closestPointOnSegment (<Point > p , <Point > p1 , <Point > p2 )
+ Number
+ Returns the closest point from a point p on a segment p1 to p2.
+
+
+ clipSegment (<Point > a , <Point > b , <Bounds > bounds , <Boolean> useLastCode? , <Boolean> round? )
+ Point[]|Boolean
+ Clips the segment a to b by rectangular bounds with the
+Cohen-Sutherland algorithm
+(modifying the segment points directly!). Used by Leaflet to only show polyline
+points that are on the screen or near, increasing performance.
+
+
+ isFlat (<LatLng[]> latlngs )
+ Boolean
+ Returns true if latlngs is a flat array, false is nested.
+
+
+
+
+
+
+ PolyUtil Various utility functions for polygon geometries.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ clipPolygon (<Point[]> points , <Bounds > bounds , <Boolean> round? )
+ Point[]
+ Clips the polygon geometry defined by the given points by the given bounds (using the Sutherland-Hodgeman algorithm ).
+Used by Leaflet to only show polygon points that are on the screen or near, increasing
+performance. Note that polygon points needs different algorithm for clipping
+than polyline, so there's a separate method for it.
+
+
+
+
+
+
+ DomEvent Utility functions to work with the DOM events , used by Leaflet internally.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ on (<HTMLElement> el , <String> types , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular DOM event type of the
+element el. You can optionally specify the context of the listener
+(object the this keyword will point to). You can also pass several
+space-separated types (e.g. 'click dblclick').
+
+
+ on (<HTMLElement> el , <Object> eventMap , <Object> context? )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+ off (<HTMLElement> el , <String> types , <Function> fn , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified,
+it will remove all the listeners of that particular DOM event from the element.
+Note that if you passed a custom context to on, you must pass the same
+context to off in order to remove the listener.
+
+
+ off (<HTMLElement> el , <Object> eventMap , <Object> context? )
+ this
+ Removes a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+ off (<HTMLElement> el )
+ this
+ Removes all known event listeners
+
+
+ stopPropagation (<DOMEvent> ev )
+ this
+ Stop the given event from propagation to parent elements. Used inside the listener functions:
+L.DomEvent.on(div, 'click', function (ev) {
+ L.DomEvent.stopPropagation(ev);
+});
+
+
+
+ disableScrollPropagation (<HTMLElement> el )
+ this
+ Adds stopPropagation to the element's 'mousewheel' events (plus browser variants).
+
+
+ disableClickPropagation (<HTMLElement> el )
+ this
+ Adds stopPropagation to the element's 'click', 'doubleclick',
+'mousedown' and 'touchstart' events (plus browser variants).
+
+
+ preventDefault (<DOMEvent> ev )
+ this
+ Prevents the default action of the DOM Event ev from happening (such as
+following a link in the href of the a element, or doing a POST request
+with page reload when a <form> is submitted).
+Use it inside listener functions.
+
+
+ stop (ev )
+ this
+ Does stopPropagation and preventDefault at the same time.
+
+
+ getMousePosition (<DOMEvent> ev , <HTMLElement> container? )
+ Point
+ Gets normalized mouse position from a DOM event relative to the
+container or to the whole page if not specified.
+
+
+ getWheelDelta (<DOMEvent> ev )
+ Number
+ Gets normalized wheel delta from a mousewheel DOM event, in vertical
+pixels scrolled (negative if scrolling down).
+Events from pointing devices without precise scrolling are mapped to
+a best guess of 60 pixels.
+
+
+ addListener (… )
+ this
+ Alias to L.DomEvent.on
+
+
+ removeListener (… )
+ this
+ Alias to L.DomEvent.off
+
+
+
+
+
+
+ DomUtil Utility functions to work with the DOM
+tree, used by Leaflet internally.
+Most functions expecting or returning a HTMLElement also work for
+SVG elements. The only difference is that classes refer to CSS classes
+in HTML and SVG classes in SVG.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ get (<String|HTMLElement> id )
+ HTMLElement
+ Returns an element given its DOM id, or returns the element itself
+if it was passed directly.
+
+
+ getStyle (<HTMLElement> el , <String> styleAttrib )
+ String
+ Returns the value for a certain style attribute on an element,
+including computed values or values set through CSS.
+
+
+ create (<String> tagName , <String> className? , <HTMLElement> container? )
+ HTMLElement
+ Creates an HTML element with tagName, sets its class to className, and optionally appends it to container element.
+
+
+ remove (<HTMLElement> el )
+
+ Removes el from its parent element
+
+
+ empty (<HTMLElement> el )
+
+ Removes all of el's children elements from el
+
+
+ toFront (<HTMLElement> el )
+
+ Makes el the last child of its parent, so it renders in front of the other children.
+
+
+ toBack (<HTMLElement> el )
+
+ Makes el the first child of its parent, so it renders behind the other children.
+
+
+ hasClass (<HTMLElement> el , <String> name )
+ Boolean
+ Returns true if the element's class attribute contains name.
+
+
+ addClass (<HTMLElement> el , <String> name )
+
+ Adds name to the element's class attribute.
+
+
+ removeClass (<HTMLElement> el , <String> name )
+
+ Removes name from the element's class attribute.
+
+
+ setClass (<HTMLElement> el , <String> name )
+
+ Sets the element's class.
+
+
+ getClass (<HTMLElement> el )
+ String
+ Returns the element's class.
+
+
+ setOpacity (<HTMLElement> el , <Number> opacity )
+
+ Set the opacity of an element (including old IE support).
+opacity must be a number from 0 to 1.
+
+
+ testProp (<String[]> props )
+ String|false
+ Goes through the array of style names and returns the first name
+that is a valid style name for an element. If no such name is found,
+it returns false. Useful for vendor-prefixed styles like transform.
+
+
+ setTransform (<HTMLElement> el , <Point > offset , <Number> scale? )
+
+ Resets the 3D CSS transform of el so it is translated by offset pixels
+and optionally scaled by scale. Does not have an effect if the
+browser doesn't support 3D CSS transforms.
+
+
+ setPosition (<HTMLElement> el , <Point > position )
+
+ Sets the position of el to coordinates specified by position,
+using CSS translate or top/left positioning depending on the browser
+(used by Leaflet internally to position its layers).
+
+
+ getPosition (<HTMLElement> el )
+ Point
+ Returns the coordinates of an element previously positioned with setPosition.
+
+
+ disableTextSelection ()
+
+ Prevents the user from generating selectstart DOM events, usually generated
+when the user drags the mouse through a page with text. Used internally
+by Leaflet to override the behaviour of any click-and-drag interaction on
+the map. Affects drag interactions on the whole document.
+
+
+ enableTextSelection ()
+
+ Cancels the effects of a previous L.DomUtil.disableTextSelection .
+
+
+ disableImageDrag ()
+
+ As L.DomUtil.disableTextSelection , but
+for dragstart DOM events, usually generated when the user drags an image.
+
+
+ enableImageDrag ()
+
+ Cancels the effects of a previous L.DomUtil.disableImageDrag .
+
+
+ preventOutline (<HTMLElement> el )
+
+ Makes the outline
+of the element el invisible. Used internally by Leaflet to prevent
+focusable elements from displaying an outline when the user performs a
+drag interaction on them.
+
+
+ restoreOutline ()
+
+ Cancels the effects of a previous L.DomUtil.preventOutline .
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ TRANSFORM
+ String
+ Vendor-prefixed transform style name (e.g. 'webkitTransform' for WebKit).
+
+
+ TRANSITION
+ String
+ Vendor-prefixed transition style name.
+
+
+ TRANSITION_END
+ String
+ Vendor-prefixed transitionend event name.
+
+
+
+
+
+
+ PosAnimation Used internally for panning animations, utilizing CSS3 Transitions for modern browsers and a timer fallback for IE6-9.
+
+
+Usage example
+
+
+
+
+
+
+
+var fx = new L.PosAnimation();
+fx.run(el, [300, 500], 0.5);
+
+
+
+
+
+
+
+
+Constructor
+
+
+
+
+
+
+
+
+ Constructor
+ Description
+
+
+
+ L.PosAnimation ()
+ Creates a PosAnimation object.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ start
+ Event
+ Fired when the animation starts
+
+
+ step
+ Event
+ Fired continuously during the animation.
+
+
+ end
+ Event
+ Fired when the animation ends.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ run (<HTMLElement> el , <Point > newPos , <Number> duration? , <Number> easeLinearity? )
+
+ Run an animation of a given element to a new position, optionally setting
+duration in seconds (0.25 by default) and easing linearity factor (3rd
+argument of the cubic bezier curve ,
+0.5 by default).
+
+
+
+ stop ()
+
+ Stops the animation (if currently running).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Draggable A class for making DOM elements draggable (including touch support).
+Used internally for map and marker dragging. Only works for elements
+that were positioned with L.DomUtil.setPosition .
+
+
+Usage example
+
+
+
+
+
+
+
+var draggable = new L.Draggable(elementToDrag);
+draggable.enable();
+
+
+
+
+
+
+
+
+Constructor
+
+
+
+
+
+
+
+
+ Constructor
+ Description
+
+
+
+ L.Draggable (<HTMLElement> el , <HTMLElement> dragHandle? , <Boolean> preventOutline? , <Draggable options > options? )
+ Creates a Draggable object for moving el when you start dragging the dragHandle element (equals el itself by default).
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ clickTolerance
+ Number
+ 3
+ The max number of pixels a user can shift the mouse pointer during a click
+for it to be considered a valid click (as opposed to a mouse drag).
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ down
+ Event
+ Fired when a drag is about to start.
+
+
+ dragstart
+ Event
+ Fired when a drag starts
+
+
+ predrag
+ Event
+ Fired continuously during dragging before each corresponding
+update of the element's position.
+
+
+ drag
+ Event
+ Fired continuously during dragging.
+
+
+ dragend
+ DragEndEvent
+ Fired when the drag ends.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ enable ()
+
+ Enables the dragging ability
+
+
+
+ disable ()
+
+ Disables the dragging ability
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Class L.Class powers the OOP facilities of Leaflet and is used to create almost all of the Leaflet classes documented here.
+In addition to implementing a simple classical inheritance model, it introduces several special properties for convenient code organization — options, includes and statics.
+
+
+Usage example
+
+
+
+
+
+
+
+var MyClass = L.Class.extend({
+initialize: function (greeter) {
+ this.greeter = greeter;
+ // class constructor
+},
+greet: function (name) {
+ alert(this.greeter + ', ' + name)
+ }
+});
+// create instance of MyClass, passing "Hello" to the constructor
+var a = new MyClass("Hello");
+// call greet method, alerting "Hello, World"
+a.greet("World");
+
+
+
+
+
+
+Class Factories
+
+
+
+You may have noticed that Leaflet objects are created without using
+the new keyword. This is achieved by complementing each class with a
+lowercase factory method:
+new L.Map('map'); // becomes:
+L.map('map');
+
+The factories are implemented very easily, and you can do this for your own classes:
+L.map = function (id, options) {
+ return new L.Map(id, options);
+};
+
+
+
+
+
+
+Inheritance
+
+
+
+You use L.Class.extend to define new classes, but you can use the same method on any class to inherit from it:
+var MyChildClass = MyClass.extend({
+ // ... new properties and methods
+});
+
+This will create a class that inherits all methods and properties of the parent class (through a proper prototype chain), adding or overriding the ones you pass to extend. It will also properly react to instanceof:
+var a = new MyChildClass();
+a instanceof MyChildClass; // true
+a instanceof MyClass; // true
+
+You can call parent methods (including constructor) from corresponding child ones (as you do with super calls in other languages) by accessing parent class prototype and using JavaScript's call or apply:
+var MyChildClass = MyClass.extend({
+ initialize: function () {
+ MyClass.prototype.initialize.call(this, "Yo");
+ },
+ greet: function (name) {
+ MyClass.prototype.greet.call(this, 'bro ' + name + '!');
+ }
+});
+var a = new MyChildClass();
+a.greet('Jason'); // alerts "Yo, bro Jason!"
+
+
+
+
+
+Options
+
+
+
+options is a special property that unlike other objects that you pass
+to extend will be merged with the parent one instead of overriding it
+completely, which makes managing configuration of objects and default
+values convenient:
+var MyClass = L.Class.extend({
+ options: {
+ myOption1: 'foo',
+ myOption2: 'bar'
+ }
+});
+var MyChildClass = MyClass.extend({
+ options: {
+ myOption1: 'baz',
+ myOption3: 5
+ }
+});
+var a = new MyChildClass();
+a.options.myOption1; // 'baz'
+a.options.myOption2; // 'bar'
+a.options.myOption3; // 5
+
+There's also L.Util.setOptions , a method for
+conveniently merging options passed to constructor with the defaults
+defines in the class:
+var MyClass = L.Class.extend({
+ options: {
+ foo: 'bar',
+ bla: 5
+ },
+ initialize: function (options) {
+ L.Util.setOptions(this, options);
+ ...
+ }
+});
+var a = new MyClass({bla: 10});
+a.options; // {foo: 'bar', bla: 10}
+
+
+
+
+
+
+Includes
+
+
+
+includes is a special class property that merges all specified objects into the class (such objects are called mixins).
+ var MyMixin = {
+ foo: function () { ... },
+ bar: 5
+};
+var MyClass = L.Class.extend({
+ includes: MyMixin
+});
+var a = new MyClass();
+a.foo();
+
+You can also do such includes in runtime with the include method:
+MyClass.include(MyMixin);
+
+statics is just a convenience property that injects specified object properties as the static properties of the class, useful for defining constants:
+var MyClass = L.Class.extend({
+ statics: {
+ FOO: 'bar',
+ BLA: 5
+ }
+});
+MyClass.FOO; // 'bar'
+
+
+
+
+
+
+Constructor hooks
+
+
+
+If you're a plugin developer, you often need to add additional initialization code to existing classes (e.g. editing hooks for L.Polyline ). Leaflet comes with a way to do it easily using the addInitHook method:
+MyClass.addInitHook(function () {
+ // ... do something in constructor additionally
+ // e.g. add event listeners, set custom properties etc.
+});
+
+You can also use the following shortcut when you just need to make one additional method call:
+MyClass.addInitHook('methodName', arg1, arg2, …);
+
+
+
+
+
+
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ extend (<Object> props )
+ Function
+ Extends the current class given the properties to be included.
+Returns a Javascript function that is a class constructor (to be called with new).
+
+
+ include (<Object> properties )
+ this
+ Includes a mixin into the current class.
+
+
+ mergeOptions (<Object> options )
+ this
+ Merges options into the defaults of the class.
+
+
+ addInitHook (<Function> fn )
+ this
+ Adds a constructor hook to the class.
+
+
+
+
+
+
+ Evented A set of methods shared between event-powered classes (like Map and Marker ). Generally, events allow you to execute some function when something happens with an object (e.g. the user clicks on the map, causing the map to fire 'click' event).
+
+
+Usage example
+
+
+
+
+
+
+
+map.on('click', function(e) {
+ alert(e.latlng);
+} );
+
+Leaflet deals with event listeners by reference, so if you want to add a listener and then remove it, define it as a function:
+function onClick(e) { ... }
+map.on('click', onClick);
+map.off('click', onClick);
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+ Layer A set of methods from the Layer base class that all Leaflet layers use.
+Inherits all methods, options and events from L.Evented .
+
+
+Usage example
+
+
+
+
+
+
+
+var layer = L.Marker(latlng).addTo(map);
+layer.addTo(map);
+layer.remove();
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ onAdd (<Map > map )
+ this
+ Should contain code that creates DOM elements for the layer, adds them to map panes where they should belong and puts listeners on relevant map events. Called on map.addLayer(layer) .
+
+
+
+ onRemove (<Map > map )
+ this
+ Should contain all clean up code that removes the layer's elements from the DOM and removes listeners previously added in onAdd . Called on map.removeLayer(layer) .
+
+
+
+ getEvents ()
+ Object
+ This optional method should return an object like { viewreset: this._reset } for addEventListener . The event handlers in this object will be automatically added and removed from the map with your layer.
+
+
+
+ getAttribution ()
+ String
+ This optional method should return a string containing HTML to be shown on the Attribution control whenever the layer is visible.
+
+
+
+ beforeAdd (<Map > map )
+ this
+ Optional method. Called on map.addLayer(layer) , before the layer is added to the map, before events are initialized, without waiting until the map is in a usable state. Use for early initialization only.
+
+
+
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Interactive layer Some Layer s can be made interactive - when the user interacts
+with such a layer, mouse events like click and mouseover can be handled.
+Use the event handling methods to handle these events.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this layer will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+Mouse events
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Control L.Control is a base class for implementing map controls. Handles positioning.
+All other controls extend from this class.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ onAdd (<Map > map )
+ HTMLElement
+ Should return the container DOM element for the control and add listeners on relevant map events. Called on control.addTo(map) .
+
+
+
+ onRemove (<Map > map )
+
+ Optional method. Should contain all clean up code that removes the listeners previously added in onAdd . Called on control.remove() .
+
+
+
+
+
+
+
+ Handler Abstract class for map interaction handlers
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ enable ()
+ this
+ Enables the handler
+
+
+
+ disable ()
+ this
+ Disables the handler
+
+
+
+ enabled ()
+ Boolean
+ Returns true if the handler is enabled
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addHooks ()
+
+ Called when the handler is enabled, should add event hooks.
+
+
+
+ removeHooks ()
+
+ Called when the handler is disabled, should remove the event hooks added previously.
+
+
+
+
+
+
+
+ Projection An object with methods for projecting geographical coordinates of the world onto
+a flat surface (and back). See Map projection .
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ project (<LatLng > latlng )
+ Point
+ Projects geographical coordinates into a 2D point.
+Only accepts actual L.LatLng instances, not arrays.
+
+
+
+ unproject (<Point > point )
+ LatLng
+ The inverse of project. Projects a 2D point into a geographical location.
+Only accepts actual L.Point instances, not arrays.
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ bounds
+ Bounds
+ The bounds (specified in CRS units) where the projection is valid
+
+
+
+
+
+
+
+Defined projections
+
+
+
+
+
+
+
+
+
+ Projection
+ Description
+
+
+
+ L.Projection.LonLat
+ Equirectangular, or Plate Carree projection — the most simple projection,
+mostly used by GIS enthusiasts. Directly maps x as longitude, and y as
+latitude. Also suitable for flat worlds, e.g. game maps. Used by the
+EPSG:4326 and Simple CRS.
+
+
+ L.Projection.Mercator
+ Elliptical Mercator projection — more complex than Spherical Mercator. Takes into account that Earth is a geoid, not a perfect sphere. Used by the EPSG:3395 CRS.
+
+
+ L.Projection.SphericalMercator
+ Spherical Mercator projection — the most common projection for online maps,
+used by almost all free and commercial tile providers. Assumes that Earth is
+a sphere. Used by the EPSG:3857 CRS.
+
+
+
+
+
+
+ CRS
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ latLngToPoint (<LatLng > latlng , <Number> zoom )
+ Point
+ Projects geographical coordinates into pixel coordinates for a given zoom.
+
+
+
+ pointToLatLng (<Point > point , <Number> zoom )
+ LatLng
+ The inverse of latLngToPoint. Projects pixel coordinates on a given
+zoom into geographical coordinates.
+
+
+
+ project (<LatLng > latlng )
+ Point
+ Projects geographical coordinates into coordinates in units accepted for
+this CRS (e.g. meters for EPSG:3857, for passing it to WMS services).
+
+
+
+ unproject (<Point > point )
+ LatLng
+ Given a projected coordinate returns the corresponding LatLng.
+The inverse of project.
+
+
+
+ scale (<Number> zoom )
+ Number
+ Returns the scale used when transforming projected coordinates into
+pixel coordinates for a particular zoom. For example, it returns
+256 * 2^zoom for Mercator-based CRS.
+
+
+
+ zoom (<Number> scale )
+ Number
+ Inverse of scale(), returns the zoom level corresponding to a scale
+factor of scale.
+
+
+
+ getProjectedBounds (<Number> zoom )
+ Bounds
+ Returns the projection's bounds scaled and transformed for the provided zoom.
+
+
+
+ distance (<LatLng > latlng1 , <LatLng > latlng2 )
+ Number
+ Returns the distance between two geographical coordinates.
+
+
+
+ wrapLatLng (<LatLng > latlng )
+ LatLng
+ Returns a LatLng where lat and lng has been wrapped according to the
+CRS's wrapLat and wrapLng properties, if they are outside the CRS's bounds.
+
+
+
+ wrapLatLngBounds (<LatLngBounds > bounds )
+ LatLngBounds
+ Returns a LatLngBounds with the same size as the given one, ensuring
+that its center is within the CRS's bounds.
+Only accepts actual L.LatLngBounds instances, not arrays.
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ code
+ String
+ Standard code name of the CRS passed into WMS services (e.g. 'EPSG:3857')
+
+
+ wrapLng
+ Number[]
+ An array of two numbers defining whether the longitude (horizontal) coordinate
+axis wraps around a given range and how. Defaults to [-180, 180] in most
+geographical CRSs. If undefined, the longitude axis does not wrap around.
+
+
+ wrapLat
+ Number[]
+ Like wrapLng, but for the latitude (vertical) axis.
+
+
+ infinite
+ Boolean
+ If true, the coordinate space will be unbounded (infinite in both axes)
+
+
+
+
+
+
+
+Defined CRSs
+
+
+
+
+
+
+
+
+ CRS
+ Description
+
+
+
+ L.CRS.EPSG3395
+ Rarely used by some commercial tile providers. Uses Elliptical Mercator projection.
+
+
+ L.CRS.EPSG3857
+ The most common CRS for online maps, used by almost all free and commercial
+tile providers. Uses Spherical Mercator projection. Set in by default in
+Map's crs option.
+
+
+ L.CRS.EPSG4326
+ A common CRS among GIS enthusiasts. Uses simple Equirectangular projection.
+Leaflet 1.0.x complies with the TMS coordinate scheme for EPSG:4326 ,
+which is a breaking change from 0.7.x behaviour. If you are using a TileLayer
+with this CRS, ensure that there are two 256x256 pixel tiles covering the
+whole earth at zoom level zero, and that the tile coordinate origin is (-180,+90),
+or (-180,-90) for TileLayers with the tms option set.
+
+
+ L.CRS.Earth
+ Serves as the base for CRS that are global such that they cover the earth.
+Can only be used as the base for other CRS and cannot be used directly,
+since it does not have a code, projection or transformation . distance() returns
+meters.
+
+
+ L.CRS.Simple
+ A simple CRS that maps longitude and latitude into x and y directly.
+May be used for maps of flat surfaces (e.g. game maps). Note that the y
+axis should still be inverted (going from bottom to top). distance() returns
+simple euclidean distance.
+
+
+ L.CRS.Base
+ Object that defines coordinate reference systems for projecting
+geographical points into pixel (screen) coordinates and back (and to
+coordinates in other units for WMS services). See
+spatial reference system .
+Leaflet defines the most usual CRSs by default. If you want to use a
+CRS not defined by default, take a look at the
+Proj4Leaflet plugin.
+
+
+
+
+
+
+ Renderer Base class for vector renderer implementations (SVG , Canvas ). Handles the
+DOM container of the renderer, its bounds, and its zoom animation.
+A Renderer works as an implicit layer group for all Path s - the renderer
+itself can be added or removed to the map. All paths use a renderer, which can
+be implicit (the map will decide the type of renderer and use it automatically)
+or explicit (using the renderer option of the path).
+Do not use this class directly, use SVG and Canvas instead.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ padding
+ Number
+ 0.1
+ How much to extend the clip area around the map view (relative to its size)
+e.g. 0.1 would be 10% of map view in each direction
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ update
+ Event
+ Fired when the renderer updates its bounds, center and zoom, for example when
+its map has moved
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Event objects Whenever a class inheriting from Evented fires an event, a listener function
+will be called with an event argument, which is a plain object containing
+information about the event. For example:
+
map.on('click', function(ev) {
+ alert(ev.latlng); // ev is an event object (MouseEvent in this case)
+});
+
+
The information available depends on the event type:
+
+
+
+
+Event
+
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+KeyboardEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ originalEvent
+ DOMEvent
+ The original DOM KeyboardEvent that triggered this Leaflet event.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+MouseEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ latlng
+ LatLng
+ The geographical point where the mouse event occurred.
+
+
+ layerPoint
+ Point
+ Pixel coordinates of the point where the mouse event occurred relative to the map layer.
+
+
+ containerPoint
+ Point
+ Pixel coordinates of the point where the mouse event occurred relative to the map сontainer.
+
+
+ originalEvent
+ DOMEvent
+ The original DOM MouseEvent or DOM TouchEvent that triggered this Leaflet event.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+LocationEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ latlng
+ LatLng
+ Detected geographical location of the user.
+
+
+ bounds
+ LatLngBounds
+ Geographical bounds of the area user is located in (with respect to the accuracy of location).
+
+
+ accuracy
+ Number
+ Accuracy of location in meters.
+
+
+ altitude
+ Number
+ Height of the position above the WGS84 ellipsoid in meters.
+
+
+ altitudeAccuracy
+ Number
+ Accuracy of altitude in meters.
+
+
+ heading
+ Number
+ The direction of travel in degrees counting clockwise from true North.
+
+
+ speed
+ Number
+ Current velocity in meters per second.
+
+
+ timestamp
+ Number
+ The time when the position was acquired.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+ErrorEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ message
+ String
+ Error message.
+
+
+ code
+ Number
+ Error code (if applicable).
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+LayerEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ layer
+ Layer
+ The layer that was added or removed.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+LayersControlEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ layer
+ Layer
+ The layer that was added or removed.
+
+
+ name
+ String
+ The name of the layer that was added or removed.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+TileEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ tile
+ HTMLElement
+ The tile element (image).
+
+
+ coords
+ Point
+ Point object with the tile's x, y, and z (zoom level) coordinates.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+TileErrorEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ tile
+ HTMLElement
+ The tile element (image).
+
+
+ coords
+ Point
+ Point object with the tile's x, y, and z (zoom level) coordinates.
+
+
+ error
+ *
+ Error passed to the tile's done() callback.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+ResizeEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ oldSize
+ Point
+ The old size before resize event.
+
+
+ newSize
+ Point
+ The new size after the resize event.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+GeoJSONEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ layer
+ Layer
+ The layer for the GeoJSON feature that is being added to the map.
+
+
+ properties
+ Object
+ GeoJSON properties of the feature.
+
+
+ geometryType
+ String
+ GeoJSON geometry type of the feature.
+
+
+ id
+ String
+ GeoJSON ID of the feature (if present).
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ tooltip
+ Tooltip
+ The tooltip that was opened or closed.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+DragEndEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ distance
+ Number
+ The distance in pixels the draggable element was moved by.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+
+
+
+ZoomAnimEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ center
+ LatLng
+ The current center of the map
+
+
+ zoom
+ Number
+ The current zoom level of the map
+
+
+ noUpdate
+ Boolean
+ Whether layers should update their contents due to this event
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event.
+
+
+
+
+
+
+
+ DivOverlay Base model for L.Popup and L.Tooltip. Inherit from it for custom popup like plugins.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ offset
+ Point
+ Point(0, 7)
+ The offset of the popup position. Useful to control the anchor
+of the popup when opening it on some overlays.
+
+
+ className
+ String
+ ''
+ A custom CSS class name to assign to the popup.
+
+
+ pane
+ String
+ 'popupPane'
+ Map pane where the popup will be added.
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Global Switches Global switches are created for rare cases and generally make
+Leaflet to not detect a particular browser feature even if it's
+there. You need to set the switch as a global variable to true
+before including Leaflet on the page, like this:
+
<script>L_NO_TOUCH = true;</script>
+<script src="leaflet.js"></script>
+
+
+
+
+Switch
+Description
+
+
+
+
+L_NO_TOUCH
+Forces Leaflet to not use touch events even if it detects them.
+
+
+L_DISABLE_3D
+Forces Leaflet to not use hardware-accelerated CSS 3D transforms for positioning (which may cause glitches in some rare environments) even if they're supported.
+
+
+
+
+
noConflict This method restores the L global variable to the original value
+it had before Leaflet inclusion, and returns the real Leaflet
+namespace so you can put it elsewhere, like this:
+
<script src='libs/l.js'>
+<!-- L points to some other library -->
+<script src='leaflet.js'>
+<!-- you include Leaflet, it replaces the L variable to Leaflet namespace -->
+<script>
+var Leaflet = L.noConflict();
+// now L points to that other library again, and you can use Leaflet.Map etc.
+</script>
+
+
+
version A constant that represents the Leaflet version in use.
+
L.version; // contains "1.0.0" (or whatever version is currently in use)
+
diff --git a/src/public/Leaflet-1.7.1/docs/reference-1.3.4.html b/src/public/Leaflet-1.7.1/docs/reference-1.3.4.html
new file mode 100644
index 0000000..a4f7dff
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/reference-1.3.4.html
@@ -0,0 +1,23970 @@
+---
+layout: v2
+title: Documentation
+bodyclass: api-page
+---
+
+
Leaflet API reference
+
+
This reference reflects Leaflet 1.3.4 . Check this list if you are using a different version of Leaflet.
+
+
+
+
Map
+
+
Map Methods
+
+
Map Misc
+
+
+
+
UI Layers
+
+
Raster Layers
+
+
Vector Layers
+
+
+
+
Other Layers
+
+
Basic Types
+
+
Controls
+
+
+
+
+
+
+
+
+
+
Utility
+
+
DOM Utility
+
+
+
+
Base Classes
+
+
+
Misc
+
+
+
+
+
Map The central class of the API — it is used to create a map on a page and manipulate it.
+
+
+Usage example
+
+
+
+
+
+
+
+// initialize the map on the "map" div with a given center and zoom
+var map = L.map('map', {
+ center: [51.505, -0.09],
+ zoom: 13
+});
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.map (<String> id , <Map options> options? )
+ Instantiates a map object given the DOM ID of a <div> element
+and optionally an object literal with Map options.
+
+
+ L.map (<HTMLElement> el , <Map options> options? )
+ Instantiates a map object given an instance of a <div> HTML element
+and optionally an object literal with Map options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ preferCanvas
+ Boolean
+ false
+ Whether Path s should be rendered on a Canvas renderer.
+By default, all Paths are rendered in a SVG renderer.
+
+
+
+
+
+Control options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attributionControl
+ Boolean
+ true
+ Whether a attribution control is added to the map by default.
+
+
+ zoomControl
+ Boolean
+ true
+ Whether a zoom control is added to the map by default.
+
+
+
+
+
+Interaction Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+
+ boxZoom
+ Boolean
+ true
+ Whether the map can be zoomed to a rectangular area specified by
+dragging the mouse while pressing the shift key.
+
+
+ doubleClickZoom
+ Boolean|String
+ true
+ Whether the map can be zoomed in by double clicking on it and
+zoomed out by double clicking while holding shift. If passed
+'center', double-click zoom will zoom to the center of the
+ view regardless of where the mouse was.
+
+
+ dragging
+ Boolean
+ true
+ Whether the map be draggable with mouse/touch or not.
+
+
+ zoomSnap
+ Number
+ 1
+ Forces the map's zoom level to always be a multiple of this, particularly
+right after a fitBounds() or a pinch-zoom.
+By default, the zoom level snaps to the nearest integer; lower values
+(e.g. 0.5 or 0.1) allow for greater granularity. A value of 0
+means the zoom level will not be snapped after fitBounds or a pinch-zoom.
+
+
+ zoomDelta
+ Number
+ 1
+ Controls how much the map's zoom level will change after a
+zoomIn() , zoomOut() , pressing +
+or - on the keyboard, or using the zoom controls .
+Values smaller than 1 (e.g. 0.5) allow for greater granularity.
+
+
+ trackResize
+ Boolean
+ true
+ Whether the map automatically handles browser window resize to update itself.
+
+
+
+
+
+Panning Inertia Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ inertia
+ Boolean
+ *
+ If enabled, panning of the map will have an inertia effect where
+the map builds momentum while dragging and continues moving in
+the same direction for some time. Feels especially nice on touch
+devices. Enabled by default unless running on old Android devices.
+
+
+ inertiaDeceleration
+ Number
+ 3000
+ The rate with which the inertial movement slows down, in pixels/second².
+
+
+ inertiaMaxSpeed
+ Number
+ Infinity
+ Max speed of the inertial movement, in pixels/second.
+
+
+ easeLinearity
+ Number
+ 0.2
+
+
+
+ worldCopyJump
+ Boolean
+ false
+ With this option enabled, the map tracks when you pan to another "copy"
+of the world and seamlessly jumps to the original one so that all overlays
+like markers and vector layers are still visible.
+
+
+ maxBoundsViscosity
+ Number
+ 0.0
+ If maxBounds is set, this option will control how solid the bounds
+are when dragging the map around. The default value of 0.0 allows the
+user to drag outside the bounds at normal speed, higher values will
+slow down map dragging outside bounds, and 1.0 makes the bounds fully
+solid, preventing the user from dragging outside the bounds.
+
+
+
+
+
+Keyboard Navigation Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ keyboard
+ Boolean
+ true
+ Makes the map focusable and allows users to navigate the map with keyboard
+arrows and +/- keys.
+
+
+ keyboardPanDelta
+ Number
+ 80
+ Amount of pixels to pan when pressing an arrow key.
+
+
+
+
+
+Mousewheel options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ scrollWheelZoom
+ Boolean|String
+ true
+ Whether the map can be zoomed by using the mouse wheel. If passed 'center',
+it will zoom to the center of the view regardless of where the mouse was.
+
+
+ wheelDebounceTime
+ Number
+ 40
+ Limits the rate at which a wheel can fire (in milliseconds). By default
+user can't zoom via wheel more often than once per 40 ms.
+
+
+ wheelPxPerZoomLevel
+ Number
+ 60
+ How many scroll pixels (as reported by L.DomEvent.getWheelDelta )
+mean a change of one full zoom level. Smaller values will make wheel-zooming
+faster (and vice versa).
+
+
+
+
+
+Touch interaction options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ tap
+ Boolean
+ true
+ Enables mobile hacks for supporting instant taps (fixing 200ms click
+delay on iOS/Android) and touch holds (fired as contextmenu events).
+
+
+ tapTolerance
+ Number
+ 15
+ The max number of pixels a user can shift his finger during touch
+for it to be considered a valid tap.
+
+
+ touchZoom
+ Boolean|String
+ *
+ Whether the map can be zoomed by touch-dragging with two fingers. If
+passed 'center', it will zoom to the center of the view regardless of
+where the touch events (fingers) were. Enabled for touch-capable web
+browsers except for old Androids.
+
+
+ bounceAtZoomLimits
+ Boolean
+ true
+ Set it to false if you don't want the map to zoom beyond min/max zoom
+and then bounce back when pinch-zooming.
+
+
+
+
+
+Map State Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ crs
+ CRS
+ L.CRS.EPSG3857
+ The Coordinate Reference System to use. Don't change this if you're not
+sure what it means.
+
+
+ center
+ LatLng
+ undefined
+ Initial geographic center of the map
+
+
+ zoom
+ Number
+ undefined
+ Initial map zoom level
+
+
+ minZoom
+ Number
+ *
+ Minimum zoom level of the map.
+If not specified and at least one GridLayer or TileLayer is in the map,
+the lowest of their minZoom options will be used instead.
+
+
+ maxZoom
+ Number
+ *
+ Maximum zoom level of the map.
+If not specified and at least one GridLayer or TileLayer is in the map,
+the highest of their maxZoom options will be used instead.
+
+
+ layers
+ Layer[]
+ []
+ Array of layers that will be added to the map initially
+
+
+ maxBounds
+ LatLngBounds
+ null
+ When this option is set, the map restricts the view to the given
+geographical bounds, bouncing the user back if the user tries to pan
+outside the view. To set the restriction dynamically, use
+setMaxBounds method.
+
+
+ renderer
+ Renderer
+ *
+ The default method for drawing vector layers on the map. L.SVG
+or L.Canvas by default depending on browser support.
+
+
+
+
+
+Animation Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ zoomAnimation
+ Boolean
+ true
+ Whether the map zoom animation is enabled. By default it's enabled
+in all browsers that support CSS3 Transitions except Android.
+
+
+ zoomAnimationThreshold
+ Number
+ 4
+ Won't animate zoom if the zoom difference exceeds this value.
+
+
+ fadeAnimation
+ Boolean
+ true
+ Whether the tile fade animation is enabled. By default it's enabled
+in all browsers that support CSS3 Transitions except Android.
+
+
+ markerZoomAnimation
+ Boolean
+ true
+ Whether markers animate their zoom with the zoom animation, if disabled
+they will disappear for the length of the animation. By default it's
+enabled in all browsers that support CSS3 Transitions except Android.
+
+
+ transform3DLimit
+ Number
+ 2^23
+ Defines the maximum size of a CSS translation transform. The default
+value should not be changed unless a web browser positions layers in
+the wrong place after doing a large panBy.
+
+
+
+
+
+
+
+Events
+
+
+
+Layer events
+
+
+
+
+
+
+Map state change events
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ zoomlevelschange
+ Event
+ Fired when the number of zoomlevels on the map is changed due
+to adding or removing a layer.
+
+
+ resize
+ ResizeEvent
+ Fired when the map is resized.
+
+
+ unload
+ Event
+ Fired when the map is destroyed with remove method.
+
+
+ viewreset
+ Event
+ Fired when the map needs to redraw its content (this usually happens
+on map zoom or load). Very useful for creating custom overlays.
+
+
+ load
+ Event
+ Fired when the map is initialized (when its center and zoom are set
+for the first time).
+
+
+ zoomstart
+ Event
+ Fired when the map zoom is about to change (e.g. before zoom animation).
+
+
+ movestart
+ Event
+ Fired when the view of the map starts changing (e.g. user starts dragging the map).
+
+
+ zoom
+ Event
+ Fired repeatedly during any change in zoom level, including zoom
+and fly animations.
+
+
+ move
+ Event
+ Fired repeatedly during any movement of the map, including pan and
+fly animations.
+
+
+ zoomend
+ Event
+ Fired when the map has changed, after any animations.
+
+
+ moveend
+ Event
+ Fired when the center of the map stops changing (e.g. user stopped
+dragging the map).
+
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+ autopanstart
+ Event
+ Fired when the map starts autopanning when opening a popup.
+
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip is opened in the map.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip in the map is closed.
+
+
+
+
+
+Location events
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ locationerror
+ ErrorEvent
+ Fired when geolocation (using the locate method) failed.
+
+
+ locationfound
+ LocationEvent
+ Fired when geolocation (using the locate method)
+went successfully.
+
+
+
+
+
+Interaction events
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the map.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the map.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the map.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button on the map.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the map.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the map.
+
+
+ mousemove
+ MouseEvent
+ Fired while the mouse moves over the map.
+
+
+
+ keypress
+ KeyboardEvent
+ Fired when the user presses a key from the keyboard while the map is focused.
+
+
+ preclick
+ MouseEvent
+ Fired before mouse click on the map (sometimes useful when you
+want something to happen on click before any existing click
+handlers start running).
+
+
+
+
+
+Other Methods
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ zoomanim
+ ZoomAnimEvent
+ Fired on every frame of a zoom animation
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getRenderer (<Path > layer )
+ Renderer
+ Returns the instance of Renderer that should be used to render the given
+Path . It will ensure that the renderer options of the map and paths
+are respected, and that the renderers do exist on the map.
+
+
+
+
+
+
+Methods for Layers and Controls
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addControl (<Control > control )
+ this
+ Adds the given control to the map
+
+
+
+ removeControl (<Control > control )
+ this
+ Removes the given control from the map
+
+
+
+ addLayer (<Layer > layer )
+ this
+ Adds the given layer to the map
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Removes the given layer from the map.
+
+
+
+ hasLayer (<Layer > layer )
+ Boolean
+ Returns true if the given layer is currently added to the map
+
+
+
+ eachLayer (<Function> fn , <Object> context? )
+ this
+ Iterates over the layers of the map, optionally specifying context of the iterator function.
+map.eachLayer(function(layer){
+ layer.bindPopup('Hello');
+});
+
+
+
+
+
+
+ openTooltip (<Tooltip > tooltip )
+ this
+ Opens the specified tooltip.
+
+
+
+ openTooltip (<String|HTMLElement> content , <LatLng > latlng , <Tooltip options > options? )
+ this
+ Creates a tooltip with the specified content and options and open it.
+
+
+
+ closeTooltip (<Tooltip > tooltip? )
+ this
+ Closes the tooltip given as parameter.
+
+
+
+
+
+
+Methods for modifying map state
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setView (<LatLng > center , <Number> zoom , <Zoom/pan options > options? )
+ this
+ Sets the view of the map (geographical center and zoom) with the given
+animation options.
+
+
+
+ setZoom (<Number> zoom , <Zoom/pan options > options? )
+ this
+ Sets the zoom of the map.
+
+
+
+ zoomIn (<Number> delta? , <Zoom options > options? )
+ this
+ Increases the zoom of the map by delta (zoomDelta by default).
+
+
+
+ zoomOut (<Number> delta? , <Zoom options > options? )
+ this
+ Decreases the zoom of the map by delta (zoomDelta by default).
+
+
+
+ setZoomAround (<LatLng > latlng , <Number> zoom , <Zoom options > options )
+ this
+ Zooms the map while keeping a specified geographical point on the map
+stationary (e.g. used internally for scroll zoom and double-click zoom).
+
+
+
+ setZoomAround (<Point > offset , <Number> zoom , <Zoom options > options )
+ this
+ Zooms the map while keeping a specified pixel on the map (relative to the top-left corner) stationary.
+
+
+
+ fitBounds (<LatLngBounds > bounds , <fitBounds options > options? )
+ this
+ Sets a map view that contains the given geographical bounds with the
+maximum zoom level possible.
+
+
+
+ fitWorld (<fitBounds options > options? )
+ this
+ Sets a map view that mostly contains the whole world with the maximum
+zoom level possible.
+
+
+
+ panTo (<LatLng > latlng , <Pan options > options? )
+ this
+ Pans the map to a given center.
+
+
+
+ panBy (<Point > offset , <Pan options > options? )
+ this
+ Pans the map by a given number of pixels (animated).
+
+
+
+ flyTo (<LatLng > latlng , <Number> zoom? , <Zoom/pan options > options? )
+ this
+ Sets the view of the map (geographical center and zoom) performing a smooth
+pan-zoom animation.
+
+
+
+ flyToBounds (<LatLngBounds > bounds , <fitBounds options > options? )
+ this
+ Sets the view of the map with a smooth animation like flyTo ,
+but takes a bounds parameter like fitBounds .
+
+
+
+ setMaxBounds (<Bounds > bounds )
+ this
+ Restricts the map view to the given bounds (see the maxBounds option).
+
+
+
+ setMinZoom (<Number> zoom )
+ this
+ Sets the lower limit for the available zoom levels (see the minZoom option).
+
+
+
+ setMaxZoom (<Number> zoom )
+ this
+ Sets the upper limit for the available zoom levels (see the maxZoom option).
+
+
+
+ panInsideBounds (<LatLngBounds > bounds , <Pan options > options? )
+ this
+ Pans the map to the closest view that would lie inside the given bounds (if it's not already), controlling the animation using the options specific, if any.
+
+
+
+ invalidateSize (<Zoom/pan options > options )
+ this
+ Checks if the map container size changed and updates the map if so —
+call it after you've changed the map size dynamically, also animating
+pan by default. If options.pan is false, panning will not occur.
+If options.debounceMoveend is true, it will delay moveend event so
+that it doesn't happen often even if the method is called many
+times in a row.
+
+
+
+ invalidateSize (<Boolean> animate )
+ this
+ Checks if the map container size changed and updates the map if so —
+call it after you've changed the map size dynamically, also animating
+pan by default.
+
+
+
+ stop ()
+ this
+ Stops the currently running panTo or flyTo animation, if any.
+
+
+
+
+
+
+Geolocation methods
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ locate (<Locate options > options? )
+ this
+ Tries to locate the user using the Geolocation API, firing a locationfound
+event with location data on success or a locationerror event on failure,
+and optionally sets the map view to the user's location with respect to
+detection accuracy (or to the world view if geolocation failed).
+Note that, if your page doesn't use HTTPS, this method will fail in
+modern browsers (Chrome 50 and newer )
+See Locate options for more details.
+
+
+
+ stopLocate ()
+ this
+ Stops watching location previously initiated by map.locate({watch: true})
+and aborts resetting the map view if map.locate was called with
+{setView: true}.
+
+
+
+
+
+
+Other Methods
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addHandler (<String> name , <Function> HandlerClass )
+ this
+ Adds a new Handler to the map, given its name and constructor function.
+
+
+
+ remove ()
+ this
+ Destroys the map and clears all related event listeners.
+
+
+
+ createPane (<String> name , <HTMLElement> container? )
+ HTMLElement
+ Creates a new map pane with the given name if it doesn't exist already,
+then returns it. The pane is created as a child of container, or
+as a child of the main map pane if not set.
+
+
+
+ getPane (<String|HTMLElement> pane )
+ HTMLElement
+ Returns a map pane , given its name or its HTML element (its identity).
+
+
+
+ getPanes ()
+ Object
+ Returns a plain object containing the names of all panes as keys and
+the panes as values.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTML element that contains the map.
+
+
+
+ whenReady (<Function> fn , <Object> context? )
+ this
+ Runs the given function fn when the map gets initialized with
+a view (center and zoom) and at least one layer, or immediately
+if it's already initialized, optionally passing a function context.
+
+
+
+
+
+
+Methods for Getting Map State
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getCenter ()
+ LatLng
+ Returns the geographical center of the map view
+
+
+
+ getZoom ()
+ Number
+ Returns the current zoom level of the map view
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the geographical bounds visible in the current map view
+
+
+
+ getMinZoom ()
+ Number
+ Returns the minimum zoom level of the map (if set in the minZoom option of the map or of any layers), or 0 by default.
+
+
+
+ getMaxZoom ()
+ Number
+ Returns the maximum zoom level of the map (if set in the maxZoom option of the map or of any layers).
+
+
+
+ getBoundsZoom (<LatLngBounds > bounds , <Boolean> inside? , <Point > padding? )
+ Number
+ Returns the maximum zoom level on which the given bounds fit to the map
+view in its entirety. If inside (optional) is set to true, the method
+instead returns the minimum zoom level on which the map view fits into
+the given bounds in its entirety.
+
+
+
+ getSize ()
+ Point
+ Returns the current size of the map container (in pixels).
+
+
+
+ getPixelBounds ()
+ Bounds
+ Returns the bounds of the current map view in projected pixel
+coordinates (sometimes useful in layer and overlay implementations).
+
+
+
+ getPixelOrigin ()
+ Point
+ Returns the projected pixel coordinates of the top left point of
+the map layer (useful in custom layer and overlay implementations).
+
+
+
+ getPixelWorldBounds (<Number> zoom? )
+ Bounds
+ Returns the world's bounds in pixel coordinates for zoom level zoom.
+If zoom is omitted, the map's current zoom level is used.
+
+
+
+
+
+
+Conversion Methods
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getZoomScale (<Number> toZoom , <Number> fromZoom )
+ Number
+ Returns the scale factor to be applied to a map transition from zoom level
+fromZoom to toZoom. Used internally to help with zoom animations.
+
+
+
+ getScaleZoom (<Number> scale , <Number> fromZoom )
+ Number
+ Returns the zoom level that the map would end up at, if it is at fromZoom
+level and everything is scaled by a factor of scale. Inverse of
+getZoomScale .
+
+
+
+ project (<LatLng > latlng , <Number> zoom )
+ Point
+ Projects a geographical coordinate LatLng according to the projection
+of the map's CRS, then scales it according to zoom and the CRS's
+Transformation . The result is pixel coordinate relative to
+the CRS origin.
+
+
+
+ unproject (<Point > point , <Number> zoom )
+ LatLng
+ Inverse of project .
+
+
+
+ layerPointToLatLng (<Point > point )
+ LatLng
+ Given a pixel coordinate relative to the origin pixel ,
+returns the corresponding geographical coordinate (for the current zoom level).
+
+
+
+ latLngToLayerPoint (<LatLng > latlng )
+ Point
+ Given a geographical coordinate, returns the corresponding pixel coordinate
+relative to the origin pixel .
+
+
+
+ wrapLatLng (<LatLng > latlng )
+ LatLng
+ Returns a LatLng where lat and lng has been wrapped according to the
+map's CRS's wrapLat and wrapLng properties, if they are outside the
+CRS's bounds.
+By default this means longitude is wrapped around the dateline so its
+value is between -180 and +180 degrees.
+
+
+
+ wrapLatLngBounds (<LatLngBounds > bounds )
+ LatLngBounds
+ Returns a LatLngBounds with the same size as the given one, ensuring that
+its center is within the CRS's bounds.
+By default this means the center longitude is wrapped around the dateline so its
+value is between -180 and +180 degrees, and the majority of the bounds
+overlaps the CRS's bounds.
+
+
+
+ distance (<LatLng > latlng1 , <LatLng > latlng2 )
+ Number
+ Returns the distance between two geographical coordinates according to
+the map's CRS. By default this measures distance in meters.
+
+
+
+ containerPointToLayerPoint (<Point > point )
+ Point
+ Given a pixel coordinate relative to the map container, returns the corresponding
+pixel coordinate relative to the origin pixel .
+
+
+
+ layerPointToContainerPoint (<Point > point )
+ Point
+ Given a pixel coordinate relative to the origin pixel ,
+returns the corresponding pixel coordinate relative to the map container.
+
+
+
+ containerPointToLatLng (<Point > point )
+ LatLng
+ Given a pixel coordinate relative to the map container, returns
+the corresponding geographical coordinate (for the current zoom level).
+
+
+
+ latLngToContainerPoint (<LatLng > latlng )
+ Point
+ Given a geographical coordinate, returns the corresponding pixel coordinate
+relative to the map container.
+
+
+
+ mouseEventToContainerPoint (<MouseEvent > ev )
+ Point
+ Given a MouseEvent object, returns the pixel coordinate relative to the
+map container where the event took place.
+
+
+
+ mouseEventToLayerPoint (<MouseEvent > ev )
+ Point
+ Given a MouseEvent object, returns the pixel coordinate relative to
+the origin pixel where the event took place.
+
+
+
+ mouseEventToLatLng (<MouseEvent > ev )
+ LatLng
+ Given a MouseEvent object, returns geographical coordinate where the
+event took place.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+
+Properties
+
+
+
+Controls
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ zoomControl
+ Control.Zoom
+ The default zoom control (only available if the
+zoomControl option was true when creating the map).
+
+
+
+
+
+Handlers
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ boxZoom
+ Handler
+ Box (shift-drag with mouse) zoom handler.
+
+
+ doubleClickZoom
+ Handler
+ Double click zoom handler.
+
+
+ dragging
+ Handler
+ Map dragging handler (by both mouse and touch).
+
+
+ keyboard
+ Handler
+ Keyboard navigation handler.
+
+
+ scrollWheelZoom
+ Handler
+ Scroll wheel zoom handler.
+
+
+ tap
+ Handler
+ Mobile touch hacks (quick tap and touch hold) handler.
+
+
+ touchZoom
+ Handler
+ Touch zoom handler.
+
+
+
+
+
+
+
+Map panes
+
+
+
+
+
+
+
+
+
+ Pane
+ Type
+ Z-index
+ Description
+
+
+
+ mapPane
+ HTMLElement
+ 'auto'
+ Pane that contains all other map panes
+
+
+ tilePane
+ HTMLElement
+ 200
+ Pane for GridLayer s and TileLayer s
+
+
+ overlayPane
+ HTMLElement
+ 400
+ Pane for vectors (Path s, like Polyline s and Polygon s), ImageOverlay s and VideoOverlay s
+
+
+ shadowPane
+ HTMLElement
+ 500
+ Pane for overlay shadows (e.g. Marker shadows)
+
+
+ markerPane
+ HTMLElement
+ 600
+ Pane for Icon s of Marker s
+
+
+ tooltipPane
+ HTMLElement
+ 650
+ Pane for Tooltip s.
+
+
+
+
+
+
+
+
+
+
+Locate options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ watch
+ Boolean
+ false
+ If true, starts continuous watching of location changes (instead of detecting it
+once) using W3C watchPosition method. You can later stop watching using
+map.stopLocate() method.
+
+
+ setView
+ Boolean
+ false
+ If true, automatically sets the map view to the user location with respect to
+detection accuracy, or to world view if geolocation failed.
+
+
+ maxZoom
+ Number
+ Infinity
+ The maximum zoom for automatic view setting when using setView option.
+
+
+ timeout
+ Number
+ 10000
+ Number of milliseconds to wait for a response from geolocation before firing a
+locationerror event.
+
+
+ maximumAge
+ Number
+ 0
+ Maximum age of detected location. If less than this amount of milliseconds
+passed since last geolocation response, locate will return a cached location.
+
+
+ enableHighAccuracy
+ Boolean
+ false
+ Enables high accuracy, see description in the W3C spec .
+
+
+
+
+
+
+
+
+
+Zoom options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ animate
+ Boolean
+
+ If not specified, zoom animation will happen if the zoom origin is inside the
+current view. If true, the map will attempt animating zoom disregarding where
+zoom origin is. Setting false will make it always reset the view completely
+without animation.
+
+
+
+
+
+
+
+
+
+Pan options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ animate
+ Boolean
+
+ If true, panning will always be animated if possible. If false, it will
+not animate panning, either resetting the map view if panning more than a
+screen away, or just setting a new offset for the map pane (except for panBy
+which always does the latter).
+
+
+ duration
+ Number
+ 0.25
+ Duration of animated panning, in seconds.
+
+
+ easeLinearity
+ Number
+ 0.25
+ The curvature factor of panning animation easing (third parameter of the
+Cubic Bezier curve ). 1.0 means linear animation,
+and the smaller this number, the more bowed the curve.
+
+
+ noMoveStart
+ Boolean
+ false
+ If true, panning won't fire movestart event on start (used internally for
+panning inertia).
+
+
+
+
+
+
+
+
+
+Zoom/pan options
+
+
+
+
+
+
▶ Options inherited from Zoom options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ animate
+ Boolean
+
+ If not specified, zoom animation will happen if the zoom origin is inside the
+current view. If true, the map will attempt animating zoom disregarding where
+zoom origin is. Setting false will make it always reset the view completely
+without animation.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Pan options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ duration
+ Number
+ 0.25
+ Duration of animated panning, in seconds.
+
+
+ easeLinearity
+ Number
+ 0.25
+ The curvature factor of panning animation easing (third parameter of the
+Cubic Bezier curve ). 1.0 means linear animation,
+and the smaller this number, the more bowed the curve.
+
+
+ noMoveStart
+ Boolean
+ false
+ If true, panning won't fire movestart event on start (used internally for
+panning inertia).
+
+
+
+
+
+
+
+
+
+
+FitBounds options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ paddingTopLeft
+ Point
+ [0, 0]
+ Sets the amount of padding in the top left corner of a map container that
+shouldn't be accounted for when setting the view to fit bounds. Useful if you
+have some control overlays on the map like a sidebar and you don't want them
+to obscure objects you're zooming to.
+
+
+ paddingBottomRight
+ Point
+ [0, 0]
+ The same for the bottom right corner of the map.
+
+
+ padding
+ Point
+ [0, 0]
+ Equivalent of setting both top left and bottom right padding to the same value.
+
+
+ maxZoom
+ Number
+ null
+ The maximum possible zoom to use.
+
+
+
+
+
+
+
+
▶ Options inherited from Zoom options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ animate
+ Boolean
+
+ If not specified, zoom animation will happen if the zoom origin is inside the
+current view. If true, the map will attempt animating zoom disregarding where
+zoom origin is. Setting false will make it always reset the view completely
+without animation.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Pan options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ duration
+ Number
+ 0.25
+ Duration of animated panning, in seconds.
+
+
+ easeLinearity
+ Number
+ 0.25
+ The curvature factor of panning animation easing (third parameter of the
+Cubic Bezier curve ). 1.0 means linear animation,
+and the smaller this number, the more bowed the curve.
+
+
+ noMoveStart
+ Boolean
+ false
+ If true, panning won't fire movestart event on start (used internally for
+panning inertia).
+
+
+
+
+
+
+
+ Marker L.Marker is used to display clickable/draggable icons on the map. Extends Layer .
+
+
+Usage example
+
+
+
+
+
+
+
+L.marker([50.5, 30.5]).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.marker (<LatLng > latlng , <Marker options > options? )
+ Instantiates a Marker object given a geographical point and optionally an options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ icon
+ Icon
+ *
+ Icon instance to use for rendering the marker.
+See Icon documentation for details on how to customize the marker icon.
+If not specified, a common instance of L.Icon.Default is used.
+
+
+ keyboard
+ Boolean
+ true
+ Whether the marker can be tabbed to with a keyboard and clicked by pressing enter.
+
+
+ title
+ String
+ ''
+ Text for the browser tooltip that appear on marker hover (no tooltip by default).
+
+
+ alt
+ String
+ ''
+ Text for the alt attribute of the icon image (useful for accessibility).
+
+
+ zIndexOffset
+ Number
+ 0
+ By default, marker images zIndex is set automatically based on its latitude. Use this option if you want to put the marker on top of all others (or below), specifying a high value like 1000 (or high negative value, respectively).
+
+
+ opacity
+ Number
+ 1.0
+ The opacity of the marker.
+
+
+ riseOnHover
+ Boolean
+ false
+ If true, the marker will get on top of others when you hover the mouse over it.
+
+
+ riseOffset
+ Number
+ 250
+ The z-index offset used for the riseOnHover feature.
+
+
+ pane
+ String
+ 'markerPane'
+ Map pane where the markers icon will be added.
+
+
+ bubblingMouseEvents
+ Boolean
+ false
+ When true, a mouse event on this marker will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+
+
+
+Draggable marker options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ draggable
+ Boolean
+ false
+ Whether the marker is draggable with mouse/touch or not.
+
+
+ autoPan
+ Boolean
+ false
+ Whether to pan the map when dragging this marker near its edge or not.
+
+
+ autoPanPadding
+ Point
+ Point(50, 50)
+ Distance (in pixels to the left/right and to the top/bottom) of the
+map edge to start panning the map.
+
+
+ autoPanSpeed
+ Number
+ 10
+ Number of pixels the map should pan by.
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ move
+ Event
+ Fired when the marker is moved via setLatLng or by dragging . Old and new coordinates are included in event arguments as oldLatLng, latlng .
+
+
+
+
+
+Dragging events
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ dragstart
+ Event
+ Fired when the user starts dragging the marker.
+
+
+ movestart
+ Event
+ Fired when the marker starts moving (because of dragging).
+
+
+ drag
+ Event
+ Fired repeatedly while the user drags the marker.
+
+
+ dragend
+ DragEndEvent
+ Fired when the user stops dragging the marker.
+
+
+ moveend
+ Event
+ Fired when the marker stops moving (because of dragging).
+
+
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the marker (as a GeoJSON Point Feature).
+
+
+
+ getLatLng ()
+ LatLng
+ Returns the current geographical position of the marker.
+
+
+
+ setLatLng (<LatLng > latlng )
+ this
+ Changes the marker position to the given point.
+
+
+
+ setZIndexOffset (<Number> offset )
+ this
+ Changes the zIndex offset of the marker.
+
+
+
+ setIcon (<Icon > icon )
+ this
+ Changes the marker icon.
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Changes the opacity of the marker.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+
+Properties
+
+
+
+Interaction handlers
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ dragging
+ Handler
+ Marker dragging handler (by both mouse and touch). Only valid when the marker is on the map (Otherwise set marker.options.draggable ).
+
+
+
+
+
+
+ Used to open popups in certain places of the map. Use Map.openPopup to
+open popups while making sure that only one popup is open at one time
+(recommended for usability), or use Map.addLayer to open as many as you want.
+
+
+
+
+
+
+
+
+
+
+If you want to just bind a popup to marker click and then open it, it's really easy:
+marker.bindPopup(popupContent).openPopup();
+
+Path overlays like polylines also have a bindPopup method.
+Here's a more complicated way to open a popup on a map:
+var popup = L.popup()
+ .setLatLng(latlng)
+ .setContent('<p>Hello world!<br />This is a nice popup.</p>')
+ .openOn(map);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Options inherited from DivOverlay
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Used to display small texts on top of map layers.
+
+
+
+
+
+
+
+
+
+
+marker.bindTooltip("my tooltip text").openTooltip();
+
+Note about tooltip offset. Leaflet takes two options in consideration
+for computing tooltip offsetting:
+
+the offset Tooltip option: it defaults to [0, 0], and it's specific to one tooltip.
+Add a positive x offset to move the tooltip to the right, and a positive y offset to
+move it to the bottom. Negatives will move to the left and top.
+the tooltipAnchor Icon option: this will only be considered for Marker. You
+should adapt this value if you use a custom icon.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.tooltip (<Tooltip options > options? , <Layer > source? )
+ Instantiates a Tooltip object given an optional options object that describes its appearance and location and an optional source object that is used to tag the tooltip with a reference to the Layer to which it refers.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'tooltipPane'
+ Map pane where the tooltip will be added.
+
+
+ offset
+ Point
+ Point(0, 0)
+ Optional offset of the tooltip position.
+
+
+ direction
+ String
+ 'auto'
+ Direction where to open the tooltip. Possible values are: right, left,
+top, bottom, center, auto.
+auto will dynamically switch between right and left according to the tooltip
+position on the map.
+
+
+ permanent
+ Boolean
+ false
+ Whether to open the tooltip permanently or only on mouseover.
+
+
+ sticky
+ Boolean
+ false
+ If true, the tooltip will follow the mouse instead of being fixed at the feature center.
+
+
+ interactive
+ Boolean
+ false
+ If true, the tooltip will listen to the feature events.
+
+
+ opacity
+ Number
+ 0.9
+ Tooltip container opacity.
+
+
+
+
+
+
+
+
▶ Options inherited from DivOverlay
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ className
+ String
+ ''
+ A custom CSS class name to assign to the popup.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ TileLayer Used to load and display tile layers on the map. Extends GridLayer .
+
+
+Usage example
+
+
+
+
+
+
+
+L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png?{foo}', {foo: 'bar'}).addTo(map);
+
+
+
+
+
+
+URL template
+
+
+
+A string of the following form:
+'http://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png'
+{s} means one of the available subdomains (used sequentially to help with browser parallel requests per domain limitation; subdomain values are specified in options; a, b or c by default, can be omitted), {z} — zoom level, {x} and {y} — tile coordinates. {r} can be used to add "@2x" to the URL to load retina tiles.
+You can use custom keys in the template, which will be evaluated from TileLayer options, like this:
+L.tileLayer('http://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png', {foo: 'bar'});
+
+
+
+
+
+
+
+Creation
+
+
+
+Extension methods
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.tilelayer (<String> urlTemplate , <TileLayer options > options? )
+ Instantiates a tile layer object given a URL template and optionally an options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ minZoom
+ Number
+ 0
+ The minimum zoom level down to which this layer will be displayed (inclusive).
+
+
+ maxZoom
+ Number
+ 18
+ The maximum zoom level up to which this layer will be displayed (inclusive).
+
+
+ subdomains
+ String|String[]
+ 'abc'
+ Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.
+
+
+ errorTileUrl
+ String
+ ''
+ URL to the tile image to show in place of the tile that failed to load.
+
+
+ zoomOffset
+ Number
+ 0
+ The zoom number used in tile URLs will be offset with this value.
+
+
+ tms
+ Boolean
+ false
+ If true, inverses Y axis numbering for tiles (turn this on for TMS services).
+
+
+ zoomReverse
+ Boolean
+ false
+ If set to true, the zoom number used in tile URLs will be reversed (maxZoom - zoom instead of zoom)
+
+
+ detectRetina
+ Boolean
+ false
+ If true and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.
+
+
+ crossOrigin
+ Boolean|String
+ false
+ Whether the crossOrigin attribute will be added to the tiles.
+If a String is provided, all tiles will have their crossOrigin attribute set to the String provided. This is needed if you want to access tile pixel data.
+Refer to CORS Settings for valid String values.
+
+
+
+
+
+
+
+
▶ Options inherited from GridLayer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ tileSize
+ Number|Point
+ 256
+ Width and height of tiles in the grid. Use a number if width and height are equal, or L.point(width, height) otherwise.
+
+
+ opacity
+ Number
+ 1.0
+ Opacity of the tiles. Can be used in the createTile() function.
+
+
+ updateWhenIdle
+ Boolean
+ (depends)
+ Load new tiles only when panning ends.
+true by default on mobile browsers, in order to avoid too many requests and keep smooth navigation.
+false otherwise in order to display new tiles during panning, since it is easy to pan outside the
+keepBuffer option in desktop browsers.
+
+
+ updateWhenZooming
+ Boolean
+ true
+ By default, a smooth zoom animation (during a touch zoom or a flyTo() ) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends.
+
+
+ updateInterval
+ Number
+ 200
+ Tiles will not update more than once every updateInterval milliseconds when panning.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the tile layer.
+
+
+ bounds
+ LatLngBounds
+ undefined
+ If set, tiles will only be loaded inside the set LatLngBounds .
+
+
+ maxNativeZoom
+ Number
+ undefined
+ Maximum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels higher than maxNativeZoom will be loaded
+from maxNativeZoom level and auto-scaled.
+
+
+ minNativeZoom
+ Number
+ undefined
+ Minimum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels lower than minNativeZoom will be loaded
+from minNativeZoom level and auto-scaled.
+
+
+ noWrap
+ Boolean
+ false
+ Whether the layer is wrapped around the antimeridian. If true, the
+GridLayer will only be displayed once at low zoom levels. Has no
+effect when the map CRS doesn't wrap around. Can be used
+in combination with bounds to prevent requesting
+tiles outside the CRS limits.
+
+
+ pane
+ String
+ 'tilePane'
+ Map pane where the grid layer will be added.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the tile layer. Empty by default.
+
+
+ keepBuffer
+ Number
+ 2
+ When panning the map, keep this many rows and columns of tiles before unloading them.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from GridLayer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ loading
+ Event
+ Fired when the grid layer starts loading tiles.
+
+
+ tileunload
+ TileEvent
+ Fired when a tile is removed (e.g. when a tile goes off the screen).
+
+
+ tileloadstart
+ TileEvent
+ Fired when a tile is requested and starts loading.
+
+
+ tileerror
+ TileErrorEvent
+ Fired when there is an error loading a tile.
+
+
+ tileload
+ TileEvent
+ Fired when a tile loads.
+
+
+ load
+ Event
+ Fired when the grid layer loaded all visible tiles.
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setUrl (<String> url , <Boolean> noRedraw? )
+ this
+ Updates the layer's URL template and redraws it (unless noRedraw is set to true).
+
+
+
+ createTile (<Object> coords , <Function> done? )
+ HTMLElement
+ Called only internally, overrides GridLayer's createTile()
+to return an <img> HTML element with the appropriate image URL given coords. The done
+callback is called when the tile has been loaded.
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getTileUrl (<Object> coords )
+ String
+ Called only internally, returns the URL for a tile given its coordinates.
+Classes extending TileLayer can override this function to provide custom tile URL naming schemes.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from GridLayer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bringToFront ()
+ this
+ Brings the tile layer to the top of all tile layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the tile layer to the bottom of all tile layers.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTML element that contains the tiles for this layer.
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Changes the opacity of the grid layer.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Changes the zIndex of the grid layer.
+
+
+
+ isLoading ()
+ Boolean
+ Returns true if any tile in the grid layer has not finished loading.
+
+
+
+ redraw ()
+ this
+ Causes the layer to clear all the tiles and request them again.
+
+
+
+ getTileSize ()
+ Point
+ Normalizes the tileSize option into a point. Used by the createTile() method.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ TileLayer.WMS Used to display WMS services as tile layers on the map. Extends TileLayer .
+
+
+Usage example
+
+
+
+
+
+
+
+var nexrad = L.tileLayer.wms("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi", {
+ layers: 'nexrad-n0r-900913',
+ format: 'image/png',
+ transparent: true,
+ attribution: "Weather data © 2012 IEM Nexrad"
+});
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.tileLayer.wms (<String> baseUrl , <TileLayer.WMS options > options )
+ Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ layers
+ String
+ ''
+ (required) Comma-separated list of WMS layers to show.
+
+
+ styles
+ String
+ ''
+ Comma-separated list of WMS styles.
+
+
+ format
+ String
+ 'image/jpeg'
+ WMS image format (use 'image/png' for layers with transparency).
+
+
+ transparent
+ Boolean
+ false
+ If true, the WMS service will return images with transparency.
+
+
+ version
+ String
+ '1.1.1'
+ Version of the WMS service to use
+
+
+ crs
+ CRS
+ null
+ Coordinate Reference System to use for the WMS requests, defaults to
+map CRS. Don't change this if you're not sure what it means.
+
+
+ uppercase
+ Boolean
+ false
+ If true, WMS request parameter keys will be uppercase.
+
+
+
+
+
+
+
+
▶ Options inherited from TileLayer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ minZoom
+ Number
+ 0
+ The minimum zoom level down to which this layer will be displayed (inclusive).
+
+
+ maxZoom
+ Number
+ 18
+ The maximum zoom level up to which this layer will be displayed (inclusive).
+
+
+ subdomains
+ String|String[]
+ 'abc'
+ Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.
+
+
+ errorTileUrl
+ String
+ ''
+ URL to the tile image to show in place of the tile that failed to load.
+
+
+ zoomOffset
+ Number
+ 0
+ The zoom number used in tile URLs will be offset with this value.
+
+
+ tms
+ Boolean
+ false
+ If true, inverses Y axis numbering for tiles (turn this on for TMS services).
+
+
+ zoomReverse
+ Boolean
+ false
+ If set to true, the zoom number used in tile URLs will be reversed (maxZoom - zoom instead of zoom)
+
+
+ detectRetina
+ Boolean
+ false
+ If true and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.
+
+
+ crossOrigin
+ Boolean|String
+ false
+ Whether the crossOrigin attribute will be added to the tiles.
+If a String is provided, all tiles will have their crossOrigin attribute set to the String provided. This is needed if you want to access tile pixel data.
+Refer to CORS Settings for valid String values.
+
+
+
+
+
+
+
+
+
▶ Options inherited from GridLayer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ tileSize
+ Number|Point
+ 256
+ Width and height of tiles in the grid. Use a number if width and height are equal, or L.point(width, height) otherwise.
+
+
+ opacity
+ Number
+ 1.0
+ Opacity of the tiles. Can be used in the createTile() function.
+
+
+ updateWhenIdle
+ Boolean
+ (depends)
+ Load new tiles only when panning ends.
+true by default on mobile browsers, in order to avoid too many requests and keep smooth navigation.
+false otherwise in order to display new tiles during panning, since it is easy to pan outside the
+keepBuffer option in desktop browsers.
+
+
+ updateWhenZooming
+ Boolean
+ true
+ By default, a smooth zoom animation (during a touch zoom or a flyTo() ) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends.
+
+
+ updateInterval
+ Number
+ 200
+ Tiles will not update more than once every updateInterval milliseconds when panning.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the tile layer.
+
+
+ bounds
+ LatLngBounds
+ undefined
+ If set, tiles will only be loaded inside the set LatLngBounds .
+
+
+ maxNativeZoom
+ Number
+ undefined
+ Maximum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels higher than maxNativeZoom will be loaded
+from maxNativeZoom level and auto-scaled.
+
+
+ minNativeZoom
+ Number
+ undefined
+ Minimum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels lower than minNativeZoom will be loaded
+from minNativeZoom level and auto-scaled.
+
+
+ noWrap
+ Boolean
+ false
+ Whether the layer is wrapped around the antimeridian. If true, the
+GridLayer will only be displayed once at low zoom levels. Has no
+effect when the map CRS doesn't wrap around. Can be used
+in combination with bounds to prevent requesting
+tiles outside the CRS limits.
+
+
+ pane
+ String
+ 'tilePane'
+ Map pane where the grid layer will be added.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the tile layer. Empty by default.
+
+
+ keepBuffer
+ Number
+ 2
+ When panning the map, keep this many rows and columns of tiles before unloading them.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from GridLayer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ loading
+ Event
+ Fired when the grid layer starts loading tiles.
+
+
+ tileunload
+ TileEvent
+ Fired when a tile is removed (e.g. when a tile goes off the screen).
+
+
+ tileloadstart
+ TileEvent
+ Fired when a tile is requested and starts loading.
+
+
+ tileerror
+ TileErrorEvent
+ Fired when there is an error loading a tile.
+
+
+ tileload
+ TileEvent
+ Fired when a tile loads.
+
+
+ load
+ Event
+ Fired when the grid layer loaded all visible tiles.
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setParams (<Object> params , <Boolean> noRedraw? )
+ this
+ Merges an object with the new parameters and re-requests tiles on the current screen (unless noRedraw was set to true).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from TileLayer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setUrl (<String> url , <Boolean> noRedraw? )
+ this
+ Updates the layer's URL template and redraws it (unless noRedraw is set to true).
+
+
+
+ createTile (<Object> coords , <Function> done? )
+ HTMLElement
+ Called only internally, overrides GridLayer's createTile()
+to return an <img> HTML element with the appropriate image URL given coords. The done
+callback is called when the tile has been loaded.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from GridLayer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bringToFront ()
+ this
+ Brings the tile layer to the top of all tile layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the tile layer to the bottom of all tile layers.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTML element that contains the tiles for this layer.
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Changes the opacity of the grid layer.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Changes the zIndex of the grid layer.
+
+
+
+ isLoading ()
+ Boolean
+ Returns true if any tile in the grid layer has not finished loading.
+
+
+
+ redraw ()
+ this
+ Causes the layer to clear all the tiles and request them again.
+
+
+
+ getTileSize ()
+ Point
+ Normalizes the tileSize option into a point. Used by the createTile() method.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ ImageOverlay Used to load and display a single image over specific bounds of the map. Extends Layer .
+
+
+Usage example
+
+
+
+
+
+
+
+var imageUrl = 'http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg',
+ imageBounds = [[40.712216, -74.22655], [40.773941, -74.12544]];
+L.imageOverlay(imageUrl, imageBounds).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.imageOverlay (<String> imageUrl , <LatLngBounds > bounds , <ImageOverlay options > options? )
+ Instantiates an image overlay object given the URL of the image and the
+geographical bounds it is tied to.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ opacity
+ Number
+ 1.0
+ The opacity of the image overlay.
+
+
+ alt
+ String
+ ''
+ Text for the alt attribute of the image (useful for accessibility).
+
+
+ interactive
+ Boolean
+ false
+ If true, the image overlay will emit mouse events when clicked or hovered.
+
+
+ crossOrigin
+ Boolean|String
+ false
+ Whether the crossOrigin attribute will be added to the image.
+If a String is provided, the image will have its crossOrigin attribute set to the String provided. This is needed if you want to access image pixel data.
+Refer to CORS Settings for valid String values.
+
+
+ errorOverlayUrl
+ String
+ ''
+ URL to the overlay image to show in place of the overlay that failed to load.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the overlay layer.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the image. Empty by default.
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this layer will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ load
+ Event
+ Fired when the ImageOverlay layer has loaded its image
+
+
+ error
+ Event
+ Fired when the ImageOverlay layer fails to load its image
+
+
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Sets the opacity of the overlay.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all overlays.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all overlays.
+
+
+
+ setUrl (<String> url )
+ this
+ Changes the URL of the image.
+
+
+
+ setBounds (<LatLngBounds > bounds )
+ this
+ Update the bounds that this ImageOverlay covers
+
+
+
+ setZIndex (<Number> value )
+ this
+ Changes the zIndex of the image overlay.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Get the bounds that this ImageOverlay covers
+
+
+
+ getElement ()
+ HTMLElement
+ Returns the instance of HTMLImageElement
+used by this overlay.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ VideoOverlay Used to load and display a video player over specific bounds of the map. Extends ImageOverlay .
+A video overlay uses the <video>
+HTML5 element.
+
+
+Usage example
+
+
+
+
+
+
+
+var videoUrl = 'https://www.mapbox.com/bites/00188/patricia_nasa.webm',
+ videoBounds = [[ 32, -130], [ 13, -100]];
+L.videoOverlay(videoUrl, videoBounds ).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.videoOverlay (<String|Array|HTMLVideoElement> video , <LatLngBounds > bounds , <VideoOverlay options > options? )
+ Instantiates an image overlay object given the URL of the video (or array of URLs, or even a video element) and the
+geographical bounds it is tied to.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ autoplay
+ Boolean
+ true
+ Whether the video starts playing automatically when loaded.
+
+
+ loop
+ Boolean
+ true
+ Whether the video will loop back to the beginning when played.
+
+
+
+
+
+
+
+
▶ Options inherited from ImageOverlay
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ opacity
+ Number
+ 1.0
+ The opacity of the image overlay.
+
+
+ alt
+ String
+ ''
+ Text for the alt attribute of the image (useful for accessibility).
+
+
+ interactive
+ Boolean
+ false
+ If true, the image overlay will emit mouse events when clicked or hovered.
+
+
+ crossOrigin
+ Boolean|String
+ false
+ Whether the crossOrigin attribute will be added to the image.
+If a String is provided, the image will have its crossOrigin attribute set to the String provided. This is needed if you want to access image pixel data.
+Refer to CORS Settings for valid String values.
+
+
+ errorOverlayUrl
+ String
+ ''
+ URL to the overlay image to show in place of the overlay that failed to load.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the overlay layer.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the image. Empty by default.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this layer will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ load
+ Event
+ Fired when the video has finished loading the first frame
+
+
+
+
+
+
+
+
▶ Events inherited from ImageOverlay
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ error
+ Event
+ Fired when the ImageOverlay layer fails to load its image
+
+
+
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getElement ()
+ HTMLVideoElement
+ Returns the instance of HTMLVideoElement
+used by this overlay.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from ImageOverlay
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Sets the opacity of the overlay.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all overlays.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all overlays.
+
+
+
+ setUrl (<String> url )
+ this
+ Changes the URL of the image.
+
+
+
+ setBounds (<LatLngBounds > bounds )
+ this
+ Update the bounds that this ImageOverlay covers
+
+
+
+ setZIndex (<Number> value )
+ this
+ Changes the zIndex of the image overlay.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Get the bounds that this ImageOverlay covers
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Path An abstract class that contains options and constants shared between vector
+overlays (Polygon, Polyline, Circle). Do not use it directly. Extends Layer .
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Polyline A class for drawing polyline overlays on a map. Extends Path .
+
+
+Usage example
+
+
+
+
+
+
+
+// create a red polyline from an array of LatLng points
+var latlngs = [
+ [45.51, -122.68],
+ [37.77, -122.43],
+ [34.04, -118.2]
+];
+var polyline = L.polyline(latlngs, {color: 'red'}).addTo(map);
+// zoom the map to the polyline
+map.fitBounds(polyline.getBounds());
+
+You can also pass a multi-dimensional array to represent a MultiPolyline shape:
+// create a red polyline from an array of arrays of LatLng points
+var latlngs = [
+ [[45.51, -122.68],
+ [37.77, -122.43],
+ [34.04, -118.2]],
+ [[40.78, -73.91],
+ [41.83, -87.62],
+ [32.76, -96.72]]
+];
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.polyline (<LatLng[]> latlngs , <Polyline options > options? )
+ Instantiates a polyline object given an array of geographical points and
+optionally an options object. You can create a Polyline object with
+multiple separate lines (MultiPolyline) by passing an array of arrays
+of geographic points.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ smoothFactor
+ Number
+ 1.0
+ How much to simplify the polyline on each zoom level. More means
+better performance and smoother look, and less means more accurate representation.
+
+
+ noClip
+ Boolean
+ false
+ Disable polyline clipping.
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the polyline (as a GeoJSON LineString or MultiLineString Feature).
+
+
+
+ getLatLngs ()
+ LatLng[]
+ Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.
+
+
+
+ setLatLngs (<LatLng[]> latlngs )
+ this
+ Replaces all the points in the polyline with the given array of geographical points.
+
+
+
+ isEmpty ()
+ Boolean
+ Returns true if the Polyline has no LatLngs.
+
+
+
+ closestLayerPoint (<Point > p )
+ Point
+ Returns the point closest to p on the Polyline.
+
+
+
+ getCenter ()
+ LatLng
+ Returns the center (centroid ) of the polyline.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the path.
+
+
+
+ addLatLng (<LatLng > latlng )
+ this
+ Adds a given point to the polyline. By default, adds to the first ring of
+the polyline in case of a multi-polyline, but can be overridden by passing
+a specific ring as a LatLng array (that you can earlier access with getLatLngs ).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Polygon A class for drawing polygon overlays on a map. Extends Polyline .
+Note that points you pass when creating a polygon shouldn't have an additional last point equal to the first one — it's better to filter out such points.
+
+
+Usage example
+
+
+
+
+
+
+
+// create a red polygon from an array of LatLng points
+var latlngs = [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]];
+var polygon = L.polygon(latlngs, {color: 'red'}).addTo(map);
+// zoom the map to the polygon
+map.fitBounds(polygon.getBounds());
+
+You can also pass an array of arrays of latlngs, with the first array representing the outer shape and the other arrays representing holes in the outer shape:
+var latlngs = [
+ [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring
+ [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole
+];
+
+Additionally, you can pass a multi-dimensional array to represent a MultiPolygon shape.
+var latlngs = [
+ [ // first polygon
+ [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring
+ [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole
+ ],
+ [ // second polygon
+ [[41, -111.03],[45, -111.04],[45, -104.05],[41, -104.05]]
+ ]
+];
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.polygon (<LatLng[]> latlngs , <Polyline options > options? )
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Polyline
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ smoothFactor
+ Number
+ 1.0
+ How much to simplify the polyline on each zoom level. More means
+better performance and smoother look, and less means more accurate representation.
+
+
+ noClip
+ Boolean
+ false
+ Disable polyline clipping.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the polygon (as a GeoJSON Polygon or MultiPolygon Feature).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Polyline
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getLatLngs ()
+ LatLng[]
+ Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.
+
+
+
+ setLatLngs (<LatLng[]> latlngs )
+ this
+ Replaces all the points in the polyline with the given array of geographical points.
+
+
+
+ isEmpty ()
+ Boolean
+ Returns true if the Polyline has no LatLngs.
+
+
+
+ closestLayerPoint (<Point > p )
+ Point
+ Returns the point closest to p on the Polyline.
+
+
+
+ getCenter ()
+ LatLng
+ Returns the center (centroid ) of the polyline.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the path.
+
+
+
+ addLatLng (<LatLng > latlng )
+ this
+ Adds a given point to the polyline. By default, adds to the first ring of
+the polyline in case of a multi-polyline, but can be overridden by passing
+a specific ring as a LatLng array (that you can earlier access with getLatLngs ).
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Rectangle A class for drawing rectangle overlays on a map. Extends Polygon .
+
+
+Usage example
+
+
+
+
+
+
+
+// define rectangle geographical bounds
+var bounds = [[54.559322, -5.767822], [56.1210604, -3.021240]];
+// create an orange rectangle
+L.rectangle(bounds, {color: "#ff7800", weight: 1}).addTo(map);
+// zoom the map to the rectangle bounds
+map.fitBounds(bounds);
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Polyline
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ smoothFactor
+ Number
+ 1.0
+ How much to simplify the polyline on each zoom level. More means
+better performance and smoother look, and less means more accurate representation.
+
+
+ noClip
+ Boolean
+ false
+ Disable polyline clipping.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setBounds (<LatLngBounds > latLngBounds )
+ this
+ Redraws the rectangle with the passed bounds.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Polygon
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the polygon (as a GeoJSON Polygon or MultiPolygon Feature).
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Polyline
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getLatLngs ()
+ LatLng[]
+ Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.
+
+
+
+ setLatLngs (<LatLng[]> latlngs )
+ this
+ Replaces all the points in the polyline with the given array of geographical points.
+
+
+
+ isEmpty ()
+ Boolean
+ Returns true if the Polyline has no LatLngs.
+
+
+
+ closestLayerPoint (<Point > p )
+ Point
+ Returns the point closest to p on the Polyline.
+
+
+
+ getCenter ()
+ LatLng
+ Returns the center (centroid ) of the polyline.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the path.
+
+
+
+ addLatLng (<LatLng > latlng )
+ this
+ Adds a given point to the polyline. By default, adds to the first ring of
+the polyline in case of a multi-polyline, but can be overridden by passing
+a specific ring as a LatLng array (that you can earlier access with getLatLngs ).
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Circle A class for drawing circle overlays on a map. Extends CircleMarker .
+It's an approximation and starts to diverge from a real circle closer to poles (due to projection distortion).
+
+
+Usage example
+
+
+
+
+
+
+
+L.circle([50.5, 30.5], {radius: 200}).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.circle (<LatLng > latlng , <Circle options > options? )
+ Instantiates a circle object given a geographical point, and an options object
+which contains the circle radius.
+
+
+ L.circle (<LatLng > latlng , <Number> radius , <Circle options > options? )
+ Obsolete way of instantiating a circle, for compatibility with 0.7.x code.
+Do not use in new applications or plugins.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ radius
+ Number
+
+ Radius of the circle, in meters.
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setRadius (<Number> radius )
+ this
+ Sets the radius of a circle. Units are in meters.
+
+
+
+ getRadius ()
+ Number
+ Returns the current radius of a circle. Units are in meters.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the path.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from CircleMarker
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the circle marker (as a GeoJSON Point Feature).
+
+
+
+ setLatLng (<LatLng > latLng )
+ this
+ Sets the position of a circle marker to a new location.
+
+
+
+ getLatLng ()
+ LatLng
+ Returns the current geographical position of the circle marker
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ CircleMarker A circle of a fixed size with radius specified in pixels. Extends Path .
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.circleMarker (<LatLng > latlng , <CircleMarker options > options? )
+ Instantiates a circle marker object given a geographical point, and an optional options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ radius
+ Number
+ 10
+ Radius of the circle marker, in pixels
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the circle marker (as a GeoJSON Point Feature).
+
+
+
+ setLatLng (<LatLng > latLng )
+ this
+ Sets the position of a circle marker to a new location.
+
+
+
+ getLatLng ()
+ LatLng
+ Returns the current geographical position of the circle marker
+
+
+
+ setRadius (<Number> radius )
+ this
+ Sets the radius of a circle marker. Units are in pixels.
+
+
+
+ getRadius ()
+ Number
+ Returns the current radius of the circle
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ SVG Allows vector layers to be displayed with SVG .
+Inherits Renderer .
+Due to technical limitations , SVG is not
+available in all web browsers, notably Android 2.x and 3.x.
+Although SVG is not available on IE7 and IE8, these browsers support
+VML
+(a now deprecated technology), and the SVG renderer will fall back to VML in
+this case.
+Although SVG is not available on IE7 and IE8, these browsers support VML , and the SVG renderer will fall back to VML in this case.
+VML was deprecated in 2012, which means VML functionality exists only for backwards compatibility
+with old versions of Internet Explorer.
+
+
+Usage example
+
+
+
+
+
+
+
+Use SVG by default for all paths in the map:
+var map = L.map('map', {
+ renderer: L.svg()
+});
+
+Use a SVG renderer with extra padding for specific vector geometries:
+var map = L.map('map');
+var myRenderer = L.svg({ padding: 0.5 });
+var line = L.polyline( coordinates, { renderer: myRenderer } );
+var circle = L.circle( center, { renderer: myRenderer } );
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.svg (<Renderer options > options? )
+ Creates a SVG renderer with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Renderer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ padding
+ Number
+ 0.1
+ How much to extend the clip area around the map view (relative to its size)
+e.g. 0.1 would be 10% of map view in each direction
+
+
+ tolerance
+ Number
+ 0
+ How much to extend click tolerance round a path/object on the map
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Renderer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ update
+ Event
+ Fired when the renderer updates its bounds, center and zoom, for example when
+its map has moved
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+
+Functions
+
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ create (<String> name )
+ SVGElement
+ Returns a instance of SVGElement ,
+corresponding to the class name passed. For example, using 'line' will return
+an instance of SVGLineElement .
+
+
+ pointsToPath (<Point[]> rings , <Boolean> closed )
+ String
+ Generates a SVG path string for multiple rings, with each ring turning
+into "M..L..L.." instructions
+
+
+
+
+
+
+ Canvas Allows vector layers to be displayed with <canvas> .
+Inherits Renderer .
+Due to technical limitations , Canvas is not
+available in all web browsers, notably IE8, and overlapping geometries might
+not display properly in some edge cases.
+
+
+Usage example
+
+
+
+
+
+
+
+Use Canvas by default for all paths in the map:
+var map = L.map('map', {
+ renderer: L.canvas()
+});
+
+Use a Canvas renderer with extra padding for specific vector geometries:
+var map = L.map('map');
+var myRenderer = L.canvas({ padding: 0.5 });
+var line = L.polyline( coordinates, { renderer: myRenderer } );
+var circle = L.circle( center, { renderer: myRenderer } );
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.canvas (<Renderer options > options? )
+ Creates a Canvas renderer with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Renderer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ padding
+ Number
+ 0.1
+ How much to extend the clip area around the map view (relative to its size)
+e.g. 0.1 would be 10% of map view in each direction
+
+
+ tolerance
+ Number
+ 0
+ How much to extend click tolerance round a path/object on the map
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Renderer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ update
+ Event
+ Fired when the renderer updates its bounds, center and zoom, for example when
+its map has moved
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ LayerGroup Used to group several layers and handle them as one. If you add it to the map,
+any layers added or removed from the group will be added/removed on the map as
+well. Extends Layer .
+
+
+Usage example
+
+
+
+
+
+
+
+L.layerGroup([marker1, marker2])
+ .addLayer(polyline)
+ .addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.layerGroup (<Layer[]> layers? , <Object> options? )
+ Create a layer group, optionally given an initial set of layers and an options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the layer group (as a GeoJSON FeatureCollection, GeometryCollection, or MultiPoint).
+
+
+
+ addLayer (<Layer > layer )
+ this
+ Adds the given layer to the group.
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Removes the given layer from the group.
+
+
+
+ removeLayer (<Number> id )
+ this
+ Removes the layer with the given internal ID from the group.
+
+
+
+ hasLayer (<Layer > layer )
+ Boolean
+ Returns true if the given layer is currently added to the group.
+
+
+
+ hasLayer (<Number> id )
+ Boolean
+ Returns true if the given internal ID is currently added to the group.
+
+
+
+ clearLayers ()
+ this
+ Removes all the layers from the group.
+
+
+
+ invoke (<String> methodName , … )
+ this
+ Calls methodName on every layer contained in this group, passing any
+additional parameters. Has no effect if the layers contained do not
+implement methodName.
+
+
+
+ eachLayer (<Function> fn , <Object> context? )
+ this
+ Iterates over the layers of the group, optionally specifying context of the iterator function.
+group.eachLayer(function (layer) {
+ layer.bindPopup('Hello');
+});
+
+
+
+
+ getLayer (<Number> id )
+ Layer
+ Returns the layer with the given internal ID.
+
+
+
+ getLayers ()
+ Layer[]
+ Returns an array of all the layers added to the group.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Calls setZIndex on every layer contained in this group, passing the z-index.
+
+
+
+ getLayerId (<Layer > layer )
+ Number
+ Returns the internal ID for a layer
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ FeatureGroup Extended LayerGroup that makes it easier to do the same thing to all its member layers:
+
+bindPopup binds a popup to all of the layers at once (likewise with bindTooltip )
+Events are propagated to the FeatureGroup , so if the group has an event
+handler, it will handle events from any of the layers. This includes mouse events
+and custom events.
+Has layeradd and layerremove events
+
+
+
+Usage example
+
+
+
+
+
+
+
+L.featureGroup([marker1, marker2, polyline])
+ .bindPopup('Hello world!')
+ .on('click', function() { alert('Clicked on a member of the group!'); })
+ .addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.featureGroup (<Layer[]> layers )
+ Create a feature group, optionally given an initial set of layers.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setStyle (<Path options > style )
+ this
+ Sets the given path options to each layer of the group that has a setStyle method.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer group to the top of all other layers
+
+
+
+ bringToBack ()
+ this
+ Brings the layer group to the back of all other layers
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from LayerGroup
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the layer group (as a GeoJSON FeatureCollection, GeometryCollection, or MultiPoint).
+
+
+
+ addLayer (<Layer > layer )
+ this
+ Adds the given layer to the group.
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Removes the given layer from the group.
+
+
+
+ removeLayer (<Number> id )
+ this
+ Removes the layer with the given internal ID from the group.
+
+
+
+ hasLayer (<Layer > layer )
+ Boolean
+ Returns true if the given layer is currently added to the group.
+
+
+
+ hasLayer (<Number> id )
+ Boolean
+ Returns true if the given internal ID is currently added to the group.
+
+
+
+ clearLayers ()
+ this
+ Removes all the layers from the group.
+
+
+
+ invoke (<String> methodName , … )
+ this
+ Calls methodName on every layer contained in this group, passing any
+additional parameters. Has no effect if the layers contained do not
+implement methodName.
+
+
+
+ eachLayer (<Function> fn , <Object> context? )
+ this
+ Iterates over the layers of the group, optionally specifying context of the iterator function.
+group.eachLayer(function (layer) {
+ layer.bindPopup('Hello');
+});
+
+
+
+
+ getLayer (<Number> id )
+ Layer
+ Returns the layer with the given internal ID.
+
+
+
+ getLayers ()
+ Layer[]
+ Returns an array of all the layers added to the group.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Calls setZIndex on every layer contained in this group, passing the z-index.
+
+
+
+ getLayerId (<Layer > layer )
+ Number
+ Returns the internal ID for a layer
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ GeoJSON Represents a GeoJSON object or an array of GeoJSON objects. Allows you to parse
+GeoJSON data and display it on the map. Extends FeatureGroup .
+
+
+Usage example
+
+
+
+
+
+
+
+L.geoJSON(data, {
+ style: function (feature) {
+ return {color: feature.properties.color};
+ }
+}).bindPopup(function (layer) {
+ return layer.feature.properties.description;
+}).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.geoJSON (<Object> geojson? , <GeoJSON options > options? )
+ Creates a GeoJSON layer. Optionally accepts an object in
+GeoJSON format to display on the map
+(you can alternatively add it later with addData method) and an options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pointToLayer
+ Function
+ *
+ A Function defining how GeoJSON points spawn Leaflet layers. It is internally
+called when data is added, passing the GeoJSON point feature and its LatLng .
+The default is to spawn a default Marker :
+function(geoJsonPoint, latlng) {
+ return L.marker(latlng);
+}
+
+
+
+ style
+ Function
+ *
+ A Function defining the Path options for styling GeoJSON lines and polygons,
+called internally when data is added.
+The default value is to not override any defaults:
+function (geoJsonFeature) {
+ return {}
+}
+
+
+
+ onEachFeature
+ Function
+ *
+ A Function that will be called once for each created Feature, after it has
+been created and styled. Useful for attaching events and popups to features.
+The default is to do nothing with the newly created layers:
+function (feature, layer) {}
+
+
+
+ filter
+ Function
+ *
+ A Function that will be used to decide whether to include a feature or not.
+The default is to include all features:
+function (geoJsonFeature) {
+ return true;
+}
+
+Note: dynamically changing the filter option will have effect only on newly
+added data. It will not re-evaluate already included features.
+
+
+ coordsToLatLng
+ Function
+ *
+ A Function that will be used for converting GeoJSON coordinates to LatLng s.
+The default is the coordsToLatLng static method.
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addData (data )
+ this
+ Adds a GeoJSON object to the layer.
+
+
+
+ resetStyle (layer )
+ this
+ Resets the given vector layer's style to the original GeoJSON style, useful for resetting style after hover events.
+
+
+
+ setStyle (style )
+ this
+ Changes styles of GeoJSON vector layers with the given style function.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from FeatureGroup
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bringToFront ()
+ this
+ Brings the layer group to the top of all other layers
+
+
+
+ bringToBack ()
+ this
+ Brings the layer group to the back of all other layers
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from LayerGroup
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON ()
+ Object
+ Returns a GeoJSON representation of the layer group (as a GeoJSON FeatureCollection, GeometryCollection, or MultiPoint).
+
+
+
+ addLayer (<Layer > layer )
+ this
+ Adds the given layer to the group.
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Removes the given layer from the group.
+
+
+
+ removeLayer (<Number> id )
+ this
+ Removes the layer with the given internal ID from the group.
+
+
+
+ hasLayer (<Layer > layer )
+ Boolean
+ Returns true if the given layer is currently added to the group.
+
+
+
+ hasLayer (<Number> id )
+ Boolean
+ Returns true if the given internal ID is currently added to the group.
+
+
+
+ clearLayers ()
+ this
+ Removes all the layers from the group.
+
+
+
+ invoke (<String> methodName , … )
+ this
+ Calls methodName on every layer contained in this group, passing any
+additional parameters. Has no effect if the layers contained do not
+implement methodName.
+
+
+
+ eachLayer (<Function> fn , <Object> context? )
+ this
+ Iterates over the layers of the group, optionally specifying context of the iterator function.
+group.eachLayer(function (layer) {
+ layer.bindPopup('Hello');
+});
+
+
+
+
+ getLayer (<Number> id )
+ Layer
+ Returns the layer with the given internal ID.
+
+
+
+ getLayers ()
+ Layer[]
+ Returns an array of all the layers added to the group.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Calls setZIndex on every layer contained in this group, passing the z-index.
+
+
+
+ getLayerId (<Layer > layer )
+ Number
+ Returns the internal ID for a layer
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+
+Functions
+
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ geometryToLayer (<Object> featureData , <GeoJSON options > options? )
+ Layer
+ Creates a Layer from a given GeoJSON feature. Can use a custom
+pointToLayer and/or coordsToLatLng
+functions if provided as options.
+
+
+ coordsToLatLng (<Array> coords )
+ LatLng
+ Creates a LatLng object from an array of 2 numbers (longitude, latitude)
+or 3 numbers (longitude, latitude, altitude) used in GeoJSON for points.
+
+
+ coordsToLatLngs (<Array> coords , <Number> levelsDeep? , <Function> coordsToLatLng? )
+ Array
+ Creates a multidimensional array of LatLng s from a GeoJSON coordinates array.
+levelsDeep specifies the nesting level (0 is for an array of points, 1 for an array of arrays of points, etc., 0 by default).
+Can use a custom coordsToLatLng function.
+
+
+ latLngToCoords (<LatLng > latlng , <Number> precision? )
+ Array
+ Reverse of coordsToLatLng
+
+
+ latLngsToCoords (<Array> latlngs , <Number> levelsDeep? , <Boolean> closed? )
+ Array
+ Reverse of coordsToLatLngs
+closed determines whether the first point should be appended to the end of the array to close the feature, only used when levelsDeep is 0. False by default.
+
+
+ asFeature (<Object> geojson )
+ Object
+ Normalize GeoJSON geometries/features into GeoJSON features.
+
+
+
+
+
+
+ GridLayer Generic class for handling a tiled grid of HTML elements. This is the base class for all tile layers and replaces TileLayer.Canvas.
+GridLayer can be extended to create a tiled grid of HTML elements like <canvas>, <img> or <div>. GridLayer will handle creating and animating these DOM elements for you.
+
+
+Usage example
+
+
+
+Synchronous usage
+
+
+
+To create a custom layer, extend GridLayer and implement the createTile() method, which will be passed a Point object with the x, y, and z (zoom level) coordinates to draw your tile.
+var CanvasLayer = L.GridLayer.extend({
+ createTile: function(coords){
+ // create a <canvas> element for drawing
+ var tile = L.DomUtil.create('canvas', 'leaflet-tile');
+ // setup tile width and height according to the options
+ var size = this.getTileSize();
+ tile.width = size.x;
+ tile.height = size.y;
+ // get a canvas context and draw something on it using coords.x, coords.y and coords.z
+ var ctx = tile.getContext('2d');
+ // return the tile so it can be rendered on screen
+ return tile;
+ }
+});
+
+
+
+
+
+
+Asynchronous usage
+
+
+
+Tile creation can also be asynchronous, this is useful when using a third-party drawing library. Once the tile is finished drawing it can be passed to the done() callback.
+var CanvasLayer = L.GridLayer.extend({
+ createTile: function(coords, done){
+ var error;
+ // create a <canvas> element for drawing
+ var tile = L.DomUtil.create('canvas', 'leaflet-tile');
+ // setup tile width and height according to the options
+ var size = this.getTileSize();
+ tile.width = size.x;
+ tile.height = size.y;
+ // draw something asynchronously and pass the tile to the done() callback
+ setTimeout(function() {
+ done(error, tile);
+ }, 1000);
+ return tile;
+ }
+});
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.gridLayer (<GridLayer options > options? )
+ Creates a new instance of GridLayer with the supplied options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ tileSize
+ Number|Point
+ 256
+ Width and height of tiles in the grid. Use a number if width and height are equal, or L.point(width, height) otherwise.
+
+
+ opacity
+ Number
+ 1.0
+ Opacity of the tiles. Can be used in the createTile() function.
+
+
+ updateWhenIdle
+ Boolean
+ (depends)
+ Load new tiles only when panning ends.
+true by default on mobile browsers, in order to avoid too many requests and keep smooth navigation.
+false otherwise in order to display new tiles during panning, since it is easy to pan outside the
+keepBuffer option in desktop browsers.
+
+
+ updateWhenZooming
+ Boolean
+ true
+ By default, a smooth zoom animation (during a touch zoom or a flyTo() ) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends.
+
+
+ updateInterval
+ Number
+ 200
+ Tiles will not update more than once every updateInterval milliseconds when panning.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the tile layer.
+
+
+ bounds
+ LatLngBounds
+ undefined
+ If set, tiles will only be loaded inside the set LatLngBounds .
+
+
+ minZoom
+ Number
+ 0
+ The minimum zoom level down to which this layer will be displayed (inclusive).
+
+
+ maxZoom
+ Number
+ undefined
+ The maximum zoom level up to which this layer will be displayed (inclusive).
+
+
+ maxNativeZoom
+ Number
+ undefined
+ Maximum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels higher than maxNativeZoom will be loaded
+from maxNativeZoom level and auto-scaled.
+
+
+ minNativeZoom
+ Number
+ undefined
+ Minimum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels lower than minNativeZoom will be loaded
+from minNativeZoom level and auto-scaled.
+
+
+ noWrap
+ Boolean
+ false
+ Whether the layer is wrapped around the antimeridian. If true, the
+GridLayer will only be displayed once at low zoom levels. Has no
+effect when the map CRS doesn't wrap around. Can be used
+in combination with bounds to prevent requesting
+tiles outside the CRS limits.
+
+
+ pane
+ String
+ 'tilePane'
+ Map pane where the grid layer will be added.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the tile layer. Empty by default.
+
+
+ keepBuffer
+ Number
+ 2
+ When panning the map, keep this many rows and columns of tiles before unloading them.
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ loading
+ Event
+ Fired when the grid layer starts loading tiles.
+
+
+ tileunload
+ TileEvent
+ Fired when a tile is removed (e.g. when a tile goes off the screen).
+
+
+ tileloadstart
+ TileEvent
+ Fired when a tile is requested and starts loading.
+
+
+ tileerror
+ TileErrorEvent
+ Fired when there is an error loading a tile.
+
+
+ tileload
+ TileEvent
+ Fired when a tile loads.
+
+
+ load
+ Event
+ Fired when the grid layer loaded all visible tiles.
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bringToFront ()
+ this
+ Brings the tile layer to the top of all tile layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the tile layer to the bottom of all tile layers.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTML element that contains the tiles for this layer.
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Changes the opacity of the grid layer.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Changes the zIndex of the grid layer.
+
+
+
+ isLoading ()
+ Boolean
+ Returns true if any tile in the grid layer has not finished loading.
+
+
+
+ redraw ()
+ this
+ Causes the layer to clear all the tiles and request them again.
+
+
+
+ getTileSize ()
+ Point
+ Normalizes the tileSize option into a point. Used by the createTile() method.
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ createTile (<Object> coords , <Function> done? )
+ HTMLElement
+ Called only internally, must be overridden by classes extending GridLayer .
+Returns the HTMLElement corresponding to the given coords. If the done callback
+is specified, it must be called when the tile has finished loading and drawing.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ LatLng Represents a geographical point with a certain latitude and longitude.
+
+
+Usage example
+
+
+
+
+
+
+
+var latlng = L.latLng(50.5, 30.5);
+All Leaflet methods that accept LatLng objects also accept them in a simple Array form and simple object form (unless noted otherwise), so these lines are equivalent:
+map.panTo([50, 30]);
+map.panTo({lon: 30, lat: 50});
+map.panTo({lat: 50, lng: 30});
+map.panTo(L.latLng(50, 30));
+Note that LatLng does not inherit from Leaflet's Class object,
+which means new classes can't inherit from it, and new methods
+can't be added to it with the include function.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.latLng (<Number> latitude , <Number> longitude , <Number> altitude? )
+ Creates an object representing a geographical point with the given latitude and longitude (and optionally altitude).
+
+
+ L.latLng (<Array> coords )
+ Expects an array of the form [Number, Number] or [Number, Number, Number] instead.
+
+
+ L.latLng (<Object> coords )
+ Expects an plain object of the form {lat: Number, lng: Number} or {lat: Number, lng: Number, alt: Number} instead.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ equals (<LatLng > otherLatLng , <Number> maxMargin? )
+ Boolean
+ Returns true if the given LatLng point is at the same position (within a small margin of error). The margin of error can be overridden by setting maxMargin to a small number.
+
+
+
+ toString ()
+ String
+ Returns a string representation of the point (for debugging purposes).
+
+
+
+ distanceTo (<LatLng > otherLatLng )
+ Number
+ Returns the distance (in meters) to the given LatLng calculated using the Spherical Law of Cosines .
+
+
+
+ wrap ()
+ LatLng
+ Returns a new LatLng object with the longitude wrapped so it's always between -180 and +180 degrees.
+
+
+
+ toBounds (<Number> sizeInMeters )
+ LatLngBounds
+ Returns a new LatLngBounds object in which each boundary is sizeInMeters/2 meters apart from the LatLng .
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ lat
+ Number
+ Latitude in degrees
+
+
+ lng
+ Number
+ Longitude in degrees
+
+
+ alt
+ Number
+ Altitude in meters (optional)
+
+
+
+
+
+
+ LatLngBounds Represents a rectangular geographical area on a map.
+
+
+Usage example
+
+
+
+
+
+
+
+var corner1 = L.latLng(40.712, -74.227),
+corner2 = L.latLng(40.774, -74.125),
+bounds = L.latLngBounds(corner1, corner2);
+
+All Leaflet methods that accept LatLngBounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:
+map.fitBounds([
+ [40.712, -74.227],
+ [40.774, -74.125]
+]);
+
+Caution: if the area crosses the antimeridian (often confused with the International Date Line), you must specify corners outside the [-180, 180] degrees longitude range.
+Note that LatLngBounds does not inherit from Leaflet's Class object,
+which means new classes can't inherit from it, and new methods
+can't be added to it with the include function.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.latLngBounds (<LatLng > corner1 , <LatLng > corner2 )
+ Creates a LatLngBounds object by defining two diagonally opposite corners of the rectangle.
+
+
+ L.latLngBounds (<LatLng[]> latlngs )
+ Creates a LatLngBounds object defined by the geographical points it contains. Very useful for zooming the map to fit a particular set of locations with fitBounds .
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ extend (<LatLng > latlng )
+ this
+ Extend the bounds to contain the given point
+
+
+
+ extend (<LatLngBounds > otherBounds )
+ this
+ Extend the bounds to contain the given bounds
+
+
+
+ pad (<Number> bufferRatio )
+ LatLngBounds
+ Returns bounds created by extending or retracting the current bounds by a given ratio in each direction.
+For example, a ratio of 0.5 extends the bounds by 50% in each direction.
+Negative values will retract the bounds.
+
+
+
+ getCenter ()
+ LatLng
+ Returns the center point of the bounds.
+
+
+
+ getSouthWest ()
+ LatLng
+ Returns the south-west point of the bounds.
+
+
+
+ getNorthEast ()
+ LatLng
+ Returns the north-east point of the bounds.
+
+
+
+ getNorthWest ()
+ LatLng
+ Returns the north-west point of the bounds.
+
+
+
+ getSouthEast ()
+ LatLng
+ Returns the south-east point of the bounds.
+
+
+
+ getWest ()
+ Number
+ Returns the west longitude of the bounds
+
+
+
+ getSouth ()
+ Number
+ Returns the south latitude of the bounds
+
+
+
+ getEast ()
+ Number
+ Returns the east longitude of the bounds
+
+
+
+ getNorth ()
+ Number
+ Returns the north latitude of the bounds
+
+
+
+ contains (<LatLngBounds > otherBounds )
+ Boolean
+ Returns true if the rectangle contains the given one.
+
+
+
+ contains (<LatLng > latlng )
+ Boolean
+ Returns true if the rectangle contains the given point.
+
+
+
+ intersects (<LatLngBounds > otherBounds )
+ Boolean
+ Returns true if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common.
+
+
+
+ overlaps (<Bounds > otherBounds )
+ Boolean
+ Returns true if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area.
+
+
+
+ toBBoxString ()
+ String
+ Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format. Useful for sending requests to web services that return geo data.
+
+
+
+ equals (<LatLngBounds > otherBounds , <Number> maxMargin? )
+ Boolean
+ Returns true if the rectangle is equivalent (within a small margin of error) to the given bounds. The margin of error can be overridden by setting maxMargin to a small number.
+
+
+
+ isValid ()
+ Boolean
+ Returns true if the bounds are properly initialized.
+
+
+
+
+
+
+
+ Point Represents a point with x and y coordinates in pixels.
+
+
+Usage example
+
+
+
+
+
+
+
+var point = L.point(200, 300);
+
+All Leaflet methods and options that accept Point objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent:
+map.panBy([200, 300]);
+map.panBy(L.point(200, 300));
+
+Note that Point does not inherit from Leaflet's Class object,
+which means new classes can't inherit from it, and new methods
+can't be added to it with the include function.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.point (<Number> x , <Number> y , <Boolean> round? )
+ Creates a Point object with the given x and y coordinates. If optional round is set to true, rounds the x and y values.
+
+
+ L.point (<Number[]> coords )
+ Expects an array of the form [x, y] instead.
+
+
+ L.point (<Object> coords )
+ Expects a plain object of the form {x: Number, y: Number} instead.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ clone ()
+ Point
+ Returns a copy of the current point.
+
+
+
+ add (<Point > otherPoint )
+ Point
+ Returns the result of addition of the current and the given points.
+
+
+
+ subtract (<Point > otherPoint )
+ Point
+ Returns the result of subtraction of the given point from the current.
+
+
+
+ divideBy (<Number> num )
+ Point
+ Returns the result of division of the current point by the given number.
+
+
+
+ multiplyBy (<Number> num )
+ Point
+ Returns the result of multiplication of the current point by the given number.
+
+
+
+ scaleBy (<Point > scale )
+ Point
+ Multiply each coordinate of the current point by each coordinate of
+scale. In linear algebra terms, multiply the point by the
+scaling matrix
+defined by scale.
+
+
+
+ unscaleBy (<Point > scale )
+ Point
+ Inverse of scaleBy. Divide each coordinate of the current point by
+each coordinate of scale.
+
+
+
+ round ()
+ Point
+ Returns a copy of the current point with rounded coordinates.
+
+
+
+ floor ()
+ Point
+ Returns a copy of the current point with floored coordinates (rounded down).
+
+
+
+ ceil ()
+ Point
+ Returns a copy of the current point with ceiled coordinates (rounded up).
+
+
+
+ trunc ()
+ Point
+ Returns a copy of the current point with truncated coordinates (rounded towards zero).
+
+
+
+ distanceTo (<Point > otherPoint )
+ Number
+ Returns the cartesian distance between the current and the given points.
+
+
+
+ equals (<Point > otherPoint )
+ Boolean
+ Returns true if the given point has the same coordinates.
+
+
+
+ contains (<Point > otherPoint )
+ Boolean
+ Returns true if both coordinates of the given point are less than the corresponding current point coordinates (in absolute values).
+
+
+
+ toString ()
+ String
+ Returns a string representation of the point for debugging purposes.
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ x
+ Number
+ The x coordinate of the point
+
+
+ y
+ Number
+ The y coordinate of the point
+
+
+
+
+
+
+ Bounds Represents a rectangular area in pixel coordinates.
+
+
+Usage example
+
+
+
+
+
+
+
+var p1 = L.point(10, 10),
+p2 = L.point(40, 60),
+bounds = L.bounds(p1, p2);
+
+All Leaflet methods that accept Bounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:
+otherBounds.intersects([[10, 10], [40, 60]]);
+
+Note that Bounds does not inherit from Leaflet's Class object,
+which means new classes can't inherit from it, and new methods
+can't be added to it with the include function.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.bounds (<Point > corner1 , <Point > corner2 )
+ Creates a Bounds object from two corners coordinate pairs.
+
+
+ L.bounds (<Point[]> points )
+ Creates a Bounds object from the given array of points.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ extend (<Point > point )
+ this
+ Extends the bounds to contain the given point.
+
+
+
+ getCenter (<Boolean> round? )
+ Point
+ Returns the center point of the bounds.
+
+
+
+ getBottomLeft ()
+ Point
+ Returns the bottom-left point of the bounds.
+
+
+
+ getTopRight ()
+ Point
+ Returns the top-right point of the bounds.
+
+
+
+ getTopLeft ()
+ Point
+ Returns the top-left point of the bounds (i.e. this.min ).
+
+
+
+ getBottomRight ()
+ Point
+ Returns the bottom-right point of the bounds (i.e. this.max ).
+
+
+
+ getSize ()
+ Point
+ Returns the size of the given bounds
+
+
+
+ contains (<Bounds > otherBounds )
+ Boolean
+ Returns true if the rectangle contains the given one.
+
+
+
+ contains (<Point > point )
+ Boolean
+ Returns true if the rectangle contains the given point.
+
+
+
+ intersects (<Bounds > otherBounds )
+ Boolean
+ Returns true if the rectangle intersects the given bounds. Two bounds
+intersect if they have at least one point in common.
+
+
+
+ overlaps (<Bounds > otherBounds )
+ Boolean
+ Returns true if the rectangle overlaps the given bounds. Two bounds
+overlap if their intersection is an area.
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ min
+ Point
+ The top left corner of the rectangle.
+
+
+ max
+ Point
+ The bottom right corner of the rectangle.
+
+
+
+
+
+
+ Icon Represents an icon to provide when creating a marker.
+
+
+Usage example
+
+
+
+
+
+
+
+var myIcon = L.icon({
+ iconUrl: 'my-icon.png',
+ iconSize: [38, 95],
+ iconAnchor: [22, 94],
+ popupAnchor: [-3, -76],
+ shadowUrl: 'my-icon-shadow.png',
+ shadowSize: [68, 95],
+ shadowAnchor: [22, 94]
+});
+L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
+
+L.Icon.Default extends L.Icon and is the blue icon Leaflet uses for markers by default.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.icon (<Icon options > options )
+ Creates an icon instance with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ iconUrl
+ String
+ null
+ (required) The URL to the icon image (absolute or relative to your script path).
+
+
+ iconRetinaUrl
+ String
+ null
+ The URL to a retina sized version of the icon image (absolute or relative to your
+script path). Used for Retina screen devices.
+
+
+ iconSize
+ Point
+ null
+ Size of the icon image in pixels.
+
+
+ iconAnchor
+ Point
+ null
+ The coordinates of the "tip" of the icon (relative to its top left corner). The icon
+will be aligned so that this point is at the marker's geographical location. Centered
+by default if size is specified, also can be set in CSS with negative margins.
+
+
+
+ tooltipAnchor
+ Point
+ [0, 0]
+ The coordinates of the point from which tooltips will "open", relative to the icon anchor.
+
+
+ shadowUrl
+ String
+ null
+ The URL to the icon shadow image. If not specified, no shadow image will be created.
+
+
+ shadowRetinaUrl
+ String
+ null
+
+
+
+ shadowSize
+ Point
+ null
+ Size of the shadow image in pixels.
+
+
+ shadowAnchor
+ Point
+ null
+ The coordinates of the "tip" of the shadow (relative to its top left corner) (the same
+as iconAnchor if not specified).
+
+
+ className
+ String
+ ''
+ A custom class name to assign to both icon and shadow images. Empty by default.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ createIcon (<HTMLElement> oldIcon? )
+ HTMLElement
+ Called internally when the icon has to be shown, returns a <img> HTML element
+styled according to the options.
+
+
+
+ createShadow (<HTMLElement> oldIcon? )
+ HTMLElement
+ As createIcon, but for the shadow beneath it.
+
+
+
+
+
+
+
+
+
+
+Icon.Default
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ imagePath
+ String
+
+ Icon.Default will try to auto-detect the location of the
+blue icon images. If you are placing these images in a non-standard
+way, set this option to point to the right path.
+
+
+
+
+
+
+ DivIcon Represents a lightweight icon for markers that uses a simple <div>
+element instead of an image. Inherits from Icon but ignores the iconUrl and shadow options.
+
+
+Usage example
+
+
+
+
+
+
+
+var myIcon = L.divIcon({className: 'my-div-icon'});
+// you can set .my-div-icon styles in CSS
+L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
+
+By default, it has a 'leaflet-div-icon' CSS class and is styled as a little white square with a shadow.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.divIcon (<DivIcon options > options )
+ Creates a DivIcon instance with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ html
+ String
+ ''
+ Custom HTML code to put inside the div element, empty by default.
+
+
+ bgPos
+ Point
+ [0, 0]
+ Optional relative position of the background, in pixels
+
+
+
+
+
+
+
+
▶ Options inherited from Icon
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ iconUrl
+ String
+ null
+ (required) The URL to the icon image (absolute or relative to your script path).
+
+
+ iconRetinaUrl
+ String
+ null
+ The URL to a retina sized version of the icon image (absolute or relative to your
+script path). Used for Retina screen devices.
+
+
+ iconSize
+ Point
+ null
+ Size of the icon image in pixels.
+
+
+ iconAnchor
+ Point
+ null
+ The coordinates of the "tip" of the icon (relative to its top left corner). The icon
+will be aligned so that this point is at the marker's geographical location. Centered
+by default if size is specified, also can be set in CSS with negative margins.
+
+
+
+ tooltipAnchor
+ Point
+ [0, 0]
+ The coordinates of the point from which tooltips will "open", relative to the icon anchor.
+
+
+ shadowUrl
+ String
+ null
+ The URL to the icon shadow image. If not specified, no shadow image will be created.
+
+
+ shadowRetinaUrl
+ String
+ null
+
+
+
+ shadowSize
+ Point
+ null
+ Size of the shadow image in pixels.
+
+
+ shadowAnchor
+ Point
+ null
+ The coordinates of the "tip" of the shadow (relative to its top left corner) (the same
+as iconAnchor if not specified).
+
+
+ className
+ String
+ ''
+ A custom class name to assign to both icon and shadow images. Empty by default.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Icon
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ createIcon (<HTMLElement> oldIcon? )
+ HTMLElement
+ Called internally when the icon has to be shown, returns a <img> HTML element
+styled according to the options.
+
+
+
+ createShadow (<HTMLElement> oldIcon? )
+ HTMLElement
+ As createIcon, but for the shadow beneath it.
+
+
+
+
+
+
+
+
+ Control.Zoom A basic zoom control with two buttons (zoom in and zoom out). It is put on the map by default unless you set its zoomControl option to false. Extends Control .
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.control.zoom (<Control.Zoom options > options )
+ Creates a zoom control
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ zoomInText
+ String
+ '+'
+ The text set on the 'zoom in' button.
+
+
+ zoomInTitle
+ String
+ 'Zoom in'
+ The title set on the 'zoom in' button.
+
+
+ zoomOutText
+ String
+ '−
+ '
+The text set on the 'zoom out' button.
+
+
+ zoomOutTitle
+ String
+ 'Zoom out'
+ The title set on the 'zoom out' button.
+
+
+
+
+
+
+
+
▶ Options inherited from Control
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Control
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+
+
+ Control.Attribution The attribution control allows you to display attribution data in a small text box on a map. It is put on the map by default unless you set its attributionControl option to false, and it fetches attribution texts from layers with the getAttribution method automatically. Extends Control.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ prefix
+ String
+ 'Leaflet'
+ The HTML text shown before the attributions. Pass false to disable.
+
+
+
+
+
+
+
+
▶ Options inherited from Control
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setPrefix (<String> prefix )
+ this
+ Sets the text before the attributions.
+
+
+
+ addAttribution (<String> text )
+ this
+ Adds an attribution text (e.g. 'Vector data © Mapbox').
+
+
+
+ removeAttribution (<String> text )
+ this
+ Removes an attribution text.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Control
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+
+
+ Control.Layers The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the detailed example ). Extends Control .
+
+
+Usage example
+
+
+
+
+
+
+
+var baseLayers = {
+ "Mapbox": mapbox,
+ "OpenStreetMap": osm
+};
+var overlays = {
+ "Marker": marker,
+ "Roads": roadsLayer
+};
+L.control.layers(baseLayers, overlays).addTo(map);
+
+The baseLayers and overlays parameters are object literals with layer names as keys and Layer objects as values:
+{
+ "<someName1>": layer1,
+ "<someName2>": layer2
+}
+
+The layer names can contain HTML, which allows you to add additional styling to the items:
+{"<img src='my-layer-icon' /> <span class='my-layer-item'>My Layer</span>": myLayer}
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.control.layers (<Object> baselayers? , <Object> overlays? , <Control.Layers options > options? )
+ Creates an attribution control with the given layers. Base layers will be switched with radio buttons, while overlays will be switched with checkboxes. Note that all base layers should be passed in the base layers object, but only one should be added to the map during map instantiation.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ collapsed
+ Boolean
+ true
+ If true, the control will be collapsed into an icon and expanded on mouse hover or touch.
+
+
+ autoZIndex
+ Boolean
+ true
+ If true, the control will assign zIndexes in increasing order to all of its layers so that the order is preserved when switching them on/off.
+
+
+ hideSingleBase
+ Boolean
+ false
+ If true, the base layers in the control will be hidden when there is only one.
+
+
+ sortLayers
+ Boolean
+ false
+ Whether to sort the layers. When false, layers will keep the order
+in which they were added to the control.
+
+
+ sortFunction
+ Function
+ *
+ A compare function
+that will be used for sorting the layers, when sortLayers is true.
+The function receives both the L.Layer instances and their names, as in
+sortFunction(layerA, layerB, nameA, nameB).
+By default, it sorts layers alphabetically by their name.
+
+
+
+
+
+
+
+
▶ Options inherited from Control
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addBaseLayer (<Layer > layer , <String> name )
+ this
+ Adds a base layer (radio button entry) with the given name to the control.
+
+
+
+ addOverlay (<Layer > layer , <String> name )
+ this
+ Adds an overlay (checkbox entry) with the given name to the control.
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Remove the given layer from the control.
+
+
+
+ expand ()
+ this
+ Expand the control container if collapsed.
+
+
+
+ collapse ()
+ this
+ Collapse the control container if expanded.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Control
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+
+
+ Control.Scale A simple scale control that shows the scale of the current center of screen in metric (m/km) and imperial (mi/ft) systems. Extends Control .
+
+
+Usage example
+
+
+
+
+
+
+
+L.control.scale().addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.control.scale (<Control.Scale options > options? )
+ Creates an scale control with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ maxWidth
+ Number
+ 100
+ Maximum width of the control in pixels. The width is set dynamically to show round values (e.g. 100, 200, 500).
+
+
+ metric
+ Boolean
+ True
+ Whether to show the metric scale line (m/km).
+
+
+ imperial
+ Boolean
+ True
+ Whether to show the imperial scale line (mi/ft).
+
+
+ updateWhenIdle
+ Boolean
+ false
+ If true, the control is updated on moveend , otherwise it's always up-to-date (updated on move ).
+
+
+
+
+
+
+
+
▶ Options inherited from Control
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Control
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+
+
+ Browser A namespace with static properties for browser/feature detection used by Leaflet internally.
+
+
+Usage example
+
+
+
+
+
+
+
+if (L.Browser.ielt9) {
+ alert('Upgrade your browser, dude!');
+}
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ ie
+ Boolean
+ true for all Internet Explorer versions (not Edge).
+
+
+ ielt9
+ Boolean
+ true for Internet Explorer versions less than 9.
+
+
+ edge
+ Boolean
+ true for the Edge web browser.
+
+
+ webkit
+ Boolean
+ true for webkit-based browsers like Chrome and Safari (including mobile versions).
+
+
+ android
+ Boolean
+ true for any browser running on an Android platform.
+
+
+ android23
+ Boolean
+ true for browsers running on Android 2 or Android 3.
+
+
+ androidStock
+ Boolean
+ true for the Android stock browser (i.e. not Chrome)
+
+
+ opera
+ Boolean
+ true for the Opera browser
+
+
+ chrome
+ Boolean
+ true for the Chrome browser.
+
+
+ gecko
+ Boolean
+ true for gecko-based browsers like Firefox.
+
+
+ safari
+ Boolean
+ true for the Safari browser.
+
+
+ opera12
+ Boolean
+ true for the Opera browser supporting CSS transforms (version 12 or later).
+
+
+ win
+ Boolean
+ true when the browser is running in a Windows platform
+
+
+ ie3d
+ Boolean
+ true for all Internet Explorer versions supporting CSS transforms.
+
+
+ webkit3d
+ Boolean
+ true for webkit-based browsers supporting CSS transforms.
+
+
+ gecko3d
+ Boolean
+ true for gecko-based browsers supporting CSS transforms.
+
+
+ any3d
+ Boolean
+ true for all browsers supporting CSS transforms.
+
+
+ mobile
+ Boolean
+ true for all browsers running in a mobile device.
+
+
+ mobileWebkit
+ Boolean
+ true for all webkit-based browsers in a mobile device.
+
+
+ mobileWebkit3d
+ Boolean
+ true for all webkit-based browsers in a mobile device supporting CSS transforms.
+
+
+ msPointer
+ Boolean
+ true for browsers implementing the Microsoft touch events model (notably IE10).
+
+
+ pointer
+ Boolean
+ true for all browsers supporting pointer events .
+
+
+ touch
+ Boolean
+ true for all browsers supporting touch events .
+This does not necessarily mean that the browser is running in a computer with
+a touchscreen, it only means that the browser is capable of understanding
+touch events.
+
+
+ mobileOpera
+ Boolean
+ true for the Opera browser in a mobile device.
+
+
+ mobileGecko
+ Boolean
+ true for gecko-based browsers running in a mobile device.
+
+
+ retina
+ Boolean
+ true for browsers on a high-resolution "retina" screen or on any screen when browser's display zoom is more than 100%.
+
+
+ canvas
+ Boolean
+ true when the browser supports <canvas> .
+
+
+ svg
+ Boolean
+ true when the browser supports SVG .
+
+
+ vml
+ Boolean
+ true if the browser supports VML .
+
+
+
+
+
+
+ Util Various utility functions, used by Leaflet internally.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ extend (<Object> dest , <Object> src? )
+ Object
+ Merges the properties of the src object (or multiple objects) into dest object and returns the latter. Has an L.extend shortcut.
+
+
+ create (<Object> proto , <Object> properties? )
+ Object
+ Compatibility polyfill for Object.create
+
+
+ bind (<Function> fn , … )
+ Function
+ Returns a new function bound to the arguments passed, like Function.prototype.bind .
+Has a L.bind() shortcut.
+
+
+ stamp (<Object> obj )
+ Number
+ Returns the unique ID of an object, assigning it one if it doesn't have it.
+
+
+ throttle (<Function> fn , <Number> time , <Object> context )
+ Function
+ Returns a function which executes function fn with the given scope context
+(so that the this keyword refers to context inside fn's code). The function
+fn will be called no more than one time per given amount of time. The arguments
+received by the bound function will be any arguments passed when binding the
+function, followed by any arguments passed when invoking the bound function.
+Has an L.throttle shortcut.
+
+
+ wrapNum (<Number> num , <Number[]> range , <Boolean> includeMax? )
+ Number
+ Returns the number num modulo range in such a way so it lies within
+range[0] and range[1]. The returned value will be always smaller than
+range[1] unless includeMax is set to true.
+
+
+ falseFn ()
+ Function
+ Returns a function which always returns false.
+
+
+ formatNum (<Number> num , <Number> digits? )
+ Number
+ Returns the number num rounded to digits decimals, or to 6 decimals by default.
+
+
+ trim (<String> str )
+ String
+ Compatibility polyfill for String.prototype.trim
+
+
+ splitWords (<String> str )
+ String[]
+ Trims and splits the string on whitespace and returns the array of parts.
+
+
+ setOptions (<Object> obj , <Object> options )
+ Object
+ Merges the given properties to the options of the obj object, returning the resulting options. See Class options. Has an L.setOptions shortcut.
+
+
+ getParamString (<Object> obj , <String> existingUrl? , <Boolean> uppercase? )
+ String
+ Converts an object into a parameter URL string, e.g. {a: "foo", b: "bar"}
+translates to '?a=foo&b=bar'. If existingUrl is set, the parameters will
+be appended at the end. If uppercase is true, the parameter names will
+be uppercased (e.g. '?A=foo&B=bar')
+
+
+ template (<String> str , <Object> data )
+ String
+ Simple templating facility, accepts a template string of the form 'Hello {a}, {b}'
+and a data object like {a: 'foo', b: 'bar'}, returns evaluated string
+('Hello foo, bar'). You can also specify functions instead of strings for
+data values — they will be evaluated passing data as an argument.
+
+
+ isArray (obj )
+ Boolean
+ Compatibility polyfill for Array.isArray
+
+
+ indexOf (<Array> array , <Object> el )
+ Number
+ Compatibility polyfill for Array.prototype.indexOf
+
+
+ requestAnimFrame (<Function> fn , <Object> context? , <Boolean> immediate? )
+ Number
+ Schedules fn to be executed when the browser repaints. fn is bound to
+context if given. When immediate is set, fn is called immediately if
+the browser doesn't have native support for
+window.requestAnimationFrame ,
+otherwise it's delayed. Returns a request ID that can be used to cancel the request.
+
+
+ cancelAnimFrame (<Number> id )
+ undefined
+ Cancels a previous requestAnimFrame. See also window.cancelAnimationFrame .
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ lastId
+ Number
+ Last unique ID used by stamp()
+
+
+ emptyImageUrl
+ String
+ Data URI string containing a base64-encoded empty GIF image.
+Used as a hack to free memory from unused images on WebKit-powered
+mobile devices (by setting image src to this string).
+
+
+
+
+
+
+ Represents an affine transformation: a set of coefficients a, b, c, d
+for transforming a point of a form (x, y) into (a*x + b, c*y + d) and doing
+the reverse. Used by Leaflet in its projections code.
+
+
+
+
+
+
+
+
+
+
+var transformation = L.transformation(2, 5, -1, 10),
+ p = L.point(1, 2),
+ p2 = transformation.transform(p), // L.point(7, 8)
+ p3 = transformation.untransform(p2); // L.point(1, 2)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.transformation (<Number> a , <Number> b , <Number> c , <Number> d )
+ Instantiates a Transformation object with the given coefficients.
+
+
+ L.transformation (<Array> coefficients )
+ Expects an coefficients array of the form
+[a: Number, b: Number, c: Number, d: Number].
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ transform (<Point > point , <Number> scale? )
+ Point
+ Returns a transformed point, optionally multiplied by the given scale.
+Only accepts actual L.Point instances, not arrays.
+
+
+
+ untransform (<Point > point , <Number> scale? )
+ Point
+ Returns the reverse transformation of the given point, optionally divided
+by the given scale. Only accepts actual L.Point instances, not arrays.
+
+
+
+
+
+
+
+ LineUtil Various utility functions for polyline points processing, used by Leaflet internally to make polylines lightning-fast.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ simplify (<Point[]> points , <Number> tolerance )
+ Point[]
+ Dramatically reduces the number of points in a polyline while retaining
+its shape and returns a new array of simplified points, using the
+Douglas-Peucker algorithm .
+Used for a huge performance boost when processing/displaying Leaflet polylines for
+each zoom level and also reducing visual noise. tolerance affects the amount of
+simplification (lesser value means higher quality but slower and with more points).
+Also released as a separated micro-library Simplify.js .
+
+
+ pointToSegmentDistance (<Point > p , <Point > p1 , <Point > p2 )
+ Number
+ Returns the distance between point p and segment p1 to p2.
+
+
+ closestPointOnSegment (<Point > p , <Point > p1 , <Point > p2 )
+ Number
+ Returns the closest point from a point p on a segment p1 to p2.
+
+
+ clipSegment (<Point > a , <Point > b , <Bounds > bounds , <Boolean> useLastCode? , <Boolean> round? )
+ Point[]|Boolean
+ Clips the segment a to b by rectangular bounds with the
+Cohen-Sutherland algorithm
+(modifying the segment points directly!). Used by Leaflet to only show polyline
+points that are on the screen or near, increasing performance.
+
+
+ isFlat (<LatLng[]> latlngs )
+ Boolean
+ Returns true if latlngs is a flat array, false is nested.
+
+
+
+
+
+
+ PolyUtil Various utility functions for polygon geometries.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ clipPolygon (<Point[]> points , <Bounds > bounds , <Boolean> round? )
+ Point[]
+ Clips the polygon geometry defined by the given points by the given bounds (using the Sutherland-Hodgman algorithm ).
+Used by Leaflet to only show polygon points that are on the screen or near, increasing
+performance. Note that polygon points needs different algorithm for clipping
+than polyline, so there's a separate method for it.
+
+
+
+
+
+
+ DomEvent Utility functions to work with the DOM events , used by Leaflet internally.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ on (<HTMLElement> el , <String> types , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular DOM event type of the
+element el. You can optionally specify the context of the listener
+(object the this keyword will point to). You can also pass several
+space-separated types (e.g. 'click dblclick').
+
+
+ on (<HTMLElement> el , <Object> eventMap , <Object> context? )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+ off (<HTMLElement> el , <String> types , <Function> fn , <Object> context? )
+ this
+ Removes a previously added listener function.
+Note that if you passed a custom context to on, you must pass the same
+context to off in order to remove the listener.
+
+
+ off (<HTMLElement> el , <Object> eventMap , <Object> context? )
+ this
+ Removes a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+ stopPropagation (<DOMEvent> ev )
+ this
+ Stop the given event from propagation to parent elements. Used inside the listener functions:
+L.DomEvent.on(div, 'click', function (ev) {
+ L.DomEvent.stopPropagation(ev);
+});
+
+
+
+ disableScrollPropagation (<HTMLElement> el )
+ this
+ Adds stopPropagation to the element's 'mousewheel' events (plus browser variants).
+
+
+ disableClickPropagation (<HTMLElement> el )
+ this
+ Adds stopPropagation to the element's 'click', 'doubleclick',
+'mousedown' and 'touchstart' events (plus browser variants).
+
+
+ preventDefault (<DOMEvent> ev )
+ this
+ Prevents the default action of the DOM Event ev from happening (such as
+following a link in the href of the a element, or doing a POST request
+with page reload when a <form> is submitted).
+Use it inside listener functions.
+
+
+ stop (<DOMEvent> ev )
+ this
+ Does stopPropagation and preventDefault at the same time.
+
+
+ getMousePosition (<DOMEvent> ev , <HTMLElement> container? )
+ Point
+ Gets normalized mouse position from a DOM event relative to the
+container (border excluded) or to the whole page if not specified.
+
+
+ getWheelDelta (<DOMEvent> ev )
+ Number
+ Gets normalized wheel delta from a mousewheel DOM event, in vertical
+pixels scrolled (negative if scrolling down).
+Events from pointing devices without precise scrolling are mapped to
+a best guess of 60 pixels.
+
+
+ addListener (… )
+ this
+ Alias to L.DomEvent.on
+
+
+ removeListener (… )
+ this
+ Alias to L.DomEvent.off
+
+
+
+
+
+
+ DomUtil Utility functions to work with the DOM
+tree, used by Leaflet internally.
+Most functions expecting or returning a HTMLElement also work for
+SVG elements. The only difference is that classes refer to CSS classes
+in HTML and SVG classes in SVG.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ get (<String|HTMLElement> id )
+ HTMLElement
+ Returns an element given its DOM id, or returns the element itself
+if it was passed directly.
+
+
+ getStyle (<HTMLElement> el , <String> styleAttrib )
+ String
+ Returns the value for a certain style attribute on an element,
+including computed values or values set through CSS.
+
+
+ create (<String> tagName , <String> className? , <HTMLElement> container? )
+ HTMLElement
+ Creates an HTML element with tagName, sets its class to className, and optionally appends it to container element.
+
+
+ remove (<HTMLElement> el )
+
+ Removes el from its parent element
+
+
+ empty (<HTMLElement> el )
+
+ Removes all of el's children elements from el
+
+
+ toFront (<HTMLElement> el )
+
+ Makes el the last child of its parent, so it renders in front of the other children.
+
+
+ toBack (<HTMLElement> el )
+
+ Makes el the first child of its parent, so it renders behind the other children.
+
+
+ hasClass (<HTMLElement> el , <String> name )
+ Boolean
+ Returns true if the element's class attribute contains name.
+
+
+ addClass (<HTMLElement> el , <String> name )
+
+ Adds name to the element's class attribute.
+
+
+ removeClass (<HTMLElement> el , <String> name )
+
+ Removes name from the element's class attribute.
+
+
+ setClass (<HTMLElement> el , <String> name )
+
+ Sets the element's class.
+
+
+ getClass (<HTMLElement> el )
+ String
+ Returns the element's class.
+
+
+ setOpacity (<HTMLElement> el , <Number> opacity )
+
+ Set the opacity of an element (including old IE support).
+opacity must be a number from 0 to 1.
+
+
+ testProp (<String[]> props )
+ String|false
+ Goes through the array of style names and returns the first name
+that is a valid style name for an element. If no such name is found,
+it returns false. Useful for vendor-prefixed styles like transform.
+
+
+ setTransform (<HTMLElement> el , <Point > offset , <Number> scale? )
+
+ Resets the 3D CSS transform of el so it is translated by offset pixels
+and optionally scaled by scale. Does not have an effect if the
+browser doesn't support 3D CSS transforms.
+
+
+ setPosition (<HTMLElement> el , <Point > position )
+
+ Sets the position of el to coordinates specified by position,
+using CSS translate or top/left positioning depending on the browser
+(used by Leaflet internally to position its layers).
+
+
+ getPosition (<HTMLElement> el )
+ Point
+ Returns the coordinates of an element previously positioned with setPosition.
+
+
+ disableTextSelection ()
+
+ Prevents the user from generating selectstart DOM events, usually generated
+when the user drags the mouse through a page with text. Used internally
+by Leaflet to override the behaviour of any click-and-drag interaction on
+the map. Affects drag interactions on the whole document.
+
+
+ enableTextSelection ()
+
+ Cancels the effects of a previous L.DomUtil.disableTextSelection .
+
+
+ disableImageDrag ()
+
+ As L.DomUtil.disableTextSelection , but
+for dragstart DOM events, usually generated when the user drags an image.
+
+
+ enableImageDrag ()
+
+ Cancels the effects of a previous L.DomUtil.disableImageDrag .
+
+
+ preventOutline (<HTMLElement> el )
+
+ Makes the outline
+of the element el invisible. Used internally by Leaflet to prevent
+focusable elements from displaying an outline when the user performs a
+drag interaction on them.
+
+
+ restoreOutline ()
+
+ Cancels the effects of a previous L.DomUtil.preventOutline .
+
+
+ getSizedParentNode (<HTMLElement> el )
+ HTMLElement
+ Finds the closest parent node which size (width and height) is not null.
+
+
+ getScale (<HTMLElement> el )
+ Object
+ Computes the CSS scale currently applied on the element.
+Returns an object with x and y members as horizontal and vertical scales respectively,
+and boundingClientRect as the result of getBoundingClientRect() .
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ TRANSFORM
+ String
+ Vendor-prefixed transform style name (e.g. 'webkitTransform' for WebKit).
+
+
+ TRANSITION
+ String
+ Vendor-prefixed transition style name.
+
+
+ TRANSITION_END
+ String
+ Vendor-prefixed transitionend event name.
+
+
+
+
+
+
+ PosAnimation Used internally for panning animations, utilizing CSS3 Transitions for modern browsers and a timer fallback for IE6-9.
+
+
+Usage example
+
+
+
+
+
+
+
+var fx = new L.PosAnimation();
+fx.run(el, [300, 500], 0.5);
+
+
+
+
+
+
+
+
+Constructor
+
+
+
+
+
+
+
+
+ Constructor
+ Description
+
+
+
+ L.PosAnimation ()
+ Creates a PosAnimation object.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ start
+ Event
+ Fired when the animation starts
+
+
+ step
+ Event
+ Fired continuously during the animation.
+
+
+ end
+ Event
+ Fired when the animation ends.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ run (<HTMLElement> el , <Point > newPos , <Number> duration? , <Number> easeLinearity? )
+
+ Run an animation of a given element to a new position, optionally setting
+duration in seconds (0.25 by default) and easing linearity factor (3rd
+argument of the cubic bezier curve ,
+0.5 by default).
+
+
+
+ stop ()
+
+ Stops the animation (if currently running).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Draggable A class for making DOM elements draggable (including touch support).
+Used internally for map and marker dragging. Only works for elements
+that were positioned with L.DomUtil.setPosition .
+
+
+Usage example
+
+
+
+
+
+
+
+var draggable = new L.Draggable(elementToDrag);
+draggable.enable();
+
+
+
+
+
+
+
+
+Constructor
+
+
+
+
+
+
+
+
+ Constructor
+ Description
+
+
+
+ L.Draggable (<HTMLElement> el , <HTMLElement> dragHandle? , <Boolean> preventOutline? , <Draggable options > options? )
+ Creates a Draggable object for moving el when you start dragging the dragHandle element (equals el itself by default).
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ clickTolerance
+ Number
+ 3
+ The max number of pixels a user can shift the mouse pointer during a click
+for it to be considered a valid click (as opposed to a mouse drag).
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ down
+ Event
+ Fired when a drag is about to start.
+
+
+ dragstart
+ Event
+ Fired when a drag starts
+
+
+ predrag
+ Event
+ Fired continuously during dragging before each corresponding
+update of the element's position.
+
+
+ drag
+ Event
+ Fired continuously during dragging.
+
+
+ dragend
+ DragEndEvent
+ Fired when the drag ends.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ enable ()
+
+ Enables the dragging ability
+
+
+
+ disable ()
+
+ Disables the dragging ability
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Class L.Class powers the OOP facilities of Leaflet and is used to create almost all of the Leaflet classes documented here.
+In addition to implementing a simple classical inheritance model, it introduces several special properties for convenient code organization — options, includes and statics.
+
+
+Usage example
+
+
+
+
+
+
+
+var MyClass = L.Class.extend({
+initialize: function (greeter) {
+ this.greeter = greeter;
+ // class constructor
+},
+greet: function (name) {
+ alert(this.greeter + ', ' + name)
+ }
+});
+// create instance of MyClass, passing "Hello" to the constructor
+var a = new MyClass("Hello");
+// call greet method, alerting "Hello, World"
+a.greet("World");
+
+
+
+
+
+
+Class Factories
+
+
+
+You may have noticed that Leaflet objects are created without using
+the new keyword. This is achieved by complementing each class with a
+lowercase factory method:
+new L.Map('map'); // becomes:
+L.map('map');
+
+The factories are implemented very easily, and you can do this for your own classes:
+L.map = function (id, options) {
+ return new L.Map(id, options);
+};
+
+
+
+
+
+
+Inheritance
+
+
+
+You use L.Class.extend to define new classes, but you can use the same method on any class to inherit from it:
+var MyChildClass = MyClass.extend({
+ // ... new properties and methods
+});
+
+This will create a class that inherits all methods and properties of the parent class (through a proper prototype chain), adding or overriding the ones you pass to extend. It will also properly react to instanceof:
+var a = new MyChildClass();
+a instanceof MyChildClass; // true
+a instanceof MyClass; // true
+
+You can call parent methods (including constructor) from corresponding child ones (as you do with super calls in other languages) by accessing parent class prototype and using JavaScript's call or apply:
+var MyChildClass = MyClass.extend({
+ initialize: function () {
+ MyClass.prototype.initialize.call(this, "Yo");
+ },
+ greet: function (name) {
+ MyClass.prototype.greet.call(this, 'bro ' + name + '!');
+ }
+});
+var a = new MyChildClass();
+a.greet('Jason'); // alerts "Yo, bro Jason!"
+
+
+
+
+
+Options
+
+
+
+options is a special property that unlike other objects that you pass
+to extend will be merged with the parent one instead of overriding it
+completely, which makes managing configuration of objects and default
+values convenient:
+var MyClass = L.Class.extend({
+ options: {
+ myOption1: 'foo',
+ myOption2: 'bar'
+ }
+});
+var MyChildClass = MyClass.extend({
+ options: {
+ myOption1: 'baz',
+ myOption3: 5
+ }
+});
+var a = new MyChildClass();
+a.options.myOption1; // 'baz'
+a.options.myOption2; // 'bar'
+a.options.myOption3; // 5
+
+There's also L.Util.setOptions , a method for
+conveniently merging options passed to constructor with the defaults
+defines in the class:
+var MyClass = L.Class.extend({
+ options: {
+ foo: 'bar',
+ bla: 5
+ },
+ initialize: function (options) {
+ L.Util.setOptions(this, options);
+ ...
+ }
+});
+var a = new MyClass({bla: 10});
+a.options; // {foo: 'bar', bla: 10}
+
+Note that the options object allows any keys, not just
+the options defined by the class and its base classes.
+This means you can use the options object to store
+application specific information, as long as you avoid
+keys that are already used by the class in question.
+
+
+
+
+
+Includes
+
+
+
+includes is a special class property that merges all specified objects into the class (such objects are called mixins).
+ var MyMixin = {
+ foo: function () { ... },
+ bar: 5
+};
+var MyClass = L.Class.extend({
+ includes: MyMixin
+});
+var a = new MyClass();
+a.foo();
+
+You can also do such includes in runtime with the include method:
+MyClass.include(MyMixin);
+
+statics is just a convenience property that injects specified object properties as the static properties of the class, useful for defining constants:
+var MyClass = L.Class.extend({
+ statics: {
+ FOO: 'bar',
+ BLA: 5
+ }
+});
+MyClass.FOO; // 'bar'
+
+
+
+
+
+
+Constructor hooks
+
+
+
+If you're a plugin developer, you often need to add additional initialization code to existing classes (e.g. editing hooks for L.Polyline ). Leaflet comes with a way to do it easily using the addInitHook method:
+MyClass.addInitHook(function () {
+ // ... do something in constructor additionally
+ // e.g. add event listeners, set custom properties etc.
+});
+
+You can also use the following shortcut when you just need to make one additional method call:
+MyClass.addInitHook('methodName', arg1, arg2, …);
+
+
+
+
+
+
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ extend (<Object> props )
+ Function
+ Extends the current class given the properties to be included.
+Returns a Javascript function that is a class constructor (to be called with new).
+
+
+ include (<Object> properties )
+ this
+ Includes a mixin into the current class.
+
+
+ mergeOptions (<Object> options )
+ this
+ Merges options into the defaults of the class.
+
+
+ addInitHook (<Function> fn )
+ this
+ Adds a constructor hook to the class.
+
+
+
+
+
+
+ Evented A set of methods shared between event-powered classes (like Map and Marker ). Generally, events allow you to execute some function when something happens with an object (e.g. the user clicks on the map, causing the map to fire 'click' event).
+
+
+Usage example
+
+
+
+
+
+
+
+map.on('click', function(e) {
+ alert(e.latlng);
+} );
+
+Leaflet deals with event listeners by reference, so if you want to add a listener and then remove it, define it as a function:
+function onClick(e) { ... }
+map.on('click', onClick);
+map.off('click', onClick);
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+ Layer A set of methods from the Layer base class that all Leaflet layers use.
+Inherits all methods, options and events from L.Evented .
+
+
+Usage example
+
+
+
+
+
+
+
+var layer = L.Marker(latlng).addTo(map);
+layer.addTo(map);
+layer.remove();
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ onAdd (<Map > map )
+ this
+ Should contain code that creates DOM elements for the layer, adds them to map panes where they should belong and puts listeners on relevant map events. Called on map.addLayer(layer) .
+
+
+
+ onRemove (<Map > map )
+ this
+ Should contain all clean up code that removes the layer's elements from the DOM and removes listeners previously added in onAdd . Called on map.removeLayer(layer) .
+
+
+
+ getEvents ()
+ Object
+ This optional method should return an object like { viewreset: this._reset } for addEventListener . The event handlers in this object will be automatically added and removed from the map with your layer.
+
+
+
+ getAttribution ()
+ String
+ This optional method should return a string containing HTML to be shown on the Attribution control whenever the layer is visible.
+
+
+
+ beforeAdd (<Map > map )
+ this
+ Optional method. Called on map.addLayer(layer) , before the layer is added to the map, before events are initialized, without waiting until the map is in a usable state. Use for early initialization only.
+
+
+
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Interactive layer Some Layer s can be made interactive - when the user interacts
+with such a layer, mouse events like click and mouseover can be handled.
+Use the event handling methods to handle these events.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this layer will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+Mouse events
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Control L.Control is a base class for implementing map controls. Handles positioning.
+All other controls extend from this class.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ onAdd (<Map > map )
+ HTMLElement
+ Should return the container DOM element for the control and add listeners on relevant map events. Called on control.addTo(map) .
+
+
+
+ onRemove (<Map > map )
+
+ Optional method. Should contain all clean up code that removes the listeners previously added in onAdd . Called on control.remove() .
+
+
+
+
+
+
+
+ Handler Abstract class for map interaction handlers
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ enable ()
+ this
+ Enables the handler
+
+
+
+ disable ()
+ this
+ Disables the handler
+
+
+
+ enabled ()
+ Boolean
+ Returns true if the handler is enabled
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addHooks ()
+
+ Called when the handler is enabled, should add event hooks.
+
+
+
+ removeHooks ()
+
+ Called when the handler is disabled, should remove the event hooks added previously.
+
+
+
+
+
+
+
+
+Functions
+
+
+
+There is static function which can be called without instantiating L.Handler:
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ addTo (<Map > map , <String> name )
+ this
+ Adds a new Handler to the given map with the given name.
+
+
+
+
+
+
+ Projection An object with methods for projecting geographical coordinates of the world onto
+a flat surface (and back). See Map projection .
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ project (<LatLng > latlng )
+ Point
+ Projects geographical coordinates into a 2D point.
+Only accepts actual L.LatLng instances, not arrays.
+
+
+
+ unproject (<Point > point )
+ LatLng
+ The inverse of project. Projects a 2D point into a geographical location.
+Only accepts actual L.Point instances, not arrays.
+Note that the projection instances do not inherit from Leaflet's Class object,
+and can't be instantiated. Also, new classes can't inherit from them,
+and methods can't be added to them with the include function.
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ bounds
+ Bounds
+ The bounds (specified in CRS units) where the projection is valid
+
+
+
+
+
+
+
+Defined projections
+
+
+
+
+
+
+
+
+
+ Projection
+ Description
+
+
+
+ L.Projection.LonLat
+ Equirectangular, or Plate Carree projection — the most simple projection,
+mostly used by GIS enthusiasts. Directly maps x as longitude, and y as
+latitude. Also suitable for flat worlds, e.g. game maps. Used by the
+EPSG:4326 and Simple CRS.
+
+
+ L.Projection.Mercator
+ Elliptical Mercator projection — more complex than Spherical Mercator. Takes into account that Earth is a geoid, not a perfect sphere. Used by the EPSG:3395 CRS.
+
+
+ L.Projection.SphericalMercator
+ Spherical Mercator projection — the most common projection for online maps,
+used by almost all free and commercial tile providers. Assumes that Earth is
+a sphere. Used by the EPSG:3857 CRS.
+
+
+
+
+
+
+ CRS
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ latLngToPoint (<LatLng > latlng , <Number> zoom )
+ Point
+ Projects geographical coordinates into pixel coordinates for a given zoom.
+
+
+
+ pointToLatLng (<Point > point , <Number> zoom )
+ LatLng
+ The inverse of latLngToPoint. Projects pixel coordinates on a given
+zoom into geographical coordinates.
+
+
+
+ project (<LatLng > latlng )
+ Point
+ Projects geographical coordinates into coordinates in units accepted for
+this CRS (e.g. meters for EPSG:3857, for passing it to WMS services).
+
+
+
+ unproject (<Point > point )
+ LatLng
+ Given a projected coordinate returns the corresponding LatLng.
+The inverse of project.
+
+
+
+ scale (<Number> zoom )
+ Number
+ Returns the scale used when transforming projected coordinates into
+pixel coordinates for a particular zoom. For example, it returns
+256 * 2^zoom for Mercator-based CRS.
+
+
+
+ zoom (<Number> scale )
+ Number
+ Inverse of scale(), returns the zoom level corresponding to a scale
+factor of scale.
+
+
+
+ getProjectedBounds (<Number> zoom )
+ Bounds
+ Returns the projection's bounds scaled and transformed for the provided zoom.
+
+
+
+ distance (<LatLng > latlng1 , <LatLng > latlng2 )
+ Number
+ Returns the distance between two geographical coordinates.
+
+
+
+ wrapLatLng (<LatLng > latlng )
+ LatLng
+ Returns a LatLng where lat and lng has been wrapped according to the
+CRS's wrapLat and wrapLng properties, if they are outside the CRS's bounds.
+
+
+
+ wrapLatLngBounds (<LatLngBounds > bounds )
+ LatLngBounds
+ Returns a LatLngBounds with the same size as the given one, ensuring
+that its center is within the CRS's bounds.
+Only accepts actual L.LatLngBounds instances, not arrays.
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ code
+ String
+ Standard code name of the CRS passed into WMS services (e.g. 'EPSG:3857')
+
+
+ wrapLng
+ Number[]
+ An array of two numbers defining whether the longitude (horizontal) coordinate
+axis wraps around a given range and how. Defaults to [-180, 180] in most
+geographical CRSs. If undefined, the longitude axis does not wrap around.
+
+
+ wrapLat
+ Number[]
+ Like wrapLng, but for the latitude (vertical) axis.
+
+
+ infinite
+ Boolean
+ If true, the coordinate space will be unbounded (infinite in both axes)
+
+
+
+
+
+
+
+Defined CRSs
+
+
+
+
+
+
+
+
+ CRS
+ Description
+
+
+
+ L.CRS.Earth
+ Serves as the base for CRS that are global such that they cover the earth.
+Can only be used as the base for other CRS and cannot be used directly,
+since it does not have a code, projection or transformation . distance() returns
+meters.
+
+
+ L.CRS.EPSG3395
+ Rarely used by some commercial tile providers. Uses Elliptical Mercator projection.
+
+
+ L.CRS.EPSG3857
+ The most common CRS for online maps, used by almost all free and commercial
+tile providers. Uses Spherical Mercator projection. Set in by default in
+Map's crs option.
+
+
+ L.CRS.EPSG4326
+ A common CRS among GIS enthusiasts. Uses simple Equirectangular projection.
+Leaflet 1.0.x complies with the TMS coordinate scheme for EPSG:4326 ,
+which is a breaking change from 0.7.x behaviour. If you are using a TileLayer
+with this CRS, ensure that there are two 256x256 pixel tiles covering the
+whole earth at zoom level zero, and that the tile coordinate origin is (-180,+90),
+or (-180,-90) for TileLayers with the tms option set.
+
+
+ L.CRS.Base
+ Object that defines coordinate reference systems for projecting
+geographical points into pixel (screen) coordinates and back (and to
+coordinates in other units for WMS services). See
+spatial reference system .
+Leaflet defines the most usual CRSs by default. If you want to use a
+CRS not defined by default, take a look at the
+Proj4Leaflet plugin.
+Note that the CRS instances do not inherit from Leaflet's Class object,
+and can't be instantiated. Also, new classes can't inherit from them,
+and methods can't be added to them with the include function.
+
+
+ L.CRS.Simple
+ A simple CRS that maps longitude and latitude into x and y directly.
+May be used for maps of flat surfaces (e.g. game maps). Note that the y
+axis should still be inverted (going from bottom to top). distance() returns
+simple euclidean distance.
+
+
+
+
+
+
+ Renderer Base class for vector renderer implementations (SVG , Canvas ). Handles the
+DOM container of the renderer, its bounds, and its zoom animation.
+A Renderer works as an implicit layer group for all Path s - the renderer
+itself can be added or removed to the map. All paths use a renderer, which can
+be implicit (the map will decide the type of renderer and use it automatically)
+or explicit (using the renderer option of the path).
+Do not use this class directly, use SVG and Canvas instead.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ padding
+ Number
+ 0.1
+ How much to extend the clip area around the map view (relative to its size)
+e.g. 0.1 would be 10% of map view in each direction
+
+
+ tolerance
+ Number
+ 0
+ How much to extend click tolerance round a path/object on the map
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ update
+ Event
+ Fired when the renderer updates its bounds, center and zoom, for example when
+its map has moved
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Event objects Whenever a class inheriting from Evented fires an event, a listener function
+will be called with an event argument, which is a plain object containing
+information about the event. For example:
+
map.on('click', function(ev) {
+ alert(ev.latlng); // ev is an event object (MouseEvent in this case)
+});
+
+
The information available depends on the event type:
+
+
+
+
+Event
+
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+KeyboardEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ originalEvent
+ DOMEvent
+ The original DOM KeyboardEvent that triggered this Leaflet event.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+MouseEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ latlng
+ LatLng
+ The geographical point where the mouse event occurred.
+
+
+ layerPoint
+ Point
+ Pixel coordinates of the point where the mouse event occurred relative to the map layer.
+
+
+ containerPoint
+ Point
+ Pixel coordinates of the point where the mouse event occurred relative to the map сontainer.
+
+
+ originalEvent
+ DOMEvent
+ The original DOM MouseEvent or DOM TouchEvent that triggered this Leaflet event.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+LocationEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ latlng
+ LatLng
+ Detected geographical location of the user.
+
+
+ bounds
+ LatLngBounds
+ Geographical bounds of the area user is located in (with respect to the accuracy of location).
+
+
+ accuracy
+ Number
+ Accuracy of location in meters.
+
+
+ altitude
+ Number
+ Height of the position above the WGS84 ellipsoid in meters.
+
+
+ altitudeAccuracy
+ Number
+ Accuracy of altitude in meters.
+
+
+ heading
+ Number
+ The direction of travel in degrees counting clockwise from true North.
+
+
+ speed
+ Number
+ Current velocity in meters per second.
+
+
+ timestamp
+ Number
+ The time when the position was acquired.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+ErrorEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ message
+ String
+ Error message.
+
+
+ code
+ Number
+ Error code (if applicable).
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+LayerEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ layer
+ Layer
+ The layer that was added or removed.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+
+
+
+
+
+
+
+
+LayersControlEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ layer
+ Layer
+ The layer that was added or removed.
+
+
+ name
+ String
+ The name of the layer that was added or removed.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+
+
+
+
+
+
+
+
+TileEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ tile
+ HTMLElement
+ The tile element (image).
+
+
+ coords
+ Point
+ Point object with the tile's x, y, and z (zoom level) coordinates.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+TileErrorEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ tile
+ HTMLElement
+ The tile element (image).
+
+
+ coords
+ Point
+ Point object with the tile's x, y, and z (zoom level) coordinates.
+
+
+ error
+ *
+ Error passed to the tile's done() callback.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+ResizeEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ oldSize
+ Point
+ The old size before resize event.
+
+
+ newSize
+ Point
+ The new size after the resize event.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+GeoJSONEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ layer
+ Layer
+ The layer for the GeoJSON feature that is being added to the map.
+
+
+ properties
+ Object
+ GeoJSON properties of the feature.
+
+
+ geometryType
+ String
+ GeoJSON geometry type of the feature.
+
+
+ id
+ String
+ GeoJSON ID of the feature (if present).
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ tooltip
+ Tooltip
+ The tooltip that was opened or closed.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+DragEndEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ distance
+ Number
+ The distance in pixels the draggable element was moved by.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+ZoomAnimEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ center
+ LatLng
+ The current center of the map
+
+
+ zoom
+ Number
+ The current zoom level of the map
+
+
+ noUpdate
+ Boolean
+ Whether layers should update their contents due to this event
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+ DivOverlay Base model for L.Popup and L.Tooltip. Inherit from it for custom popup like plugins.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ offset
+ Point
+ Point(0, 7)
+ The offset of the popup position. Useful to control the anchor
+of the popup when opening it on some overlays.
+
+
+ className
+ String
+ ''
+ A custom CSS class name to assign to the popup.
+
+
+ pane
+ String
+ 'popupPane'
+ Map pane where the popup will be added.
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Global Switches Global switches are created for rare cases and generally make
+Leaflet to not detect a particular browser feature even if it's
+there. You need to set the switch as a global variable to true
+before including Leaflet on the page, like this:
+
<script>L_NO_TOUCH = true;</script>
+<script src="leaflet.js"></script>
+
+
+
+
+Switch
+Description
+
+
+
+
+L_NO_TOUCH
+Forces Leaflet to not use touch events even if it detects them.
+
+
+L_DISABLE_3D
+Forces Leaflet to not use hardware-accelerated CSS 3D transforms for positioning (which may cause glitches in some rare environments) even if they're supported.
+
+
+
+
+
noConflict This method restores the L global variable to the original value
+it had before Leaflet inclusion, and returns the real Leaflet
+namespace so you can put it elsewhere, like this:
+
<script src='libs/l.js'>
+<!-- L points to some other library -->
+<script src='leaflet.js'>
+<!-- you include Leaflet, it replaces the L variable to Leaflet namespace -->
+<script>
+var Leaflet = L.noConflict();
+// now L points to that other library again, and you can use Leaflet.Map etc.
+</script>
+
+
+
version A constant that represents the Leaflet version in use.
+
L.version; // contains "1.0.0" (or whatever version is currently in use)
+
diff --git a/src/public/Leaflet-1.7.1/docs/reference-1.4.0.html b/src/public/Leaflet-1.7.1/docs/reference-1.4.0.html
new file mode 100644
index 0000000..b1d5183
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/reference-1.4.0.html
@@ -0,0 +1,23983 @@
+---
+layout: v2
+title: Documentation
+bodyclass: api-page
+---
+
+
Leaflet API reference
+
+
This reference reflects Leaflet 1.4.0 . Check this list if you are using a different version of Leaflet.
+
+
+
+
Map
+
+
Map Methods
+
+
Map Misc
+
+
+
+
UI Layers
+
+
Raster Layers
+
+
Vector Layers
+
+
+
+
Other Layers
+
+
Basic Types
+
+
Controls
+
+
+
+
+
+
+
+
+
+
Utility
+
+
DOM Utility
+
+
+
+
Base Classes
+
+
+
Misc
+
+
+
+
+
Map The central class of the API — it is used to create a map on a page and manipulate it.
+
+
+Usage example
+
+
+
+
+
+
+
+// initialize the map on the "map" div with a given center and zoom
+var map = L.map('map', {
+ center: [51.505, -0.09],
+ zoom: 13
+});
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.map (<String> id , <Map options> options? )
+ Instantiates a map object given the DOM ID of a <div> element
+and optionally an object literal with Map options.
+
+
+ L.map (<HTMLElement> el , <Map options> options? )
+ Instantiates a map object given an instance of a <div> HTML element
+and optionally an object literal with Map options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ preferCanvas
+ Boolean
+ false
+ Whether Path s should be rendered on a Canvas renderer.
+By default, all Paths are rendered in a SVG renderer.
+
+
+
+
+
+Control options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attributionControl
+ Boolean
+ true
+ Whether a attribution control is added to the map by default.
+
+
+ zoomControl
+ Boolean
+ true
+ Whether a zoom control is added to the map by default.
+
+
+
+
+
+Interaction Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+
+ boxZoom
+ Boolean
+ true
+ Whether the map can be zoomed to a rectangular area specified by
+dragging the mouse while pressing the shift key.
+
+
+ doubleClickZoom
+ Boolean|String
+ true
+ Whether the map can be zoomed in by double clicking on it and
+zoomed out by double clicking while holding shift. If passed
+'center', double-click zoom will zoom to the center of the
+ view regardless of where the mouse was.
+
+
+ dragging
+ Boolean
+ true
+ Whether the map be draggable with mouse/touch or not.
+
+
+ zoomSnap
+ Number
+ 1
+ Forces the map's zoom level to always be a multiple of this, particularly
+right after a fitBounds() or a pinch-zoom.
+By default, the zoom level snaps to the nearest integer; lower values
+(e.g. 0.5 or 0.1) allow for greater granularity. A value of 0
+means the zoom level will not be snapped after fitBounds or a pinch-zoom.
+
+
+ zoomDelta
+ Number
+ 1
+ Controls how much the map's zoom level will change after a
+zoomIn() , zoomOut() , pressing +
+or - on the keyboard, or using the zoom controls .
+Values smaller than 1 (e.g. 0.5) allow for greater granularity.
+
+
+ trackResize
+ Boolean
+ true
+ Whether the map automatically handles browser window resize to update itself.
+
+
+
+
+
+Panning Inertia Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ inertia
+ Boolean
+ *
+ If enabled, panning of the map will have an inertia effect where
+the map builds momentum while dragging and continues moving in
+the same direction for some time. Feels especially nice on touch
+devices. Enabled by default unless running on old Android devices.
+
+
+ inertiaDeceleration
+ Number
+ 3000
+ The rate with which the inertial movement slows down, in pixels/second².
+
+
+ inertiaMaxSpeed
+ Number
+ Infinity
+ Max speed of the inertial movement, in pixels/second.
+
+
+ easeLinearity
+ Number
+ 0.2
+
+
+
+ worldCopyJump
+ Boolean
+ false
+ With this option enabled, the map tracks when you pan to another "copy"
+of the world and seamlessly jumps to the original one so that all overlays
+like markers and vector layers are still visible.
+
+
+ maxBoundsViscosity
+ Number
+ 0.0
+ If maxBounds is set, this option will control how solid the bounds
+are when dragging the map around. The default value of 0.0 allows the
+user to drag outside the bounds at normal speed, higher values will
+slow down map dragging outside bounds, and 1.0 makes the bounds fully
+solid, preventing the user from dragging outside the bounds.
+
+
+
+
+
+Keyboard Navigation Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ keyboard
+ Boolean
+ true
+ Makes the map focusable and allows users to navigate the map with keyboard
+arrows and +/- keys.
+
+
+ keyboardPanDelta
+ Number
+ 80
+ Amount of pixels to pan when pressing an arrow key.
+
+
+
+
+
+Mousewheel options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ scrollWheelZoom
+ Boolean|String
+ true
+ Whether the map can be zoomed by using the mouse wheel. If passed 'center',
+it will zoom to the center of the view regardless of where the mouse was.
+
+
+ wheelDebounceTime
+ Number
+ 40
+ Limits the rate at which a wheel can fire (in milliseconds). By default
+user can't zoom via wheel more often than once per 40 ms.
+
+
+ wheelPxPerZoomLevel
+ Number
+ 60
+ How many scroll pixels (as reported by L.DomEvent.getWheelDelta )
+mean a change of one full zoom level. Smaller values will make wheel-zooming
+faster (and vice versa).
+
+
+
+
+
+Touch interaction options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ tap
+ Boolean
+ true
+ Enables mobile hacks for supporting instant taps (fixing 200ms click
+delay on iOS/Android) and touch holds (fired as contextmenu events).
+
+
+ tapTolerance
+ Number
+ 15
+ The max number of pixels a user can shift his finger during touch
+for it to be considered a valid tap.
+
+
+ touchZoom
+ Boolean|String
+ *
+ Whether the map can be zoomed by touch-dragging with two fingers. If
+passed 'center', it will zoom to the center of the view regardless of
+where the touch events (fingers) were. Enabled for touch-capable web
+browsers except for old Androids.
+
+
+ bounceAtZoomLimits
+ Boolean
+ true
+ Set it to false if you don't want the map to zoom beyond min/max zoom
+and then bounce back when pinch-zooming.
+
+
+
+
+
+Map State Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ crs
+ CRS
+ L.CRS.EPSG3857
+ The Coordinate Reference System to use. Don't change this if you're not
+sure what it means.
+
+
+ center
+ LatLng
+ undefined
+ Initial geographic center of the map
+
+
+ zoom
+ Number
+ undefined
+ Initial map zoom level
+
+
+ minZoom
+ Number
+ *
+ Minimum zoom level of the map.
+If not specified and at least one GridLayer or TileLayer is in the map,
+the lowest of their minZoom options will be used instead.
+
+
+ maxZoom
+ Number
+ *
+ Maximum zoom level of the map.
+If not specified and at least one GridLayer or TileLayer is in the map,
+the highest of their maxZoom options will be used instead.
+
+
+ layers
+ Layer[]
+ []
+ Array of layers that will be added to the map initially
+
+
+ maxBounds
+ LatLngBounds
+ null
+ When this option is set, the map restricts the view to the given
+geographical bounds, bouncing the user back if the user tries to pan
+outside the view. To set the restriction dynamically, use
+setMaxBounds method.
+
+
+ renderer
+ Renderer
+ *
+ The default method for drawing vector layers on the map. L.SVG
+or L.Canvas by default depending on browser support.
+
+
+
+
+
+Animation Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ zoomAnimation
+ Boolean
+ true
+ Whether the map zoom animation is enabled. By default it's enabled
+in all browsers that support CSS3 Transitions except Android.
+
+
+ zoomAnimationThreshold
+ Number
+ 4
+ Won't animate zoom if the zoom difference exceeds this value.
+
+
+ fadeAnimation
+ Boolean
+ true
+ Whether the tile fade animation is enabled. By default it's enabled
+in all browsers that support CSS3 Transitions except Android.
+
+
+ markerZoomAnimation
+ Boolean
+ true
+ Whether markers animate their zoom with the zoom animation, if disabled
+they will disappear for the length of the animation. By default it's
+enabled in all browsers that support CSS3 Transitions except Android.
+
+
+ transform3DLimit
+ Number
+ 2^23
+ Defines the maximum size of a CSS translation transform. The default
+value should not be changed unless a web browser positions layers in
+the wrong place after doing a large panBy.
+
+
+
+
+
+
+
+Events
+
+
+
+Layer events
+
+
+
+
+
+
+Map state change events
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ zoomlevelschange
+ Event
+ Fired when the number of zoomlevels on the map is changed due
+to adding or removing a layer.
+
+
+ resize
+ ResizeEvent
+ Fired when the map is resized.
+
+
+ unload
+ Event
+ Fired when the map is destroyed with remove method.
+
+
+ viewreset
+ Event
+ Fired when the map needs to redraw its content (this usually happens
+on map zoom or load). Very useful for creating custom overlays.
+
+
+ load
+ Event
+ Fired when the map is initialized (when its center and zoom are set
+for the first time).
+
+
+ zoomstart
+ Event
+ Fired when the map zoom is about to change (e.g. before zoom animation).
+
+
+ movestart
+ Event
+ Fired when the view of the map starts changing (e.g. user starts dragging the map).
+
+
+ zoom
+ Event
+ Fired repeatedly during any change in zoom level, including zoom
+and fly animations.
+
+
+ move
+ Event
+ Fired repeatedly during any movement of the map, including pan and
+fly animations.
+
+
+ zoomend
+ Event
+ Fired when the map has changed, after any animations.
+
+
+ moveend
+ Event
+ Fired when the center of the map stops changing (e.g. user stopped
+dragging the map).
+
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+ autopanstart
+ Event
+ Fired when the map starts autopanning when opening a popup.
+
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip is opened in the map.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip in the map is closed.
+
+
+
+
+
+Location events
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ locationerror
+ ErrorEvent
+ Fired when geolocation (using the locate method) failed.
+
+
+ locationfound
+ LocationEvent
+ Fired when geolocation (using the locate method)
+went successfully.
+
+
+
+
+
+Interaction events
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the map.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the map.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the map.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button on the map.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the map.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the map.
+
+
+ mousemove
+ MouseEvent
+ Fired while the mouse moves over the map.
+
+
+
+ keypress
+ KeyboardEvent
+ Fired when the user presses a key from the keyboard while the map is focused.
+
+
+ preclick
+ MouseEvent
+ Fired before mouse click on the map (sometimes useful when you
+want something to happen on click before any existing click
+handlers start running).
+
+
+
+
+
+Other Methods
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ zoomanim
+ ZoomAnimEvent
+ Fired at least once per zoom animation. For continuous zoom, like pinch zooming, fired once per frame during zoom.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getRenderer (<Path > layer )
+ Renderer
+ Returns the instance of Renderer that should be used to render the given
+Path . It will ensure that the renderer options of the map and paths
+are respected, and that the renderers do exist on the map.
+
+
+
+
+
+
+Methods for Layers and Controls
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addControl (<Control > control )
+ this
+ Adds the given control to the map
+
+
+
+ removeControl (<Control > control )
+ this
+ Removes the given control from the map
+
+
+
+ addLayer (<Layer > layer )
+ this
+ Adds the given layer to the map
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Removes the given layer from the map.
+
+
+
+ hasLayer (<Layer > layer )
+ Boolean
+ Returns true if the given layer is currently added to the map
+
+
+
+ eachLayer (<Function> fn , <Object> context? )
+ this
+ Iterates over the layers of the map, optionally specifying context of the iterator function.
+map.eachLayer(function(layer){
+ layer.bindPopup('Hello');
+});
+
+
+
+
+
+
+ openTooltip (<Tooltip > tooltip )
+ this
+ Opens the specified tooltip.
+
+
+
+ openTooltip (<String|HTMLElement> content , <LatLng > latlng , <Tooltip options > options? )
+ this
+ Creates a tooltip with the specified content and options and open it.
+
+
+
+ closeTooltip (<Tooltip > tooltip? )
+ this
+ Closes the tooltip given as parameter.
+
+
+
+
+
+
+Methods for modifying map state
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setView (<LatLng > center , <Number> zoom , <Zoom/pan options > options? )
+ this
+ Sets the view of the map (geographical center and zoom) with the given
+animation options.
+
+
+
+ setZoom (<Number> zoom , <Zoom/pan options > options? )
+ this
+ Sets the zoom of the map.
+
+
+
+ zoomIn (<Number> delta? , <Zoom options > options? )
+ this
+ Increases the zoom of the map by delta (zoomDelta by default).
+
+
+
+ zoomOut (<Number> delta? , <Zoom options > options? )
+ this
+ Decreases the zoom of the map by delta (zoomDelta by default).
+
+
+
+ setZoomAround (<LatLng > latlng , <Number> zoom , <Zoom options > options )
+ this
+ Zooms the map while keeping a specified geographical point on the map
+stationary (e.g. used internally for scroll zoom and double-click zoom).
+
+
+
+ setZoomAround (<Point > offset , <Number> zoom , <Zoom options > options )
+ this
+ Zooms the map while keeping a specified pixel on the map (relative to the top-left corner) stationary.
+
+
+
+ fitBounds (<LatLngBounds > bounds , <fitBounds options > options? )
+ this
+ Sets a map view that contains the given geographical bounds with the
+maximum zoom level possible.
+
+
+
+ fitWorld (<fitBounds options > options? )
+ this
+ Sets a map view that mostly contains the whole world with the maximum
+zoom level possible.
+
+
+
+ panTo (<LatLng > latlng , <Pan options > options? )
+ this
+ Pans the map to a given center.
+
+
+
+ panBy (<Point > offset , <Pan options > options? )
+ this
+ Pans the map by a given number of pixels (animated).
+
+
+
+ flyTo (<LatLng > latlng , <Number> zoom? , <Zoom/pan options > options? )
+ this
+ Sets the view of the map (geographical center and zoom) performing a smooth
+pan-zoom animation.
+
+
+
+ flyToBounds (<LatLngBounds > bounds , <fitBounds options > options? )
+ this
+ Sets the view of the map with a smooth animation like flyTo ,
+but takes a bounds parameter like fitBounds .
+
+
+
+ setMaxBounds (<Bounds > bounds )
+ this
+ Restricts the map view to the given bounds (see the maxBounds option).
+
+
+
+ setMinZoom (<Number> zoom )
+ this
+ Sets the lower limit for the available zoom levels (see the minZoom option).
+
+
+
+ setMaxZoom (<Number> zoom )
+ this
+ Sets the upper limit for the available zoom levels (see the maxZoom option).
+
+
+
+ panInsideBounds (<LatLngBounds > bounds , <Pan options > options? )
+ this
+ Pans the map to the closest view that would lie inside the given bounds (if it's not already), controlling the animation using the options specific, if any.
+
+
+
+ panInside (<LatLng > latlng , <options> options? )
+ this
+ Pans the map the minimum amount to make the latlng visible. Use
+padding, paddingTopLeft and paddingTopRight options to fit
+the display to more restricted bounds, like fitBounds .
+If latlng is already within the (optionally padded) display bounds,
+the map will not be panned.
+
+
+
+ invalidateSize (<Zoom/pan options > options )
+ this
+ Checks if the map container size changed and updates the map if so —
+call it after you've changed the map size dynamically, also animating
+pan by default. If options.pan is false, panning will not occur.
+If options.debounceMoveend is true, it will delay moveend event so
+that it doesn't happen often even if the method is called many
+times in a row.
+
+
+
+ invalidateSize (<Boolean> animate )
+ this
+ Checks if the map container size changed and updates the map if so —
+call it after you've changed the map size dynamically, also animating
+pan by default.
+
+
+
+ stop ()
+ this
+ Stops the currently running panTo or flyTo animation, if any.
+
+
+
+
+
+
+Geolocation methods
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ locate (<Locate options > options? )
+ this
+ Tries to locate the user using the Geolocation API, firing a locationfound
+event with location data on success or a locationerror event on failure,
+and optionally sets the map view to the user's location with respect to
+detection accuracy (or to the world view if geolocation failed).
+Note that, if your page doesn't use HTTPS, this method will fail in
+modern browsers (Chrome 50 and newer )
+See Locate options for more details.
+
+
+
+ stopLocate ()
+ this
+ Stops watching location previously initiated by map.locate({watch: true})
+and aborts resetting the map view if map.locate was called with
+{setView: true}.
+
+
+
+
+
+
+Other Methods
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addHandler (<String> name , <Function> HandlerClass )
+ this
+ Adds a new Handler to the map, given its name and constructor function.
+
+
+
+ remove ()
+ this
+ Destroys the map and clears all related event listeners.
+
+
+
+ createPane (<String> name , <HTMLElement> container? )
+ HTMLElement
+ Creates a new map pane with the given name if it doesn't exist already,
+then returns it. The pane is created as a child of container, or
+as a child of the main map pane if not set.
+
+
+
+ getPane (<String|HTMLElement> pane )
+ HTMLElement
+ Returns a map pane , given its name or its HTML element (its identity).
+
+
+
+ getPanes ()
+ Object
+ Returns a plain object containing the names of all panes as keys and
+the panes as values.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTML element that contains the map.
+
+
+
+ whenReady (<Function> fn , <Object> context? )
+ this
+ Runs the given function fn when the map gets initialized with
+a view (center and zoom) and at least one layer, or immediately
+if it's already initialized, optionally passing a function context.
+
+
+
+
+
+
+Methods for Getting Map State
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getCenter ()
+ LatLng
+ Returns the geographical center of the map view
+
+
+
+ getZoom ()
+ Number
+ Returns the current zoom level of the map view
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the geographical bounds visible in the current map view
+
+
+
+ getMinZoom ()
+ Number
+ Returns the minimum zoom level of the map (if set in the minZoom option of the map or of any layers), or 0 by default.
+
+
+
+ getMaxZoom ()
+ Number
+ Returns the maximum zoom level of the map (if set in the maxZoom option of the map or of any layers).
+
+
+
+ getBoundsZoom (<LatLngBounds > bounds , <Boolean> inside? , <Point > padding? )
+ Number
+ Returns the maximum zoom level on which the given bounds fit to the map
+view in its entirety. If inside (optional) is set to true, the method
+instead returns the minimum zoom level on which the map view fits into
+the given bounds in its entirety.
+
+
+
+ getSize ()
+ Point
+ Returns the current size of the map container (in pixels).
+
+
+
+ getPixelBounds ()
+ Bounds
+ Returns the bounds of the current map view in projected pixel
+coordinates (sometimes useful in layer and overlay implementations).
+
+
+
+ getPixelOrigin ()
+ Point
+ Returns the projected pixel coordinates of the top left point of
+the map layer (useful in custom layer and overlay implementations).
+
+
+
+ getPixelWorldBounds (<Number> zoom? )
+ Bounds
+ Returns the world's bounds in pixel coordinates for zoom level zoom.
+If zoom is omitted, the map's current zoom level is used.
+
+
+
+
+
+
+Conversion Methods
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getZoomScale (<Number> toZoom , <Number> fromZoom )
+ Number
+ Returns the scale factor to be applied to a map transition from zoom level
+fromZoom to toZoom. Used internally to help with zoom animations.
+
+
+
+ getScaleZoom (<Number> scale , <Number> fromZoom )
+ Number
+ Returns the zoom level that the map would end up at, if it is at fromZoom
+level and everything is scaled by a factor of scale. Inverse of
+getZoomScale .
+
+
+
+ project (<LatLng > latlng , <Number> zoom )
+ Point
+ Projects a geographical coordinate LatLng according to the projection
+of the map's CRS, then scales it according to zoom and the CRS's
+Transformation . The result is pixel coordinate relative to
+the CRS origin.
+
+
+
+ unproject (<Point > point , <Number> zoom )
+ LatLng
+ Inverse of project .
+
+
+
+ layerPointToLatLng (<Point > point )
+ LatLng
+ Given a pixel coordinate relative to the origin pixel ,
+returns the corresponding geographical coordinate (for the current zoom level).
+
+
+
+ latLngToLayerPoint (<LatLng > latlng )
+ Point
+ Given a geographical coordinate, returns the corresponding pixel coordinate
+relative to the origin pixel .
+
+
+
+ wrapLatLng (<LatLng > latlng )
+ LatLng
+ Returns a LatLng where lat and lng has been wrapped according to the
+map's CRS's wrapLat and wrapLng properties, if they are outside the
+CRS's bounds.
+By default this means longitude is wrapped around the dateline so its
+value is between -180 and +180 degrees.
+
+
+
+ wrapLatLngBounds (<LatLngBounds > bounds )
+ LatLngBounds
+ Returns a LatLngBounds with the same size as the given one, ensuring that
+its center is within the CRS's bounds.
+By default this means the center longitude is wrapped around the dateline so its
+value is between -180 and +180 degrees, and the majority of the bounds
+overlaps the CRS's bounds.
+
+
+
+ distance (<LatLng > latlng1 , <LatLng > latlng2 )
+ Number
+ Returns the distance between two geographical coordinates according to
+the map's CRS. By default this measures distance in meters.
+
+
+
+ containerPointToLayerPoint (<Point > point )
+ Point
+ Given a pixel coordinate relative to the map container, returns the corresponding
+pixel coordinate relative to the origin pixel .
+
+
+
+ layerPointToContainerPoint (<Point > point )
+ Point
+ Given a pixel coordinate relative to the origin pixel ,
+returns the corresponding pixel coordinate relative to the map container.
+
+
+
+ containerPointToLatLng (<Point > point )
+ LatLng
+ Given a pixel coordinate relative to the map container, returns
+the corresponding geographical coordinate (for the current zoom level).
+
+
+
+ latLngToContainerPoint (<LatLng > latlng )
+ Point
+ Given a geographical coordinate, returns the corresponding pixel coordinate
+relative to the map container.
+
+
+
+ mouseEventToContainerPoint (<MouseEvent > ev )
+ Point
+ Given a MouseEvent object, returns the pixel coordinate relative to the
+map container where the event took place.
+
+
+
+ mouseEventToLayerPoint (<MouseEvent > ev )
+ Point
+ Given a MouseEvent object, returns the pixel coordinate relative to
+the origin pixel where the event took place.
+
+
+
+ mouseEventToLatLng (<MouseEvent > ev )
+ LatLng
+ Given a MouseEvent object, returns geographical coordinate where the
+event took place.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+
+Properties
+
+
+
+Controls
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ zoomControl
+ Control.Zoom
+ The default zoom control (only available if the
+zoomControl option was true when creating the map).
+
+
+
+
+
+Handlers
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ boxZoom
+ Handler
+ Box (shift-drag with mouse) zoom handler.
+
+
+ doubleClickZoom
+ Handler
+ Double click zoom handler.
+
+
+ dragging
+ Handler
+ Map dragging handler (by both mouse and touch).
+
+
+ keyboard
+ Handler
+ Keyboard navigation handler.
+
+
+ scrollWheelZoom
+ Handler
+ Scroll wheel zoom handler.
+
+
+ tap
+ Handler
+ Mobile touch hacks (quick tap and touch hold) handler.
+
+
+ touchZoom
+ Handler
+ Touch zoom handler.
+
+
+
+
+
+
+
+Map panes
+
+
+
+
+
+
+
+
+
+ Pane
+ Type
+ Z-index
+ Description
+
+
+
+ mapPane
+ HTMLElement
+ 'auto'
+ Pane that contains all other map panes
+
+
+ tilePane
+ HTMLElement
+ 200
+ Pane for GridLayer s and TileLayer s
+
+
+ overlayPane
+ HTMLElement
+ 400
+ Pane for vectors (Path s, like Polyline s and Polygon s), ImageOverlay s and VideoOverlay s
+
+
+ shadowPane
+ HTMLElement
+ 500
+ Pane for overlay shadows (e.g. Marker shadows)
+
+
+ markerPane
+ HTMLElement
+ 600
+ Pane for Icon s of Marker s
+
+
+ tooltipPane
+ HTMLElement
+ 650
+ Pane for Tooltip s.
+
+
+
+
+
+
+
+
+
+
+Locate options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ watch
+ Boolean
+ false
+ If true, starts continuous watching of location changes (instead of detecting it
+once) using W3C watchPosition method. You can later stop watching using
+map.stopLocate() method.
+
+
+ setView
+ Boolean
+ false
+ If true, automatically sets the map view to the user location with respect to
+detection accuracy, or to world view if geolocation failed.
+
+
+ maxZoom
+ Number
+ Infinity
+ The maximum zoom for automatic view setting when using setView option.
+
+
+ timeout
+ Number
+ 10000
+ Number of milliseconds to wait for a response from geolocation before firing a
+locationerror event.
+
+
+ maximumAge
+ Number
+ 0
+ Maximum age of detected location. If less than this amount of milliseconds
+passed since last geolocation response, locate will return a cached location.
+
+
+ enableHighAccuracy
+ Boolean
+ false
+ Enables high accuracy, see description in the W3C spec .
+
+
+
+
+
+
+
+
+
+Zoom options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ animate
+ Boolean
+
+ If not specified, zoom animation will happen if the zoom origin is inside the
+current view. If true, the map will attempt animating zoom disregarding where
+zoom origin is. Setting false will make it always reset the view completely
+without animation.
+
+
+
+
+
+
+
+
+
+Pan options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ animate
+ Boolean
+
+ If true, panning will always be animated if possible. If false, it will
+not animate panning, either resetting the map view if panning more than a
+screen away, or just setting a new offset for the map pane (except for panBy
+which always does the latter).
+
+
+ duration
+ Number
+ 0.25
+ Duration of animated panning, in seconds.
+
+
+ easeLinearity
+ Number
+ 0.25
+ The curvature factor of panning animation easing (third parameter of the
+Cubic Bezier curve ). 1.0 means linear animation,
+and the smaller this number, the more bowed the curve.
+
+
+ noMoveStart
+ Boolean
+ false
+ If true, panning won't fire movestart event on start (used internally for
+panning inertia).
+
+
+
+
+
+
+
+
+
+Zoom/pan options
+
+
+
+
+
+
▶ Options inherited from Zoom options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ animate
+ Boolean
+
+ If not specified, zoom animation will happen if the zoom origin is inside the
+current view. If true, the map will attempt animating zoom disregarding where
+zoom origin is. Setting false will make it always reset the view completely
+without animation.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Pan options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ duration
+ Number
+ 0.25
+ Duration of animated panning, in seconds.
+
+
+ easeLinearity
+ Number
+ 0.25
+ The curvature factor of panning animation easing (third parameter of the
+Cubic Bezier curve ). 1.0 means linear animation,
+and the smaller this number, the more bowed the curve.
+
+
+ noMoveStart
+ Boolean
+ false
+ If true, panning won't fire movestart event on start (used internally for
+panning inertia).
+
+
+
+
+
+
+
+
+
+
+FitBounds options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ paddingTopLeft
+ Point
+ [0, 0]
+ Sets the amount of padding in the top left corner of a map container that
+shouldn't be accounted for when setting the view to fit bounds. Useful if you
+have some control overlays on the map like a sidebar and you don't want them
+to obscure objects you're zooming to.
+
+
+ paddingBottomRight
+ Point
+ [0, 0]
+ The same for the bottom right corner of the map.
+
+
+ padding
+ Point
+ [0, 0]
+ Equivalent of setting both top left and bottom right padding to the same value.
+
+
+ maxZoom
+ Number
+ null
+ The maximum possible zoom to use.
+
+
+
+
+
+
+
+
▶ Options inherited from Zoom options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ animate
+ Boolean
+
+ If not specified, zoom animation will happen if the zoom origin is inside the
+current view. If true, the map will attempt animating zoom disregarding where
+zoom origin is. Setting false will make it always reset the view completely
+without animation.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Pan options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ duration
+ Number
+ 0.25
+ Duration of animated panning, in seconds.
+
+
+ easeLinearity
+ Number
+ 0.25
+ The curvature factor of panning animation easing (third parameter of the
+Cubic Bezier curve ). 1.0 means linear animation,
+and the smaller this number, the more bowed the curve.
+
+
+ noMoveStart
+ Boolean
+ false
+ If true, panning won't fire movestart event on start (used internally for
+panning inertia).
+
+
+
+
+
+
+
+ Marker L.Marker is used to display clickable/draggable icons on the map. Extends Layer .
+
+
+Usage example
+
+
+
+
+
+
+
+L.marker([50.5, 30.5]).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.marker (<LatLng > latlng , <Marker options > options? )
+ Instantiates a Marker object given a geographical point and optionally an options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ icon
+ Icon
+ *
+ Icon instance to use for rendering the marker.
+See Icon documentation for details on how to customize the marker icon.
+If not specified, a common instance of L.Icon.Default is used.
+
+
+ keyboard
+ Boolean
+ true
+ Whether the marker can be tabbed to with a keyboard and clicked by pressing enter.
+
+
+ title
+ String
+ ''
+ Text for the browser tooltip that appear on marker hover (no tooltip by default).
+
+
+ alt
+ String
+ ''
+ Text for the alt attribute of the icon image (useful for accessibility).
+
+
+ zIndexOffset
+ Number
+ 0
+ By default, marker images zIndex is set automatically based on its latitude. Use this option if you want to put the marker on top of all others (or below), specifying a high value like 1000 (or high negative value, respectively).
+
+
+ opacity
+ Number
+ 1.0
+ The opacity of the marker.
+
+
+ riseOnHover
+ Boolean
+ false
+ If true, the marker will get on top of others when you hover the mouse over it.
+
+
+ riseOffset
+ Number
+ 250
+ The z-index offset used for the riseOnHover feature.
+
+
+ pane
+ String
+ 'markerPane'
+ Map pane where the markers icon will be added.
+
+
+ bubblingMouseEvents
+ Boolean
+ false
+ When true, a mouse event on this marker will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+
+
+
+Draggable marker options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ draggable
+ Boolean
+ false
+ Whether the marker is draggable with mouse/touch or not.
+
+
+ autoPan
+ Boolean
+ false
+ Whether to pan the map when dragging this marker near its edge or not.
+
+
+ autoPanPadding
+ Point
+ Point(50, 50)
+ Distance (in pixels to the left/right and to the top/bottom) of the
+map edge to start panning the map.
+
+
+ autoPanSpeed
+ Number
+ 10
+ Number of pixels the map should pan by.
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ move
+ Event
+ Fired when the marker is moved via setLatLng or by dragging . Old and new coordinates are included in event arguments as oldLatLng, latlng .
+
+
+
+
+
+Dragging events
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ dragstart
+ Event
+ Fired when the user starts dragging the marker.
+
+
+ movestart
+ Event
+ Fired when the marker starts moving (because of dragging).
+
+
+ drag
+ Event
+ Fired repeatedly while the user drags the marker.
+
+
+ dragend
+ DragEndEvent
+ Fired when the user stops dragging the marker.
+
+
+ moveend
+ Event
+ Fired when the marker stops moving (because of dragging).
+
+
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON (<Number> precision )
+ Object
+ Returns a GeoJSON representation of the marker (as a GeoJSON Point Feature).
+
+
+
+ getLatLng ()
+ LatLng
+ Returns the current geographical position of the marker.
+
+
+
+ setLatLng (<LatLng > latlng )
+ this
+ Changes the marker position to the given point.
+
+
+
+ setZIndexOffset (<Number> offset )
+ this
+ Changes the zIndex offset of the marker.
+
+
+
+ setIcon (<Icon > icon )
+ this
+ Changes the marker icon.
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Changes the opacity of the marker.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+
+Properties
+
+
+
+Interaction handlers
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ dragging
+ Handler
+ Marker dragging handler (by both mouse and touch). Only valid when the marker is on the map (Otherwise set marker.options.draggable ).
+
+
+
+
+
+
+ Used to open popups in certain places of the map. Use Map.openPopup to
+open popups while making sure that only one popup is open at one time
+(recommended for usability), or use Map.addLayer to open as many as you want.
+
+
+
+
+
+
+
+
+
+
+If you want to just bind a popup to marker click and then open it, it's really easy:
+marker.bindPopup(popupContent).openPopup();
+
+Path overlays like polylines also have a bindPopup method.
+Here's a more complicated way to open a popup on a map:
+var popup = L.popup()
+ .setLatLng(latlng)
+ .setContent('<p>Hello world!<br />This is a nice popup.</p>')
+ .openOn(map);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Options inherited from DivOverlay
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Used to display small texts on top of map layers.
+
+
+
+
+
+
+
+
+
+
+marker.bindTooltip("my tooltip text").openTooltip();
+
+Note about tooltip offset. Leaflet takes two options in consideration
+for computing tooltip offsetting:
+
+the offset Tooltip option: it defaults to [0, 0], and it's specific to one tooltip.
+Add a positive x offset to move the tooltip to the right, and a positive y offset to
+move it to the bottom. Negatives will move to the left and top.
+the tooltipAnchor Icon option: this will only be considered for Marker. You
+should adapt this value if you use a custom icon.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.tooltip (<Tooltip options > options? , <Layer > source? )
+ Instantiates a Tooltip object given an optional options object that describes its appearance and location and an optional source object that is used to tag the tooltip with a reference to the Layer to which it refers.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'tooltipPane'
+ Map pane where the tooltip will be added.
+
+
+ offset
+ Point
+ Point(0, 0)
+ Optional offset of the tooltip position.
+
+
+ direction
+ String
+ 'auto'
+ Direction where to open the tooltip. Possible values are: right, left,
+top, bottom, center, auto.
+auto will dynamically switch between right and left according to the tooltip
+position on the map.
+
+
+ permanent
+ Boolean
+ false
+ Whether to open the tooltip permanently or only on mouseover.
+
+
+ sticky
+ Boolean
+ false
+ If true, the tooltip will follow the mouse instead of being fixed at the feature center.
+
+
+ interactive
+ Boolean
+ false
+ If true, the tooltip will listen to the feature events.
+
+
+ opacity
+ Number
+ 0.9
+ Tooltip container opacity.
+
+
+
+
+
+
+
+
▶ Options inherited from DivOverlay
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ className
+ String
+ ''
+ A custom CSS class name to assign to the popup.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ TileLayer Used to load and display tile layers on the map. Note that most tile servers require attribution, which you can set under Layer . Extends GridLayer .
+
+
+Usage example
+
+
+
+
+
+
+
+L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png?{foo}', {foo: 'bar', attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'}).addTo(map);
+
+
+
+
+
+
+URL template
+
+
+
+A string of the following form:
+'http://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png'
+{s} means one of the available subdomains (used sequentially to help with browser parallel requests per domain limitation; subdomain values are specified in options; a, b or c by default, can be omitted), {z} — zoom level, {x} and {y} — tile coordinates. {r} can be used to add "@2x" to the URL to load retina tiles.
+You can use custom keys in the template, which will be evaluated from TileLayer options, like this:
+L.tileLayer('http://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png', {foo: 'bar'});
+
+
+
+
+
+
+
+Creation
+
+
+
+Extension methods
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.tilelayer (<String> urlTemplate , <TileLayer options > options? )
+ Instantiates a tile layer object given a URL template and optionally an options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ minZoom
+ Number
+ 0
+ The minimum zoom level down to which this layer will be displayed (inclusive).
+
+
+ maxZoom
+ Number
+ 18
+ The maximum zoom level up to which this layer will be displayed (inclusive).
+
+
+ subdomains
+ String|String[]
+ 'abc'
+ Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.
+
+
+ errorTileUrl
+ String
+ ''
+ URL to the tile image to show in place of the tile that failed to load.
+
+
+ zoomOffset
+ Number
+ 0
+ The zoom number used in tile URLs will be offset with this value.
+
+
+ tms
+ Boolean
+ false
+ If true, inverses Y axis numbering for tiles (turn this on for TMS services).
+
+
+ zoomReverse
+ Boolean
+ false
+ If set to true, the zoom number used in tile URLs will be reversed (maxZoom - zoom instead of zoom)
+
+
+ detectRetina
+ Boolean
+ false
+ If true and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.
+
+
+ crossOrigin
+ Boolean|String
+ false
+ Whether the crossOrigin attribute will be added to the tiles.
+If a String is provided, all tiles will have their crossOrigin attribute set to the String provided. This is needed if you want to access tile pixel data.
+Refer to CORS Settings for valid String values.
+
+
+
+
+
+
+
+
▶ Options inherited from GridLayer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ tileSize
+ Number|Point
+ 256
+ Width and height of tiles in the grid. Use a number if width and height are equal, or L.point(width, height) otherwise.
+
+
+ opacity
+ Number
+ 1.0
+ Opacity of the tiles. Can be used in the createTile() function.
+
+
+ updateWhenIdle
+ Boolean
+ (depends)
+ Load new tiles only when panning ends.
+true by default on mobile browsers, in order to avoid too many requests and keep smooth navigation.
+false otherwise in order to display new tiles during panning, since it is easy to pan outside the
+keepBuffer option in desktop browsers.
+
+
+ updateWhenZooming
+ Boolean
+ true
+ By default, a smooth zoom animation (during a touch zoom or a flyTo() ) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends.
+
+
+ updateInterval
+ Number
+ 200
+ Tiles will not update more than once every updateInterval milliseconds when panning.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the tile layer.
+
+
+ bounds
+ LatLngBounds
+ undefined
+ If set, tiles will only be loaded inside the set LatLngBounds .
+
+
+ maxNativeZoom
+ Number
+ undefined
+ Maximum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels higher than maxNativeZoom will be loaded
+from maxNativeZoom level and auto-scaled.
+
+
+ minNativeZoom
+ Number
+ undefined
+ Minimum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels lower than minNativeZoom will be loaded
+from minNativeZoom level and auto-scaled.
+
+
+ noWrap
+ Boolean
+ false
+ Whether the layer is wrapped around the antimeridian. If true, the
+GridLayer will only be displayed once at low zoom levels. Has no
+effect when the map CRS doesn't wrap around. Can be used
+in combination with bounds to prevent requesting
+tiles outside the CRS limits.
+
+
+ pane
+ String
+ 'tilePane'
+ Map pane where the grid layer will be added.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the tile layer. Empty by default.
+
+
+ keepBuffer
+ Number
+ 2
+ When panning the map, keep this many rows and columns of tiles before unloading them.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from GridLayer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ loading
+ Event
+ Fired when the grid layer starts loading tiles.
+
+
+ tileunload
+ TileEvent
+ Fired when a tile is removed (e.g. when a tile goes off the screen).
+
+
+ tileloadstart
+ TileEvent
+ Fired when a tile is requested and starts loading.
+
+
+ tileerror
+ TileErrorEvent
+ Fired when there is an error loading a tile.
+
+
+ tileload
+ TileEvent
+ Fired when a tile loads.
+
+
+ load
+ Event
+ Fired when the grid layer loaded all visible tiles.
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setUrl (<String> url , <Boolean> noRedraw? )
+ this
+ Updates the layer's URL template and redraws it (unless noRedraw is set to true).
+If the URL does not change, the layer will not be redrawn unless
+the noRedraw parameter is set to false.
+
+
+
+ createTile (<Object> coords , <Function> done? )
+ HTMLElement
+ Called only internally, overrides GridLayer's createTile()
+to return an <img> HTML element with the appropriate image URL given coords. The done
+callback is called when the tile has been loaded.
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getTileUrl (<Object> coords )
+ String
+ Called only internally, returns the URL for a tile given its coordinates.
+Classes extending TileLayer can override this function to provide custom tile URL naming schemes.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from GridLayer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bringToFront ()
+ this
+ Brings the tile layer to the top of all tile layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the tile layer to the bottom of all tile layers.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTML element that contains the tiles for this layer.
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Changes the opacity of the grid layer.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Changes the zIndex of the grid layer.
+
+
+
+ isLoading ()
+ Boolean
+ Returns true if any tile in the grid layer has not finished loading.
+
+
+
+ redraw ()
+ this
+ Causes the layer to clear all the tiles and request them again.
+
+
+
+ getTileSize ()
+ Point
+ Normalizes the tileSize option into a point. Used by the createTile() method.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ TileLayer.WMS Used to display WMS services as tile layers on the map. Extends TileLayer .
+
+
+Usage example
+
+
+
+
+
+
+
+var nexrad = L.tileLayer.wms("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi", {
+ layers: 'nexrad-n0r-900913',
+ format: 'image/png',
+ transparent: true,
+ attribution: "Weather data © 2012 IEM Nexrad"
+});
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.tileLayer.wms (<String> baseUrl , <TileLayer.WMS options > options )
+ Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ layers
+ String
+ ''
+ (required) Comma-separated list of WMS layers to show.
+
+
+ styles
+ String
+ ''
+ Comma-separated list of WMS styles.
+
+
+ format
+ String
+ 'image/jpeg'
+ WMS image format (use 'image/png' for layers with transparency).
+
+
+ transparent
+ Boolean
+ false
+ If true, the WMS service will return images with transparency.
+
+
+ version
+ String
+ '1.1.1'
+ Version of the WMS service to use
+
+
+ crs
+ CRS
+ null
+ Coordinate Reference System to use for the WMS requests, defaults to
+map CRS. Don't change this if you're not sure what it means.
+
+
+ uppercase
+ Boolean
+ false
+ If true, WMS request parameter keys will be uppercase.
+
+
+
+
+
+
+
+
▶ Options inherited from TileLayer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ minZoom
+ Number
+ 0
+ The minimum zoom level down to which this layer will be displayed (inclusive).
+
+
+ maxZoom
+ Number
+ 18
+ The maximum zoom level up to which this layer will be displayed (inclusive).
+
+
+ subdomains
+ String|String[]
+ 'abc'
+ Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.
+
+
+ errorTileUrl
+ String
+ ''
+ URL to the tile image to show in place of the tile that failed to load.
+
+
+ zoomOffset
+ Number
+ 0
+ The zoom number used in tile URLs will be offset with this value.
+
+
+ tms
+ Boolean
+ false
+ If true, inverses Y axis numbering for tiles (turn this on for TMS services).
+
+
+ zoomReverse
+ Boolean
+ false
+ If set to true, the zoom number used in tile URLs will be reversed (maxZoom - zoom instead of zoom)
+
+
+ detectRetina
+ Boolean
+ false
+ If true and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.
+
+
+ crossOrigin
+ Boolean|String
+ false
+ Whether the crossOrigin attribute will be added to the tiles.
+If a String is provided, all tiles will have their crossOrigin attribute set to the String provided. This is needed if you want to access tile pixel data.
+Refer to CORS Settings for valid String values.
+
+
+
+
+
+
+
+
+
▶ Options inherited from GridLayer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ tileSize
+ Number|Point
+ 256
+ Width and height of tiles in the grid. Use a number if width and height are equal, or L.point(width, height) otherwise.
+
+
+ opacity
+ Number
+ 1.0
+ Opacity of the tiles. Can be used in the createTile() function.
+
+
+ updateWhenIdle
+ Boolean
+ (depends)
+ Load new tiles only when panning ends.
+true by default on mobile browsers, in order to avoid too many requests and keep smooth navigation.
+false otherwise in order to display new tiles during panning, since it is easy to pan outside the
+keepBuffer option in desktop browsers.
+
+
+ updateWhenZooming
+ Boolean
+ true
+ By default, a smooth zoom animation (during a touch zoom or a flyTo() ) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends.
+
+
+ updateInterval
+ Number
+ 200
+ Tiles will not update more than once every updateInterval milliseconds when panning.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the tile layer.
+
+
+ bounds
+ LatLngBounds
+ undefined
+ If set, tiles will only be loaded inside the set LatLngBounds .
+
+
+ maxNativeZoom
+ Number
+ undefined
+ Maximum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels higher than maxNativeZoom will be loaded
+from maxNativeZoom level and auto-scaled.
+
+
+ minNativeZoom
+ Number
+ undefined
+ Minimum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels lower than minNativeZoom will be loaded
+from minNativeZoom level and auto-scaled.
+
+
+ noWrap
+ Boolean
+ false
+ Whether the layer is wrapped around the antimeridian. If true, the
+GridLayer will only be displayed once at low zoom levels. Has no
+effect when the map CRS doesn't wrap around. Can be used
+in combination with bounds to prevent requesting
+tiles outside the CRS limits.
+
+
+ pane
+ String
+ 'tilePane'
+ Map pane where the grid layer will be added.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the tile layer. Empty by default.
+
+
+ keepBuffer
+ Number
+ 2
+ When panning the map, keep this many rows and columns of tiles before unloading them.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from GridLayer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ loading
+ Event
+ Fired when the grid layer starts loading tiles.
+
+
+ tileunload
+ TileEvent
+ Fired when a tile is removed (e.g. when a tile goes off the screen).
+
+
+ tileloadstart
+ TileEvent
+ Fired when a tile is requested and starts loading.
+
+
+ tileerror
+ TileErrorEvent
+ Fired when there is an error loading a tile.
+
+
+ tileload
+ TileEvent
+ Fired when a tile loads.
+
+
+ load
+ Event
+ Fired when the grid layer loaded all visible tiles.
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setParams (<Object> params , <Boolean> noRedraw? )
+ this
+ Merges an object with the new parameters and re-requests tiles on the current screen (unless noRedraw was set to true).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from TileLayer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setUrl (<String> url , <Boolean> noRedraw? )
+ this
+ Updates the layer's URL template and redraws it (unless noRedraw is set to true).
+If the URL does not change, the layer will not be redrawn unless
+the noRedraw parameter is set to false.
+
+
+
+ createTile (<Object> coords , <Function> done? )
+ HTMLElement
+ Called only internally, overrides GridLayer's createTile()
+to return an <img> HTML element with the appropriate image URL given coords. The done
+callback is called when the tile has been loaded.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from GridLayer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bringToFront ()
+ this
+ Brings the tile layer to the top of all tile layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the tile layer to the bottom of all tile layers.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTML element that contains the tiles for this layer.
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Changes the opacity of the grid layer.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Changes the zIndex of the grid layer.
+
+
+
+ isLoading ()
+ Boolean
+ Returns true if any tile in the grid layer has not finished loading.
+
+
+
+ redraw ()
+ this
+ Causes the layer to clear all the tiles and request them again.
+
+
+
+ getTileSize ()
+ Point
+ Normalizes the tileSize option into a point. Used by the createTile() method.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ ImageOverlay Used to load and display a single image over specific bounds of the map. Extends Layer .
+
+
+Usage example
+
+
+
+
+
+
+
+var imageUrl = 'http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg',
+ imageBounds = [[40.712216, -74.22655], [40.773941, -74.12544]];
+L.imageOverlay(imageUrl, imageBounds).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.imageOverlay (<String> imageUrl , <LatLngBounds > bounds , <ImageOverlay options > options? )
+ Instantiates an image overlay object given the URL of the image and the
+geographical bounds it is tied to.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ opacity
+ Number
+ 1.0
+ The opacity of the image overlay.
+
+
+ alt
+ String
+ ''
+ Text for the alt attribute of the image (useful for accessibility).
+
+
+ interactive
+ Boolean
+ false
+ If true, the image overlay will emit mouse events when clicked or hovered.
+
+
+ crossOrigin
+ Boolean|String
+ false
+ Whether the crossOrigin attribute will be added to the image.
+If a String is provided, the image will have its crossOrigin attribute set to the String provided. This is needed if you want to access image pixel data.
+Refer to CORS Settings for valid String values.
+
+
+ errorOverlayUrl
+ String
+ ''
+ URL to the overlay image to show in place of the overlay that failed to load.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the overlay layer.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the image. Empty by default.
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this layer will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ load
+ Event
+ Fired when the ImageOverlay layer has loaded its image
+
+
+ error
+ Event
+ Fired when the ImageOverlay layer fails to load its image
+
+
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Sets the opacity of the overlay.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all overlays.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all overlays.
+
+
+
+ setUrl (<String> url )
+ this
+ Changes the URL of the image.
+
+
+
+ setBounds (<LatLngBounds > bounds )
+ this
+ Update the bounds that this ImageOverlay covers
+
+
+
+ setZIndex (<Number> value )
+ this
+ Changes the zIndex of the image overlay.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Get the bounds that this ImageOverlay covers
+
+
+
+ getElement ()
+ HTMLElement
+ Returns the instance of HTMLImageElement
+used by this overlay.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ VideoOverlay Used to load and display a video player over specific bounds of the map. Extends ImageOverlay .
+A video overlay uses the <video>
+HTML5 element.
+
+
+Usage example
+
+
+
+
+
+
+
+var videoUrl = 'https://www.mapbox.com/bites/00188/patricia_nasa.webm',
+ videoBounds = [[ 32, -130], [ 13, -100]];
+L.videoOverlay(videoUrl, videoBounds ).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.videoOverlay (<String|Array|HTMLVideoElement> video , <LatLngBounds > bounds , <VideoOverlay options > options? )
+ Instantiates an image overlay object given the URL of the video (or array of URLs, or even a video element) and the
+geographical bounds it is tied to.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ autoplay
+ Boolean
+ true
+ Whether the video starts playing automatically when loaded.
+
+
+ loop
+ Boolean
+ true
+ Whether the video will loop back to the beginning when played.
+
+
+
+
+
+
+
+
▶ Options inherited from ImageOverlay
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ opacity
+ Number
+ 1.0
+ The opacity of the image overlay.
+
+
+ alt
+ String
+ ''
+ Text for the alt attribute of the image (useful for accessibility).
+
+
+ interactive
+ Boolean
+ false
+ If true, the image overlay will emit mouse events when clicked or hovered.
+
+
+ crossOrigin
+ Boolean|String
+ false
+ Whether the crossOrigin attribute will be added to the image.
+If a String is provided, the image will have its crossOrigin attribute set to the String provided. This is needed if you want to access image pixel data.
+Refer to CORS Settings for valid String values.
+
+
+ errorOverlayUrl
+ String
+ ''
+ URL to the overlay image to show in place of the overlay that failed to load.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the overlay layer.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the image. Empty by default.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this layer will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ load
+ Event
+ Fired when the video has finished loading the first frame
+
+
+
+
+
+
+
+
▶ Events inherited from ImageOverlay
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ error
+ Event
+ Fired when the ImageOverlay layer fails to load its image
+
+
+
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getElement ()
+ HTMLVideoElement
+ Returns the instance of HTMLVideoElement
+used by this overlay.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from ImageOverlay
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Sets the opacity of the overlay.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all overlays.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all overlays.
+
+
+
+ setUrl (<String> url )
+ this
+ Changes the URL of the image.
+
+
+
+ setBounds (<LatLngBounds > bounds )
+ this
+ Update the bounds that this ImageOverlay covers
+
+
+
+ setZIndex (<Number> value )
+ this
+ Changes the zIndex of the image overlay.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Get the bounds that this ImageOverlay covers
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Path An abstract class that contains options and constants shared between vector
+overlays (Polygon, Polyline, Circle). Do not use it directly. Extends Layer .
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Polyline A class for drawing polyline overlays on a map. Extends Path .
+
+
+Usage example
+
+
+
+
+
+
+
+// create a red polyline from an array of LatLng points
+var latlngs = [
+ [45.51, -122.68],
+ [37.77, -122.43],
+ [34.04, -118.2]
+];
+var polyline = L.polyline(latlngs, {color: 'red'}).addTo(map);
+// zoom the map to the polyline
+map.fitBounds(polyline.getBounds());
+
+You can also pass a multi-dimensional array to represent a MultiPolyline shape:
+// create a red polyline from an array of arrays of LatLng points
+var latlngs = [
+ [[45.51, -122.68],
+ [37.77, -122.43],
+ [34.04, -118.2]],
+ [[40.78, -73.91],
+ [41.83, -87.62],
+ [32.76, -96.72]]
+];
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.polyline (<LatLng[]> latlngs , <Polyline options > options? )
+ Instantiates a polyline object given an array of geographical points and
+optionally an options object. You can create a Polyline object with
+multiple separate lines (MultiPolyline) by passing an array of arrays
+of geographic points.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ smoothFactor
+ Number
+ 1.0
+ How much to simplify the polyline on each zoom level. More means
+better performance and smoother look, and less means more accurate representation.
+
+
+ noClip
+ Boolean
+ false
+ Disable polyline clipping.
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON (<Number> precision )
+ Object
+ Returns a GeoJSON representation of the polyline (as a GeoJSON LineString or MultiLineString Feature).
+
+
+
+ getLatLngs ()
+ LatLng[]
+ Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.
+
+
+
+ setLatLngs (<LatLng[]> latlngs )
+ this
+ Replaces all the points in the polyline with the given array of geographical points.
+
+
+
+ isEmpty ()
+ Boolean
+ Returns true if the Polyline has no LatLngs.
+
+
+
+ closestLayerPoint (<Point > p )
+ Point
+ Returns the point closest to p on the Polyline.
+
+
+
+ getCenter ()
+ LatLng
+ Returns the center (centroid ) of the polyline.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the path.
+
+
+
+ addLatLng (<LatLng > latlng )
+ this
+ Adds a given point to the polyline. By default, adds to the first ring of
+the polyline in case of a multi-polyline, but can be overridden by passing
+a specific ring as a LatLng array (that you can earlier access with getLatLngs ).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Polygon A class for drawing polygon overlays on a map. Extends Polyline .
+Note that points you pass when creating a polygon shouldn't have an additional last point equal to the first one — it's better to filter out such points.
+
+
+Usage example
+
+
+
+
+
+
+
+// create a red polygon from an array of LatLng points
+var latlngs = [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]];
+var polygon = L.polygon(latlngs, {color: 'red'}).addTo(map);
+// zoom the map to the polygon
+map.fitBounds(polygon.getBounds());
+
+You can also pass an array of arrays of latlngs, with the first array representing the outer shape and the other arrays representing holes in the outer shape:
+var latlngs = [
+ [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring
+ [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole
+];
+
+Additionally, you can pass a multi-dimensional array to represent a MultiPolygon shape.
+var latlngs = [
+ [ // first polygon
+ [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring
+ [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole
+ ],
+ [ // second polygon
+ [[41, -111.03],[45, -111.04],[45, -104.05],[41, -104.05]]
+ ]
+];
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.polygon (<LatLng[]> latlngs , <Polyline options > options? )
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Polyline
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ smoothFactor
+ Number
+ 1.0
+ How much to simplify the polyline on each zoom level. More means
+better performance and smoother look, and less means more accurate representation.
+
+
+ noClip
+ Boolean
+ false
+ Disable polyline clipping.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON (<Number> precision )
+ Object
+ Returns a GeoJSON representation of the polygon (as a GeoJSON Polygon or MultiPolygon Feature).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Polyline
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getLatLngs ()
+ LatLng[]
+ Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.
+
+
+
+ setLatLngs (<LatLng[]> latlngs )
+ this
+ Replaces all the points in the polyline with the given array of geographical points.
+
+
+
+ isEmpty ()
+ Boolean
+ Returns true if the Polyline has no LatLngs.
+
+
+
+ closestLayerPoint (<Point > p )
+ Point
+ Returns the point closest to p on the Polyline.
+
+
+
+ getCenter ()
+ LatLng
+ Returns the center (centroid ) of the polyline.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the path.
+
+
+
+ addLatLng (<LatLng > latlng )
+ this
+ Adds a given point to the polyline. By default, adds to the first ring of
+the polyline in case of a multi-polyline, but can be overridden by passing
+a specific ring as a LatLng array (that you can earlier access with getLatLngs ).
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Rectangle A class for drawing rectangle overlays on a map. Extends Polygon .
+
+
+Usage example
+
+
+
+
+
+
+
+// define rectangle geographical bounds
+var bounds = [[54.559322, -5.767822], [56.1210604, -3.021240]];
+// create an orange rectangle
+L.rectangle(bounds, {color: "#ff7800", weight: 1}).addTo(map);
+// zoom the map to the rectangle bounds
+map.fitBounds(bounds);
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Polyline
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ smoothFactor
+ Number
+ 1.0
+ How much to simplify the polyline on each zoom level. More means
+better performance and smoother look, and less means more accurate representation.
+
+
+ noClip
+ Boolean
+ false
+ Disable polyline clipping.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setBounds (<LatLngBounds > latLngBounds )
+ this
+ Redraws the rectangle with the passed bounds.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Polygon
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON (<Number> precision )
+ Object
+ Returns a GeoJSON representation of the polygon (as a GeoJSON Polygon or MultiPolygon Feature).
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Polyline
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getLatLngs ()
+ LatLng[]
+ Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.
+
+
+
+ setLatLngs (<LatLng[]> latlngs )
+ this
+ Replaces all the points in the polyline with the given array of geographical points.
+
+
+
+ isEmpty ()
+ Boolean
+ Returns true if the Polyline has no LatLngs.
+
+
+
+ closestLayerPoint (<Point > p )
+ Point
+ Returns the point closest to p on the Polyline.
+
+
+
+ getCenter ()
+ LatLng
+ Returns the center (centroid ) of the polyline.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the path.
+
+
+
+ addLatLng (<LatLng > latlng )
+ this
+ Adds a given point to the polyline. By default, adds to the first ring of
+the polyline in case of a multi-polyline, but can be overridden by passing
+a specific ring as a LatLng array (that you can earlier access with getLatLngs ).
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Circle A class for drawing circle overlays on a map. Extends CircleMarker .
+It's an approximation and starts to diverge from a real circle closer to poles (due to projection distortion).
+
+
+Usage example
+
+
+
+
+
+
+
+L.circle([50.5, 30.5], {radius: 200}).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.circle (<LatLng > latlng , <Circle options > options? )
+ Instantiates a circle object given a geographical point, and an options object
+which contains the circle radius.
+
+
+ L.circle (<LatLng > latlng , <Number> radius , <Circle options > options? )
+ Obsolete way of instantiating a circle, for compatibility with 0.7.x code.
+Do not use in new applications or plugins.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ radius
+ Number
+
+ Radius of the circle, in meters.
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setRadius (<Number> radius )
+ this
+ Sets the radius of a circle. Units are in meters.
+
+
+
+ getRadius ()
+ Number
+ Returns the current radius of a circle. Units are in meters.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the path.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from CircleMarker
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON (<Number> precision )
+ Object
+ Returns a GeoJSON representation of the circle marker (as a GeoJSON Point Feature).
+
+
+
+ setLatLng (<LatLng > latLng )
+ this
+ Sets the position of a circle marker to a new location.
+
+
+
+ getLatLng ()
+ LatLng
+ Returns the current geographical position of the circle marker
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ CircleMarker A circle of a fixed size with radius specified in pixels. Extends Path .
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.circleMarker (<LatLng > latlng , <CircleMarker options > options? )
+ Instantiates a circle marker object given a geographical point, and an optional options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ radius
+ Number
+ 10
+ Radius of the circle marker, in pixels
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON (<Number> precision )
+ Object
+ Returns a GeoJSON representation of the circle marker (as a GeoJSON Point Feature).
+
+
+
+ setLatLng (<LatLng > latLng )
+ this
+ Sets the position of a circle marker to a new location.
+
+
+
+ getLatLng ()
+ LatLng
+ Returns the current geographical position of the circle marker
+
+
+
+ setRadius (<Number> radius )
+ this
+ Sets the radius of a circle marker. Units are in pixels.
+
+
+
+ getRadius ()
+ Number
+ Returns the current radius of the circle
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ SVG Allows vector layers to be displayed with SVG .
+Inherits Renderer .
+Due to technical limitations , SVG is not
+available in all web browsers, notably Android 2.x and 3.x.
+Although SVG is not available on IE7 and IE8, these browsers support
+VML
+(a now deprecated technology), and the SVG renderer will fall back to VML in
+this case.
+VML was deprecated in 2012, which means VML functionality exists only for backwards compatibility
+with old versions of Internet Explorer.
+
+
+Usage example
+
+
+
+
+
+
+
+Use SVG by default for all paths in the map:
+var map = L.map('map', {
+ renderer: L.svg()
+});
+
+Use a SVG renderer with extra padding for specific vector geometries:
+var map = L.map('map');
+var myRenderer = L.svg({ padding: 0.5 });
+var line = L.polyline( coordinates, { renderer: myRenderer } );
+var circle = L.circle( center, { renderer: myRenderer } );
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.svg (<Renderer options > options? )
+ Creates a SVG renderer with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Renderer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ padding
+ Number
+ 0.1
+ How much to extend the clip area around the map view (relative to its size)
+e.g. 0.1 would be 10% of map view in each direction
+
+
+ tolerance
+ Number
+ 0
+ How much to extend click tolerance round a path/object on the map
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Renderer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ update
+ Event
+ Fired when the renderer updates its bounds, center and zoom, for example when
+its map has moved
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+
+Functions
+
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ create (<String> name )
+ SVGElement
+ Returns a instance of SVGElement ,
+corresponding to the class name passed. For example, using 'line' will return
+an instance of SVGLineElement .
+
+
+ pointsToPath (<Point[]> rings , <Boolean> closed )
+ String
+ Generates a SVG path string for multiple rings, with each ring turning
+into "M..L..L.." instructions
+
+
+
+
+
+
+ Canvas Allows vector layers to be displayed with <canvas> .
+Inherits Renderer .
+Due to technical limitations , Canvas is not
+available in all web browsers, notably IE8, and overlapping geometries might
+not display properly in some edge cases.
+
+
+Usage example
+
+
+
+
+
+
+
+Use Canvas by default for all paths in the map:
+var map = L.map('map', {
+ renderer: L.canvas()
+});
+
+Use a Canvas renderer with extra padding for specific vector geometries:
+var map = L.map('map');
+var myRenderer = L.canvas({ padding: 0.5 });
+var line = L.polyline( coordinates, { renderer: myRenderer } );
+var circle = L.circle( center, { renderer: myRenderer } );
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.canvas (<Renderer options > options? )
+ Creates a Canvas renderer with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Renderer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ padding
+ Number
+ 0.1
+ How much to extend the clip area around the map view (relative to its size)
+e.g. 0.1 would be 10% of map view in each direction
+
+
+ tolerance
+ Number
+ 0
+ How much to extend click tolerance round a path/object on the map
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Renderer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ update
+ Event
+ Fired when the renderer updates its bounds, center and zoom, for example when
+its map has moved
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ LayerGroup Used to group several layers and handle them as one. If you add it to the map,
+any layers added or removed from the group will be added/removed on the map as
+well. Extends Layer .
+
+
+Usage example
+
+
+
+
+
+
+
+L.layerGroup([marker1, marker2])
+ .addLayer(polyline)
+ .addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.layerGroup (<Layer[]> layers? , <Object> options? )
+ Create a layer group, optionally given an initial set of layers and an options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON (<Number> precision )
+ Object
+ Returns a GeoJSON representation of the layer group (as a GeoJSON FeatureCollection, GeometryCollection, or MultiPoint).
+
+
+
+ addLayer (<Layer > layer )
+ this
+ Adds the given layer to the group.
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Removes the given layer from the group.
+
+
+
+ removeLayer (<Number> id )
+ this
+ Removes the layer with the given internal ID from the group.
+
+
+
+ hasLayer (<Layer > layer )
+ Boolean
+ Returns true if the given layer is currently added to the group.
+
+
+
+ hasLayer (<Number> id )
+ Boolean
+ Returns true if the given internal ID is currently added to the group.
+
+
+
+ clearLayers ()
+ this
+ Removes all the layers from the group.
+
+
+
+ invoke (<String> methodName , … )
+ this
+ Calls methodName on every layer contained in this group, passing any
+additional parameters. Has no effect if the layers contained do not
+implement methodName.
+
+
+
+ eachLayer (<Function> fn , <Object> context? )
+ this
+ Iterates over the layers of the group, optionally specifying context of the iterator function.
+group.eachLayer(function (layer) {
+ layer.bindPopup('Hello');
+});
+
+
+
+
+ getLayer (<Number> id )
+ Layer
+ Returns the layer with the given internal ID.
+
+
+
+ getLayers ()
+ Layer[]
+ Returns an array of all the layers added to the group.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Calls setZIndex on every layer contained in this group, passing the z-index.
+
+
+
+ getLayerId (<Layer > layer )
+ Number
+ Returns the internal ID for a layer
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ FeatureGroup Extended LayerGroup that makes it easier to do the same thing to all its member layers:
+
+bindPopup binds a popup to all of the layers at once (likewise with bindTooltip )
+Events are propagated to the FeatureGroup , so if the group has an event
+handler, it will handle events from any of the layers. This includes mouse events
+and custom events.
+Has layeradd and layerremove events
+
+
+
+Usage example
+
+
+
+
+
+
+
+L.featureGroup([marker1, marker2, polyline])
+ .bindPopup('Hello world!')
+ .on('click', function() { alert('Clicked on a member of the group!'); })
+ .addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.featureGroup (<Layer[]> layers )
+ Create a feature group, optionally given an initial set of layers.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setStyle (<Path options > style )
+ this
+ Sets the given path options to each layer of the group that has a setStyle method.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer group to the top of all other layers
+
+
+
+ bringToBack ()
+ this
+ Brings the layer group to the back of all other layers
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from LayerGroup
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON (<Number> precision )
+ Object
+ Returns a GeoJSON representation of the layer group (as a GeoJSON FeatureCollection, GeometryCollection, or MultiPoint).
+
+
+
+ addLayer (<Layer > layer )
+ this
+ Adds the given layer to the group.
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Removes the given layer from the group.
+
+
+
+ removeLayer (<Number> id )
+ this
+ Removes the layer with the given internal ID from the group.
+
+
+
+ hasLayer (<Layer > layer )
+ Boolean
+ Returns true if the given layer is currently added to the group.
+
+
+
+ hasLayer (<Number> id )
+ Boolean
+ Returns true if the given internal ID is currently added to the group.
+
+
+
+ clearLayers ()
+ this
+ Removes all the layers from the group.
+
+
+
+ invoke (<String> methodName , … )
+ this
+ Calls methodName on every layer contained in this group, passing any
+additional parameters. Has no effect if the layers contained do not
+implement methodName.
+
+
+
+ eachLayer (<Function> fn , <Object> context? )
+ this
+ Iterates over the layers of the group, optionally specifying context of the iterator function.
+group.eachLayer(function (layer) {
+ layer.bindPopup('Hello');
+});
+
+
+
+
+ getLayer (<Number> id )
+ Layer
+ Returns the layer with the given internal ID.
+
+
+
+ getLayers ()
+ Layer[]
+ Returns an array of all the layers added to the group.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Calls setZIndex on every layer contained in this group, passing the z-index.
+
+
+
+ getLayerId (<Layer > layer )
+ Number
+ Returns the internal ID for a layer
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ GeoJSON Represents a GeoJSON object or an array of GeoJSON objects. Allows you to parse
+GeoJSON data and display it on the map. Extends FeatureGroup .
+
+
+Usage example
+
+
+
+
+
+
+
+L.geoJSON(data, {
+ style: function (feature) {
+ return {color: feature.properties.color};
+ }
+}).bindPopup(function (layer) {
+ return layer.feature.properties.description;
+}).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.geoJSON (<Object> geojson? , <GeoJSON options > options? )
+ Creates a GeoJSON layer. Optionally accepts an object in
+GeoJSON format to display on the map
+(you can alternatively add it later with addData method) and an options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pointToLayer
+ Function
+ *
+ A Function defining how GeoJSON points spawn Leaflet layers. It is internally
+called when data is added, passing the GeoJSON point feature and its LatLng .
+The default is to spawn a default Marker :
+function(geoJsonPoint, latlng) {
+ return L.marker(latlng);
+}
+
+
+
+ style
+ Function
+ *
+ A Function defining the Path options for styling GeoJSON lines and polygons,
+called internally when data is added.
+The default value is to not override any defaults:
+function (geoJsonFeature) {
+ return {}
+}
+
+
+
+ onEachFeature
+ Function
+ *
+ A Function that will be called once for each created Feature, after it has
+been created and styled. Useful for attaching events and popups to features.
+The default is to do nothing with the newly created layers:
+function (feature, layer) {}
+
+
+
+ filter
+ Function
+ *
+ A Function that will be used to decide whether to include a feature or not.
+The default is to include all features:
+function (geoJsonFeature) {
+ return true;
+}
+
+Note: dynamically changing the filter option will have effect only on newly
+added data. It will not re-evaluate already included features.
+
+
+ coordsToLatLng
+ Function
+ *
+ A Function that will be used for converting GeoJSON coordinates to LatLng s.
+The default is the coordsToLatLng static method.
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addData (data )
+ this
+ Adds a GeoJSON object to the layer.
+
+
+
+ resetStyle (layer )
+ this
+ Resets the given vector layer's style to the original GeoJSON style, useful for resetting style after hover events.
+
+
+
+ setStyle (style )
+ this
+ Changes styles of GeoJSON vector layers with the given style function.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from FeatureGroup
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bringToFront ()
+ this
+ Brings the layer group to the top of all other layers
+
+
+
+ bringToBack ()
+ this
+ Brings the layer group to the back of all other layers
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from LayerGroup
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON (<Number> precision )
+ Object
+ Returns a GeoJSON representation of the layer group (as a GeoJSON FeatureCollection, GeometryCollection, or MultiPoint).
+
+
+
+ addLayer (<Layer > layer )
+ this
+ Adds the given layer to the group.
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Removes the given layer from the group.
+
+
+
+ removeLayer (<Number> id )
+ this
+ Removes the layer with the given internal ID from the group.
+
+
+
+ hasLayer (<Layer > layer )
+ Boolean
+ Returns true if the given layer is currently added to the group.
+
+
+
+ hasLayer (<Number> id )
+ Boolean
+ Returns true if the given internal ID is currently added to the group.
+
+
+
+ clearLayers ()
+ this
+ Removes all the layers from the group.
+
+
+
+ invoke (<String> methodName , … )
+ this
+ Calls methodName on every layer contained in this group, passing any
+additional parameters. Has no effect if the layers contained do not
+implement methodName.
+
+
+
+ eachLayer (<Function> fn , <Object> context? )
+ this
+ Iterates over the layers of the group, optionally specifying context of the iterator function.
+group.eachLayer(function (layer) {
+ layer.bindPopup('Hello');
+});
+
+
+
+
+ getLayer (<Number> id )
+ Layer
+ Returns the layer with the given internal ID.
+
+
+
+ getLayers ()
+ Layer[]
+ Returns an array of all the layers added to the group.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Calls setZIndex on every layer contained in this group, passing the z-index.
+
+
+
+ getLayerId (<Layer > layer )
+ Number
+ Returns the internal ID for a layer
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+
+Functions
+
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ geometryToLayer (<Object> featureData , <GeoJSON options > options? )
+ Layer
+ Creates a Layer from a given GeoJSON feature. Can use a custom
+pointToLayer and/or coordsToLatLng
+functions if provided as options.
+
+
+ coordsToLatLng (<Array> coords )
+ LatLng
+ Creates a LatLng object from an array of 2 numbers (longitude, latitude)
+or 3 numbers (longitude, latitude, altitude) used in GeoJSON for points.
+
+
+ coordsToLatLngs (<Array> coords , <Number> levelsDeep? , <Function> coordsToLatLng? )
+ Array
+ Creates a multidimensional array of LatLng s from a GeoJSON coordinates array.
+levelsDeep specifies the nesting level (0 is for an array of points, 1 for an array of arrays of points, etc., 0 by default).
+Can use a custom coordsToLatLng function.
+
+
+ latLngToCoords (<LatLng > latlng , <Number> precision? )
+ Array
+ Reverse of coordsToLatLng
+
+
+ latLngsToCoords (<Array> latlngs , <Number> levelsDeep? , <Boolean> closed? )
+ Array
+ Reverse of coordsToLatLngs
+closed determines whether the first point should be appended to the end of the array to close the feature, only used when levelsDeep is 0. False by default.
+
+
+ asFeature (<Object> geojson )
+ Object
+ Normalize GeoJSON geometries/features into GeoJSON features.
+
+
+
+
+
+
+ GridLayer Generic class for handling a tiled grid of HTML elements. This is the base class for all tile layers and replaces TileLayer.Canvas.
+GridLayer can be extended to create a tiled grid of HTML elements like <canvas>, <img> or <div>. GridLayer will handle creating and animating these DOM elements for you.
+
+
+Usage example
+
+
+
+Synchronous usage
+
+
+
+To create a custom layer, extend GridLayer and implement the createTile() method, which will be passed a Point object with the x, y, and z (zoom level) coordinates to draw your tile.
+var CanvasLayer = L.GridLayer.extend({
+ createTile: function(coords){
+ // create a <canvas> element for drawing
+ var tile = L.DomUtil.create('canvas', 'leaflet-tile');
+ // setup tile width and height according to the options
+ var size = this.getTileSize();
+ tile.width = size.x;
+ tile.height = size.y;
+ // get a canvas context and draw something on it using coords.x, coords.y and coords.z
+ var ctx = tile.getContext('2d');
+ // return the tile so it can be rendered on screen
+ return tile;
+ }
+});
+
+
+
+
+
+
+Asynchronous usage
+
+
+
+Tile creation can also be asynchronous, this is useful when using a third-party drawing library. Once the tile is finished drawing it can be passed to the done() callback.
+var CanvasLayer = L.GridLayer.extend({
+ createTile: function(coords, done){
+ var error;
+ // create a <canvas> element for drawing
+ var tile = L.DomUtil.create('canvas', 'leaflet-tile');
+ // setup tile width and height according to the options
+ var size = this.getTileSize();
+ tile.width = size.x;
+ tile.height = size.y;
+ // draw something asynchronously and pass the tile to the done() callback
+ setTimeout(function() {
+ done(error, tile);
+ }, 1000);
+ return tile;
+ }
+});
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.gridLayer (<GridLayer options > options? )
+ Creates a new instance of GridLayer with the supplied options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ tileSize
+ Number|Point
+ 256
+ Width and height of tiles in the grid. Use a number if width and height are equal, or L.point(width, height) otherwise.
+
+
+ opacity
+ Number
+ 1.0
+ Opacity of the tiles. Can be used in the createTile() function.
+
+
+ updateWhenIdle
+ Boolean
+ (depends)
+ Load new tiles only when panning ends.
+true by default on mobile browsers, in order to avoid too many requests and keep smooth navigation.
+false otherwise in order to display new tiles during panning, since it is easy to pan outside the
+keepBuffer option in desktop browsers.
+
+
+ updateWhenZooming
+ Boolean
+ true
+ By default, a smooth zoom animation (during a touch zoom or a flyTo() ) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends.
+
+
+ updateInterval
+ Number
+ 200
+ Tiles will not update more than once every updateInterval milliseconds when panning.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the tile layer.
+
+
+ bounds
+ LatLngBounds
+ undefined
+ If set, tiles will only be loaded inside the set LatLngBounds .
+
+
+ minZoom
+ Number
+ 0
+ The minimum zoom level down to which this layer will be displayed (inclusive).
+
+
+ maxZoom
+ Number
+ undefined
+ The maximum zoom level up to which this layer will be displayed (inclusive).
+
+
+ maxNativeZoom
+ Number
+ undefined
+ Maximum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels higher than maxNativeZoom will be loaded
+from maxNativeZoom level and auto-scaled.
+
+
+ minNativeZoom
+ Number
+ undefined
+ Minimum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels lower than minNativeZoom will be loaded
+from minNativeZoom level and auto-scaled.
+
+
+ noWrap
+ Boolean
+ false
+ Whether the layer is wrapped around the antimeridian. If true, the
+GridLayer will only be displayed once at low zoom levels. Has no
+effect when the map CRS doesn't wrap around. Can be used
+in combination with bounds to prevent requesting
+tiles outside the CRS limits.
+
+
+ pane
+ String
+ 'tilePane'
+ Map pane where the grid layer will be added.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the tile layer. Empty by default.
+
+
+ keepBuffer
+ Number
+ 2
+ When panning the map, keep this many rows and columns of tiles before unloading them.
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ loading
+ Event
+ Fired when the grid layer starts loading tiles.
+
+
+ tileunload
+ TileEvent
+ Fired when a tile is removed (e.g. when a tile goes off the screen).
+
+
+ tileloadstart
+ TileEvent
+ Fired when a tile is requested and starts loading.
+
+
+ tileerror
+ TileErrorEvent
+ Fired when there is an error loading a tile.
+
+
+ tileload
+ TileEvent
+ Fired when a tile loads.
+
+
+ load
+ Event
+ Fired when the grid layer loaded all visible tiles.
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bringToFront ()
+ this
+ Brings the tile layer to the top of all tile layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the tile layer to the bottom of all tile layers.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTML element that contains the tiles for this layer.
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Changes the opacity of the grid layer.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Changes the zIndex of the grid layer.
+
+
+
+ isLoading ()
+ Boolean
+ Returns true if any tile in the grid layer has not finished loading.
+
+
+
+ redraw ()
+ this
+ Causes the layer to clear all the tiles and request them again.
+
+
+
+ getTileSize ()
+ Point
+ Normalizes the tileSize option into a point. Used by the createTile() method.
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ createTile (<Object> coords , <Function> done? )
+ HTMLElement
+ Called only internally, must be overridden by classes extending GridLayer .
+Returns the HTMLElement corresponding to the given coords. If the done callback
+is specified, it must be called when the tile has finished loading and drawing.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ LatLng Represents a geographical point with a certain latitude and longitude.
+
+
+Usage example
+
+
+
+
+
+
+
+var latlng = L.latLng(50.5, 30.5);
+All Leaflet methods that accept LatLng objects also accept them in a simple Array form and simple object form (unless noted otherwise), so these lines are equivalent:
+map.panTo([50, 30]);
+map.panTo({lon: 30, lat: 50});
+map.panTo({lat: 50, lng: 30});
+map.panTo(L.latLng(50, 30));
+Note that LatLng does not inherit from Leaflet's Class object,
+which means new classes can't inherit from it, and new methods
+can't be added to it with the include function.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.latLng (<Number> latitude , <Number> longitude , <Number> altitude? )
+ Creates an object representing a geographical point with the given latitude and longitude (and optionally altitude).
+
+
+ L.latLng (<Array> coords )
+ Expects an array of the form [Number, Number] or [Number, Number, Number] instead.
+
+
+ L.latLng (<Object> coords )
+ Expects an plain object of the form {lat: Number, lng: Number} or {lat: Number, lng: Number, alt: Number} instead.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ equals (<LatLng > otherLatLng , <Number> maxMargin? )
+ Boolean
+ Returns true if the given LatLng point is at the same position (within a small margin of error). The margin of error can be overridden by setting maxMargin to a small number.
+
+
+
+ toString ()
+ String
+ Returns a string representation of the point (for debugging purposes).
+
+
+
+ distanceTo (<LatLng > otherLatLng )
+ Number
+ Returns the distance (in meters) to the given LatLng calculated using the Spherical Law of Cosines .
+
+
+
+ wrap ()
+ LatLng
+ Returns a new LatLng object with the longitude wrapped so it's always between -180 and +180 degrees.
+
+
+
+ toBounds (<Number> sizeInMeters )
+ LatLngBounds
+ Returns a new LatLngBounds object in which each boundary is sizeInMeters/2 meters apart from the LatLng .
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ lat
+ Number
+ Latitude in degrees
+
+
+ lng
+ Number
+ Longitude in degrees
+
+
+ alt
+ Number
+ Altitude in meters (optional)
+
+
+
+
+
+
+ LatLngBounds Represents a rectangular geographical area on a map.
+
+
+Usage example
+
+
+
+
+
+
+
+var corner1 = L.latLng(40.712, -74.227),
+corner2 = L.latLng(40.774, -74.125),
+bounds = L.latLngBounds(corner1, corner2);
+
+All Leaflet methods that accept LatLngBounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:
+map.fitBounds([
+ [40.712, -74.227],
+ [40.774, -74.125]
+]);
+
+Caution: if the area crosses the antimeridian (often confused with the International Date Line), you must specify corners outside the [-180, 180] degrees longitude range.
+Note that LatLngBounds does not inherit from Leaflet's Class object,
+which means new classes can't inherit from it, and new methods
+can't be added to it with the include function.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.latLngBounds (<LatLng > corner1 , <LatLng > corner2 )
+ Creates a LatLngBounds object by defining two diagonally opposite corners of the rectangle.
+
+
+ L.latLngBounds (<LatLng[]> latlngs )
+ Creates a LatLngBounds object defined by the geographical points it contains. Very useful for zooming the map to fit a particular set of locations with fitBounds .
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ extend (<LatLng > latlng )
+ this
+ Extend the bounds to contain the given point
+
+
+
+ extend (<LatLngBounds > otherBounds )
+ this
+ Extend the bounds to contain the given bounds
+
+
+
+ pad (<Number> bufferRatio )
+ LatLngBounds
+ Returns bounds created by extending or retracting the current bounds by a given ratio in each direction.
+For example, a ratio of 0.5 extends the bounds by 50% in each direction.
+Negative values will retract the bounds.
+
+
+
+ getCenter ()
+ LatLng
+ Returns the center point of the bounds.
+
+
+
+ getSouthWest ()
+ LatLng
+ Returns the south-west point of the bounds.
+
+
+
+ getNorthEast ()
+ LatLng
+ Returns the north-east point of the bounds.
+
+
+
+ getNorthWest ()
+ LatLng
+ Returns the north-west point of the bounds.
+
+
+
+ getSouthEast ()
+ LatLng
+ Returns the south-east point of the bounds.
+
+
+
+ getWest ()
+ Number
+ Returns the west longitude of the bounds
+
+
+
+ getSouth ()
+ Number
+ Returns the south latitude of the bounds
+
+
+
+ getEast ()
+ Number
+ Returns the east longitude of the bounds
+
+
+
+ getNorth ()
+ Number
+ Returns the north latitude of the bounds
+
+
+
+ contains (<LatLngBounds > otherBounds )
+ Boolean
+ Returns true if the rectangle contains the given one.
+
+
+
+ contains (<LatLng > latlng )
+ Boolean
+ Returns true if the rectangle contains the given point.
+
+
+
+ intersects (<LatLngBounds > otherBounds )
+ Boolean
+ Returns true if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common.
+
+
+
+ overlaps (<Bounds > otherBounds )
+ Boolean
+ Returns true if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area.
+
+
+
+ toBBoxString ()
+ String
+ Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format. Useful for sending requests to web services that return geo data.
+
+
+
+ equals (<LatLngBounds > otherBounds , <Number> maxMargin? )
+ Boolean
+ Returns true if the rectangle is equivalent (within a small margin of error) to the given bounds. The margin of error can be overridden by setting maxMargin to a small number.
+
+
+
+ isValid ()
+ Boolean
+ Returns true if the bounds are properly initialized.
+
+
+
+
+
+
+
+ Point Represents a point with x and y coordinates in pixels.
+
+
+Usage example
+
+
+
+
+
+
+
+var point = L.point(200, 300);
+
+All Leaflet methods and options that accept Point objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent:
+map.panBy([200, 300]);
+map.panBy(L.point(200, 300));
+
+Note that Point does not inherit from Leaflet's Class object,
+which means new classes can't inherit from it, and new methods
+can't be added to it with the include function.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.point (<Number> x , <Number> y , <Boolean> round? )
+ Creates a Point object with the given x and y coordinates. If optional round is set to true, rounds the x and y values.
+
+
+ L.point (<Number[]> coords )
+ Expects an array of the form [x, y] instead.
+
+
+ L.point (<Object> coords )
+ Expects a plain object of the form {x: Number, y: Number} instead.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ clone ()
+ Point
+ Returns a copy of the current point.
+
+
+
+ add (<Point > otherPoint )
+ Point
+ Returns the result of addition of the current and the given points.
+
+
+
+ subtract (<Point > otherPoint )
+ Point
+ Returns the result of subtraction of the given point from the current.
+
+
+
+ divideBy (<Number> num )
+ Point
+ Returns the result of division of the current point by the given number.
+
+
+
+ multiplyBy (<Number> num )
+ Point
+ Returns the result of multiplication of the current point by the given number.
+
+
+
+ scaleBy (<Point > scale )
+ Point
+ Multiply each coordinate of the current point by each coordinate of
+scale. In linear algebra terms, multiply the point by the
+scaling matrix
+defined by scale.
+
+
+
+ unscaleBy (<Point > scale )
+ Point
+ Inverse of scaleBy. Divide each coordinate of the current point by
+each coordinate of scale.
+
+
+
+ round ()
+ Point
+ Returns a copy of the current point with rounded coordinates.
+
+
+
+ floor ()
+ Point
+ Returns a copy of the current point with floored coordinates (rounded down).
+
+
+
+ ceil ()
+ Point
+ Returns a copy of the current point with ceiled coordinates (rounded up).
+
+
+
+ trunc ()
+ Point
+ Returns a copy of the current point with truncated coordinates (rounded towards zero).
+
+
+
+ distanceTo (<Point > otherPoint )
+ Number
+ Returns the cartesian distance between the current and the given points.
+
+
+
+ equals (<Point > otherPoint )
+ Boolean
+ Returns true if the given point has the same coordinates.
+
+
+
+ contains (<Point > otherPoint )
+ Boolean
+ Returns true if both coordinates of the given point are less than the corresponding current point coordinates (in absolute values).
+
+
+
+ toString ()
+ String
+ Returns a string representation of the point for debugging purposes.
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ x
+ Number
+ The x coordinate of the point
+
+
+ y
+ Number
+ The y coordinate of the point
+
+
+
+
+
+
+ Bounds Represents a rectangular area in pixel coordinates.
+
+
+Usage example
+
+
+
+
+
+
+
+var p1 = L.point(10, 10),
+p2 = L.point(40, 60),
+bounds = L.bounds(p1, p2);
+
+All Leaflet methods that accept Bounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:
+otherBounds.intersects([[10, 10], [40, 60]]);
+
+Note that Bounds does not inherit from Leaflet's Class object,
+which means new classes can't inherit from it, and new methods
+can't be added to it with the include function.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.bounds (<Point > corner1 , <Point > corner2 )
+ Creates a Bounds object from two corners coordinate pairs.
+
+
+ L.bounds (<Point[]> points )
+ Creates a Bounds object from the given array of points.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ extend (<Point > point )
+ this
+ Extends the bounds to contain the given point.
+
+
+
+ getCenter (<Boolean> round? )
+ Point
+ Returns the center point of the bounds.
+
+
+
+ getBottomLeft ()
+ Point
+ Returns the bottom-left point of the bounds.
+
+
+
+ getTopRight ()
+ Point
+ Returns the top-right point of the bounds.
+
+
+
+ getTopLeft ()
+ Point
+ Returns the top-left point of the bounds (i.e. this.min ).
+
+
+
+ getBottomRight ()
+ Point
+ Returns the bottom-right point of the bounds (i.e. this.max ).
+
+
+
+ getSize ()
+ Point
+ Returns the size of the given bounds
+
+
+
+ contains (<Bounds > otherBounds )
+ Boolean
+ Returns true if the rectangle contains the given one.
+
+
+
+ contains (<Point > point )
+ Boolean
+ Returns true if the rectangle contains the given point.
+
+
+
+ intersects (<Bounds > otherBounds )
+ Boolean
+ Returns true if the rectangle intersects the given bounds. Two bounds
+intersect if they have at least one point in common.
+
+
+
+ overlaps (<Bounds > otherBounds )
+ Boolean
+ Returns true if the rectangle overlaps the given bounds. Two bounds
+overlap if their intersection is an area.
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ min
+ Point
+ The top left corner of the rectangle.
+
+
+ max
+ Point
+ The bottom right corner of the rectangle.
+
+
+
+
+
+
+ Icon Represents an icon to provide when creating a marker.
+
+
+Usage example
+
+
+
+
+
+
+
+var myIcon = L.icon({
+ iconUrl: 'my-icon.png',
+ iconSize: [38, 95],
+ iconAnchor: [22, 94],
+ popupAnchor: [-3, -76],
+ shadowUrl: 'my-icon-shadow.png',
+ shadowSize: [68, 95],
+ shadowAnchor: [22, 94]
+});
+L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
+
+L.Icon.Default extends L.Icon and is the blue icon Leaflet uses for markers by default.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.icon (<Icon options > options )
+ Creates an icon instance with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ iconUrl
+ String
+ null
+ (required) The URL to the icon image (absolute or relative to your script path).
+
+
+ iconRetinaUrl
+ String
+ null
+ The URL to a retina sized version of the icon image (absolute or relative to your
+script path). Used for Retina screen devices.
+
+
+ iconSize
+ Point
+ null
+ Size of the icon image in pixels.
+
+
+ iconAnchor
+ Point
+ null
+ The coordinates of the "tip" of the icon (relative to its top left corner). The icon
+will be aligned so that this point is at the marker's geographical location. Centered
+by default if size is specified, also can be set in CSS with negative margins.
+
+
+
+ tooltipAnchor
+ Point
+ [0, 0]
+ The coordinates of the point from which tooltips will "open", relative to the icon anchor.
+
+
+ shadowUrl
+ String
+ null
+ The URL to the icon shadow image. If not specified, no shadow image will be created.
+
+
+ shadowRetinaUrl
+ String
+ null
+
+
+
+ shadowSize
+ Point
+ null
+ Size of the shadow image in pixels.
+
+
+ shadowAnchor
+ Point
+ null
+ The coordinates of the "tip" of the shadow (relative to its top left corner) (the same
+as iconAnchor if not specified).
+
+
+ className
+ String
+ ''
+ A custom class name to assign to both icon and shadow images. Empty by default.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ createIcon (<HTMLElement> oldIcon? )
+ HTMLElement
+ Called internally when the icon has to be shown, returns a <img> HTML element
+styled according to the options.
+
+
+
+ createShadow (<HTMLElement> oldIcon? )
+ HTMLElement
+ As createIcon, but for the shadow beneath it.
+
+
+
+
+
+
+
+
+
+
+Icon.Default
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ imagePath
+ String
+
+ Icon.Default will try to auto-detect the location of the
+blue icon images. If you are placing these images in a non-standard
+way, set this option to point to the right path.
+
+
+
+
+
+
+ DivIcon Represents a lightweight icon for markers that uses a simple <div>
+element instead of an image. Inherits from Icon but ignores the iconUrl and shadow options.
+
+
+Usage example
+
+
+
+
+
+
+
+var myIcon = L.divIcon({className: 'my-div-icon'});
+// you can set .my-div-icon styles in CSS
+L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
+
+By default, it has a 'leaflet-div-icon' CSS class and is styled as a little white square with a shadow.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.divIcon (<DivIcon options > options )
+ Creates a DivIcon instance with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ html
+ String
+ ''
+ Custom HTML code to put inside the div element, empty by default.
+
+
+ bgPos
+ Point
+ [0, 0]
+ Optional relative position of the background, in pixels
+
+
+
+
+
+
+
+
▶ Options inherited from Icon
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ iconUrl
+ String
+ null
+ (required) The URL to the icon image (absolute or relative to your script path).
+
+
+ iconRetinaUrl
+ String
+ null
+ The URL to a retina sized version of the icon image (absolute or relative to your
+script path). Used for Retina screen devices.
+
+
+ iconSize
+ Point
+ null
+ Size of the icon image in pixels.
+
+
+ iconAnchor
+ Point
+ null
+ The coordinates of the "tip" of the icon (relative to its top left corner). The icon
+will be aligned so that this point is at the marker's geographical location. Centered
+by default if size is specified, also can be set in CSS with negative margins.
+
+
+
+ tooltipAnchor
+ Point
+ [0, 0]
+ The coordinates of the point from which tooltips will "open", relative to the icon anchor.
+
+
+ shadowUrl
+ String
+ null
+ The URL to the icon shadow image. If not specified, no shadow image will be created.
+
+
+ shadowRetinaUrl
+ String
+ null
+
+
+
+ shadowSize
+ Point
+ null
+ Size of the shadow image in pixels.
+
+
+ shadowAnchor
+ Point
+ null
+ The coordinates of the "tip" of the shadow (relative to its top left corner) (the same
+as iconAnchor if not specified).
+
+
+ className
+ String
+ ''
+ A custom class name to assign to both icon and shadow images. Empty by default.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Icon
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ createIcon (<HTMLElement> oldIcon? )
+ HTMLElement
+ Called internally when the icon has to be shown, returns a <img> HTML element
+styled according to the options.
+
+
+
+ createShadow (<HTMLElement> oldIcon? )
+ HTMLElement
+ As createIcon, but for the shadow beneath it.
+
+
+
+
+
+
+
+
+ Control.Zoom A basic zoom control with two buttons (zoom in and zoom out). It is put on the map by default unless you set its zoomControl option to false. Extends Control .
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.control.zoom (<Control.Zoom options > options )
+ Creates a zoom control
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ zoomInText
+ String
+ '+'
+ The text set on the 'zoom in' button.
+
+
+ zoomInTitle
+ String
+ 'Zoom in'
+ The title set on the 'zoom in' button.
+
+
+ zoomOutText
+ String
+ '−
+ '
+The text set on the 'zoom out' button.
+
+
+ zoomOutTitle
+ String
+ 'Zoom out'
+ The title set on the 'zoom out' button.
+
+
+
+
+
+
+
+
▶ Options inherited from Control
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Control
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+
+
+ Control.Attribution The attribution control allows you to display attribution data in a small text box on a map. It is put on the map by default unless you set its attributionControl option to false, and it fetches attribution texts from layers with the getAttribution method automatically. Extends Control.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ prefix
+ String
+ 'Leaflet'
+ The HTML text shown before the attributions. Pass false to disable.
+
+
+
+
+
+
+
+
▶ Options inherited from Control
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setPrefix (<String> prefix )
+ this
+ Sets the text before the attributions.
+
+
+
+ addAttribution (<String> text )
+ this
+ Adds an attribution text (e.g. 'Vector data © Mapbox').
+
+
+
+ removeAttribution (<String> text )
+ this
+ Removes an attribution text.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Control
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+
+
+ Control.Layers The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the detailed example ). Extends Control .
+
+
+Usage example
+
+
+
+
+
+
+
+var baseLayers = {
+ "Mapbox": mapbox,
+ "OpenStreetMap": osm
+};
+var overlays = {
+ "Marker": marker,
+ "Roads": roadsLayer
+};
+L.control.layers(baseLayers, overlays).addTo(map);
+
+The baseLayers and overlays parameters are object literals with layer names as keys and Layer objects as values:
+{
+ "<someName1>": layer1,
+ "<someName2>": layer2
+}
+
+The layer names can contain HTML, which allows you to add additional styling to the items:
+{"<img src='my-layer-icon' /> <span class='my-layer-item'>My Layer</span>": myLayer}
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.control.layers (<Object> baselayers? , <Object> overlays? , <Control.Layers options > options? )
+ Creates an attribution control with the given layers. Base layers will be switched with radio buttons, while overlays will be switched with checkboxes. Note that all base layers should be passed in the base layers object, but only one should be added to the map during map instantiation.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ collapsed
+ Boolean
+ true
+ If true, the control will be collapsed into an icon and expanded on mouse hover or touch.
+
+
+ autoZIndex
+ Boolean
+ true
+ If true, the control will assign zIndexes in increasing order to all of its layers so that the order is preserved when switching them on/off.
+
+
+ hideSingleBase
+ Boolean
+ false
+ If true, the base layers in the control will be hidden when there is only one.
+
+
+ sortLayers
+ Boolean
+ false
+ Whether to sort the layers. When false, layers will keep the order
+in which they were added to the control.
+
+
+ sortFunction
+ Function
+ *
+ A compare function
+that will be used for sorting the layers, when sortLayers is true.
+The function receives both the L.Layer instances and their names, as in
+sortFunction(layerA, layerB, nameA, nameB).
+By default, it sorts layers alphabetically by their name.
+
+
+
+
+
+
+
+
▶ Options inherited from Control
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addBaseLayer (<Layer > layer , <String> name )
+ this
+ Adds a base layer (radio button entry) with the given name to the control.
+
+
+
+ addOverlay (<Layer > layer , <String> name )
+ this
+ Adds an overlay (checkbox entry) with the given name to the control.
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Remove the given layer from the control.
+
+
+
+ expand ()
+ this
+ Expand the control container if collapsed.
+
+
+
+ collapse ()
+ this
+ Collapse the control container if expanded.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Control
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+
+
+ Control.Scale A simple scale control that shows the scale of the current center of screen in metric (m/km) and imperial (mi/ft) systems. Extends Control .
+
+
+Usage example
+
+
+
+
+
+
+
+L.control.scale().addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.control.scale (<Control.Scale options > options? )
+ Creates an scale control with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ maxWidth
+ Number
+ 100
+ Maximum width of the control in pixels. The width is set dynamically to show round values (e.g. 100, 200, 500).
+
+
+ metric
+ Boolean
+ True
+ Whether to show the metric scale line (m/km).
+
+
+ imperial
+ Boolean
+ True
+ Whether to show the imperial scale line (mi/ft).
+
+
+ updateWhenIdle
+ Boolean
+ false
+ If true, the control is updated on moveend , otherwise it's always up-to-date (updated on move ).
+
+
+
+
+
+
+
+
▶ Options inherited from Control
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Control
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+
+
+ Browser A namespace with static properties for browser/feature detection used by Leaflet internally.
+
+
+Usage example
+
+
+
+
+
+
+
+if (L.Browser.ielt9) {
+ alert('Upgrade your browser, dude!');
+}
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ ie
+ Boolean
+ true for all Internet Explorer versions (not Edge).
+
+
+ ielt9
+ Boolean
+ true for Internet Explorer versions less than 9.
+
+
+ edge
+ Boolean
+ true for the Edge web browser.
+
+
+ webkit
+ Boolean
+ true for webkit-based browsers like Chrome and Safari (including mobile versions).
+
+
+ android
+ Boolean
+ true for any browser running on an Android platform.
+
+
+ android23
+ Boolean
+ true for browsers running on Android 2 or Android 3.
+
+
+ androidStock
+ Boolean
+ true for the Android stock browser (i.e. not Chrome)
+
+
+ opera
+ Boolean
+ true for the Opera browser
+
+
+ chrome
+ Boolean
+ true for the Chrome browser.
+
+
+ gecko
+ Boolean
+ true for gecko-based browsers like Firefox.
+
+
+ safari
+ Boolean
+ true for the Safari browser.
+
+
+ opera12
+ Boolean
+ true for the Opera browser supporting CSS transforms (version 12 or later).
+
+
+ win
+ Boolean
+ true when the browser is running in a Windows platform
+
+
+ ie3d
+ Boolean
+ true for all Internet Explorer versions supporting CSS transforms.
+
+
+ webkit3d
+ Boolean
+ true for webkit-based browsers supporting CSS transforms.
+
+
+ gecko3d
+ Boolean
+ true for gecko-based browsers supporting CSS transforms.
+
+
+ any3d
+ Boolean
+ true for all browsers supporting CSS transforms.
+
+
+ mobile
+ Boolean
+ true for all browsers running in a mobile device.
+
+
+ mobileWebkit
+ Boolean
+ true for all webkit-based browsers in a mobile device.
+
+
+ mobileWebkit3d
+ Boolean
+ true for all webkit-based browsers in a mobile device supporting CSS transforms.
+
+
+ msPointer
+ Boolean
+ true for browsers implementing the Microsoft touch events model (notably IE10).
+
+
+ pointer
+ Boolean
+ true for all browsers supporting pointer events .
+
+
+ touch
+ Boolean
+ true for all browsers supporting touch events .
+This does not necessarily mean that the browser is running in a computer with
+a touchscreen, it only means that the browser is capable of understanding
+touch events.
+
+
+ mobileOpera
+ Boolean
+ true for the Opera browser in a mobile device.
+
+
+ mobileGecko
+ Boolean
+ true for gecko-based browsers running in a mobile device.
+
+
+ retina
+ Boolean
+ true for browsers on a high-resolution "retina" screen or on any screen when browser's display zoom is more than 100%.
+
+
+ canvas
+ Boolean
+ true when the browser supports <canvas> .
+
+
+ svg
+ Boolean
+ true when the browser supports SVG .
+
+
+ vml
+ Boolean
+ true if the browser supports VML .
+
+
+
+
+
+
+ Util Various utility functions, used by Leaflet internally.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ extend (<Object> dest , <Object> src? )
+ Object
+ Merges the properties of the src object (or multiple objects) into dest object and returns the latter. Has an L.extend shortcut.
+
+
+ create (<Object> proto , <Object> properties? )
+ Object
+ Compatibility polyfill for Object.create
+
+
+ bind (<Function> fn , … )
+ Function
+ Returns a new function bound to the arguments passed, like Function.prototype.bind .
+Has a L.bind() shortcut.
+
+
+ stamp (<Object> obj )
+ Number
+ Returns the unique ID of an object, assigning it one if it doesn't have it.
+
+
+ throttle (<Function> fn , <Number> time , <Object> context )
+ Function
+ Returns a function which executes function fn with the given scope context
+(so that the this keyword refers to context inside fn's code). The function
+fn will be called no more than one time per given amount of time. The arguments
+received by the bound function will be any arguments passed when binding the
+function, followed by any arguments passed when invoking the bound function.
+Has an L.throttle shortcut.
+
+
+ wrapNum (<Number> num , <Number[]> range , <Boolean> includeMax? )
+ Number
+ Returns the number num modulo range in such a way so it lies within
+range[0] and range[1]. The returned value will be always smaller than
+range[1] unless includeMax is set to true.
+
+
+ falseFn ()
+ Function
+ Returns a function which always returns false.
+
+
+ formatNum (<Number> num , <Number> digits? )
+ Number
+ Returns the number num rounded to digits decimals, or to 6 decimals by default.
+
+
+ trim (<String> str )
+ String
+ Compatibility polyfill for String.prototype.trim
+
+
+ splitWords (<String> str )
+ String[]
+ Trims and splits the string on whitespace and returns the array of parts.
+
+
+ setOptions (<Object> obj , <Object> options )
+ Object
+ Merges the given properties to the options of the obj object, returning the resulting options. See Class options. Has an L.setOptions shortcut.
+
+
+ getParamString (<Object> obj , <String> existingUrl? , <Boolean> uppercase? )
+ String
+ Converts an object into a parameter URL string, e.g. {a: "foo", b: "bar"}
+translates to '?a=foo&b=bar'. If existingUrl is set, the parameters will
+be appended at the end. If uppercase is true, the parameter names will
+be uppercased (e.g. '?A=foo&B=bar')
+
+
+ template (<String> str , <Object> data )
+ String
+ Simple templating facility, accepts a template string of the form 'Hello {a}, {b}'
+and a data object like {a: 'foo', b: 'bar'}, returns evaluated string
+('Hello foo, bar'). You can also specify functions instead of strings for
+data values — they will be evaluated passing data as an argument.
+
+
+ isArray (obj )
+ Boolean
+ Compatibility polyfill for Array.isArray
+
+
+ indexOf (<Array> array , <Object> el )
+ Number
+ Compatibility polyfill for Array.prototype.indexOf
+
+
+ requestAnimFrame (<Function> fn , <Object> context? , <Boolean> immediate? )
+ Number
+ Schedules fn to be executed when the browser repaints. fn is bound to
+context if given. When immediate is set, fn is called immediately if
+the browser doesn't have native support for
+window.requestAnimationFrame ,
+otherwise it's delayed. Returns a request ID that can be used to cancel the request.
+
+
+ cancelAnimFrame (<Number> id )
+ undefined
+ Cancels a previous requestAnimFrame. See also window.cancelAnimationFrame .
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ lastId
+ Number
+ Last unique ID used by stamp()
+
+
+ emptyImageUrl
+ String
+ Data URI string containing a base64-encoded empty GIF image.
+Used as a hack to free memory from unused images on WebKit-powered
+mobile devices (by setting image src to this string).
+
+
+
+
+
+
+ Represents an affine transformation: a set of coefficients a, b, c, d
+for transforming a point of a form (x, y) into (a*x + b, c*y + d) and doing
+the reverse. Used by Leaflet in its projections code.
+
+
+
+
+
+
+
+
+
+
+var transformation = L.transformation(2, 5, -1, 10),
+ p = L.point(1, 2),
+ p2 = transformation.transform(p), // L.point(7, 8)
+ p3 = transformation.untransform(p2); // L.point(1, 2)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.transformation (<Number> a , <Number> b , <Number> c , <Number> d )
+ Instantiates a Transformation object with the given coefficients.
+
+
+ L.transformation (<Array> coefficients )
+ Expects an coefficients array of the form
+[a: Number, b: Number, c: Number, d: Number].
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ transform (<Point > point , <Number> scale? )
+ Point
+ Returns a transformed point, optionally multiplied by the given scale.
+Only accepts actual L.Point instances, not arrays.
+
+
+
+ untransform (<Point > point , <Number> scale? )
+ Point
+ Returns the reverse transformation of the given point, optionally divided
+by the given scale. Only accepts actual L.Point instances, not arrays.
+
+
+
+
+
+
+
+ LineUtil Various utility functions for polyline points processing, used by Leaflet internally to make polylines lightning-fast.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ simplify (<Point[]> points , <Number> tolerance )
+ Point[]
+ Dramatically reduces the number of points in a polyline while retaining
+its shape and returns a new array of simplified points, using the
+Douglas-Peucker algorithm .
+Used for a huge performance boost when processing/displaying Leaflet polylines for
+each zoom level and also reducing visual noise. tolerance affects the amount of
+simplification (lesser value means higher quality but slower and with more points).
+Also released as a separated micro-library Simplify.js .
+
+
+ pointToSegmentDistance (<Point > p , <Point > p1 , <Point > p2 )
+ Number
+ Returns the distance between point p and segment p1 to p2.
+
+
+ closestPointOnSegment (<Point > p , <Point > p1 , <Point > p2 )
+ Number
+ Returns the closest point from a point p on a segment p1 to p2.
+
+
+ clipSegment (<Point > a , <Point > b , <Bounds > bounds , <Boolean> useLastCode? , <Boolean> round? )
+ Point[]|Boolean
+ Clips the segment a to b by rectangular bounds with the
+Cohen-Sutherland algorithm
+(modifying the segment points directly!). Used by Leaflet to only show polyline
+points that are on the screen or near, increasing performance.
+
+
+ isFlat (<LatLng[]> latlngs )
+ Boolean
+ Returns true if latlngs is a flat array, false is nested.
+
+
+
+
+
+
+ PolyUtil Various utility functions for polygon geometries.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ clipPolygon (<Point[]> points , <Bounds > bounds , <Boolean> round? )
+ Point[]
+ Clips the polygon geometry defined by the given points by the given bounds (using the Sutherland-Hodgman algorithm ).
+Used by Leaflet to only show polygon points that are on the screen or near, increasing
+performance. Note that polygon points needs different algorithm for clipping
+than polyline, so there's a separate method for it.
+
+
+
+
+
+
+ DomEvent Utility functions to work with the DOM events , used by Leaflet internally.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ on (<HTMLElement> el , <String> types , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular DOM event type of the
+element el. You can optionally specify the context of the listener
+(object the this keyword will point to). You can also pass several
+space-separated types (e.g. 'click dblclick').
+
+
+ on (<HTMLElement> el , <Object> eventMap , <Object> context? )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+ off (<HTMLElement> el , <String> types , <Function> fn , <Object> context? )
+ this
+ Removes a previously added listener function.
+Note that if you passed a custom context to on, you must pass the same
+context to off in order to remove the listener.
+
+
+ off (<HTMLElement> el , <Object> eventMap , <Object> context? )
+ this
+ Removes a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+ stopPropagation (<DOMEvent> ev )
+ this
+ Stop the given event from propagation to parent elements. Used inside the listener functions:
+L.DomEvent.on(div, 'click', function (ev) {
+ L.DomEvent.stopPropagation(ev);
+});
+
+
+
+ disableScrollPropagation (<HTMLElement> el )
+ this
+ Adds stopPropagation to the element's 'mousewheel' events (plus browser variants).
+
+
+ disableClickPropagation (<HTMLElement> el )
+ this
+ Adds stopPropagation to the element's 'click', 'doubleclick',
+'mousedown' and 'touchstart' events (plus browser variants).
+
+
+ preventDefault (<DOMEvent> ev )
+ this
+ Prevents the default action of the DOM Event ev from happening (such as
+following a link in the href of the a element, or doing a POST request
+with page reload when a <form> is submitted).
+Use it inside listener functions.
+
+
+ stop (<DOMEvent> ev )
+ this
+ Does stopPropagation and preventDefault at the same time.
+
+
+ getMousePosition (<DOMEvent> ev , <HTMLElement> container? )
+ Point
+ Gets normalized mouse position from a DOM event relative to the
+container (border excluded) or to the whole page if not specified.
+
+
+ getWheelDelta (<DOMEvent> ev )
+ Number
+ Gets normalized wheel delta from a mousewheel DOM event, in vertical
+pixels scrolled (negative if scrolling down).
+Events from pointing devices without precise scrolling are mapped to
+a best guess of 60 pixels.
+
+
+ addListener (… )
+ this
+ Alias to L.DomEvent.on
+
+
+ removeListener (… )
+ this
+ Alias to L.DomEvent.off
+
+
+
+
+
+
+ DomUtil Utility functions to work with the DOM
+tree, used by Leaflet internally.
+Most functions expecting or returning a HTMLElement also work for
+SVG elements. The only difference is that classes refer to CSS classes
+in HTML and SVG classes in SVG.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ get (<String|HTMLElement> id )
+ HTMLElement
+ Returns an element given its DOM id, or returns the element itself
+if it was passed directly.
+
+
+ getStyle (<HTMLElement> el , <String> styleAttrib )
+ String
+ Returns the value for a certain style attribute on an element,
+including computed values or values set through CSS.
+
+
+ create (<String> tagName , <String> className? , <HTMLElement> container? )
+ HTMLElement
+ Creates an HTML element with tagName, sets its class to className, and optionally appends it to container element.
+
+
+ remove (<HTMLElement> el )
+
+ Removes el from its parent element
+
+
+ empty (<HTMLElement> el )
+
+ Removes all of el's children elements from el
+
+
+ toFront (<HTMLElement> el )
+
+ Makes el the last child of its parent, so it renders in front of the other children.
+
+
+ toBack (<HTMLElement> el )
+
+ Makes el the first child of its parent, so it renders behind the other children.
+
+
+ hasClass (<HTMLElement> el , <String> name )
+ Boolean
+ Returns true if the element's class attribute contains name.
+
+
+ addClass (<HTMLElement> el , <String> name )
+
+ Adds name to the element's class attribute.
+
+
+ removeClass (<HTMLElement> el , <String> name )
+
+ Removes name from the element's class attribute.
+
+
+ setClass (<HTMLElement> el , <String> name )
+
+ Sets the element's class.
+
+
+ getClass (<HTMLElement> el )
+ String
+ Returns the element's class.
+
+
+ setOpacity (<HTMLElement> el , <Number> opacity )
+
+ Set the opacity of an element (including old IE support).
+opacity must be a number from 0 to 1.
+
+
+ testProp (<String[]> props )
+ String|false
+ Goes through the array of style names and returns the first name
+that is a valid style name for an element. If no such name is found,
+it returns false. Useful for vendor-prefixed styles like transform.
+
+
+ setTransform (<HTMLElement> el , <Point > offset , <Number> scale? )
+
+ Resets the 3D CSS transform of el so it is translated by offset pixels
+and optionally scaled by scale. Does not have an effect if the
+browser doesn't support 3D CSS transforms.
+
+
+ setPosition (<HTMLElement> el , <Point > position )
+
+ Sets the position of el to coordinates specified by position,
+using CSS translate or top/left positioning depending on the browser
+(used by Leaflet internally to position its layers).
+
+
+ getPosition (<HTMLElement> el )
+ Point
+ Returns the coordinates of an element previously positioned with setPosition.
+
+
+ disableTextSelection ()
+
+ Prevents the user from generating selectstart DOM events, usually generated
+when the user drags the mouse through a page with text. Used internally
+by Leaflet to override the behaviour of any click-and-drag interaction on
+the map. Affects drag interactions on the whole document.
+
+
+ enableTextSelection ()
+
+ Cancels the effects of a previous L.DomUtil.disableTextSelection .
+
+
+ disableImageDrag ()
+
+ As L.DomUtil.disableTextSelection , but
+for dragstart DOM events, usually generated when the user drags an image.
+
+
+ enableImageDrag ()
+
+ Cancels the effects of a previous L.DomUtil.disableImageDrag .
+
+
+ preventOutline (<HTMLElement> el )
+
+ Makes the outline
+of the element el invisible. Used internally by Leaflet to prevent
+focusable elements from displaying an outline when the user performs a
+drag interaction on them.
+
+
+ restoreOutline ()
+
+ Cancels the effects of a previous L.DomUtil.preventOutline .
+
+
+ getSizedParentNode (<HTMLElement> el )
+ HTMLElement
+ Finds the closest parent node which size (width and height) is not null.
+
+
+ getScale (<HTMLElement> el )
+ Object
+ Computes the CSS scale currently applied on the element.
+Returns an object with x and y members as horizontal and vertical scales respectively,
+and boundingClientRect as the result of getBoundingClientRect() .
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ TRANSFORM
+ String
+ Vendor-prefixed transform style name (e.g. 'webkitTransform' for WebKit).
+
+
+ TRANSITION
+ String
+ Vendor-prefixed transition style name.
+
+
+ TRANSITION_END
+ String
+ Vendor-prefixed transitionend event name.
+
+
+
+
+
+
+ PosAnimation Used internally for panning animations, utilizing CSS3 Transitions for modern browsers and a timer fallback for IE6-9.
+
+
+Usage example
+
+
+
+
+
+
+
+var fx = new L.PosAnimation();
+fx.run(el, [300, 500], 0.5);
+
+
+
+
+
+
+
+
+Constructor
+
+
+
+
+
+
+
+
+ Constructor
+ Description
+
+
+
+ L.PosAnimation ()
+ Creates a PosAnimation object.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ start
+ Event
+ Fired when the animation starts
+
+
+ step
+ Event
+ Fired continuously during the animation.
+
+
+ end
+ Event
+ Fired when the animation ends.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ run (<HTMLElement> el , <Point > newPos , <Number> duration? , <Number> easeLinearity? )
+
+ Run an animation of a given element to a new position, optionally setting
+duration in seconds (0.25 by default) and easing linearity factor (3rd
+argument of the cubic bezier curve ,
+0.5 by default).
+
+
+
+ stop ()
+
+ Stops the animation (if currently running).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Draggable A class for making DOM elements draggable (including touch support).
+Used internally for map and marker dragging. Only works for elements
+that were positioned with L.DomUtil.setPosition .
+
+
+Usage example
+
+
+
+
+
+
+
+var draggable = new L.Draggable(elementToDrag);
+draggable.enable();
+
+
+
+
+
+
+
+
+Constructor
+
+
+
+
+
+
+
+
+ Constructor
+ Description
+
+
+
+ L.Draggable (<HTMLElement> el , <HTMLElement> dragHandle? , <Boolean> preventOutline? , <Draggable options > options? )
+ Creates a Draggable object for moving el when you start dragging the dragHandle element (equals el itself by default).
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ clickTolerance
+ Number
+ 3
+ The max number of pixels a user can shift the mouse pointer during a click
+for it to be considered a valid click (as opposed to a mouse drag).
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ down
+ Event
+ Fired when a drag is about to start.
+
+
+ dragstart
+ Event
+ Fired when a drag starts
+
+
+ predrag
+ Event
+ Fired continuously during dragging before each corresponding
+update of the element's position.
+
+
+ drag
+ Event
+ Fired continuously during dragging.
+
+
+ dragend
+ DragEndEvent
+ Fired when the drag ends.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ enable ()
+
+ Enables the dragging ability
+
+
+
+ disable ()
+
+ Disables the dragging ability
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Class L.Class powers the OOP facilities of Leaflet and is used to create almost all of the Leaflet classes documented here.
+In addition to implementing a simple classical inheritance model, it introduces several special properties for convenient code organization — options, includes and statics.
+
+
+Usage example
+
+
+
+
+
+
+
+var MyClass = L.Class.extend({
+initialize: function (greeter) {
+ this.greeter = greeter;
+ // class constructor
+},
+greet: function (name) {
+ alert(this.greeter + ', ' + name)
+ }
+});
+// create instance of MyClass, passing "Hello" to the constructor
+var a = new MyClass("Hello");
+// call greet method, alerting "Hello, World"
+a.greet("World");
+
+
+
+
+
+
+Class Factories
+
+
+
+You may have noticed that Leaflet objects are created without using
+the new keyword. This is achieved by complementing each class with a
+lowercase factory method:
+new L.Map('map'); // becomes:
+L.map('map');
+
+The factories are implemented very easily, and you can do this for your own classes:
+L.map = function (id, options) {
+ return new L.Map(id, options);
+};
+
+
+
+
+
+
+Inheritance
+
+
+
+You use L.Class.extend to define new classes, but you can use the same method on any class to inherit from it:
+var MyChildClass = MyClass.extend({
+ // ... new properties and methods
+});
+
+This will create a class that inherits all methods and properties of the parent class (through a proper prototype chain), adding or overriding the ones you pass to extend. It will also properly react to instanceof:
+var a = new MyChildClass();
+a instanceof MyChildClass; // true
+a instanceof MyClass; // true
+
+You can call parent methods (including constructor) from corresponding child ones (as you do with super calls in other languages) by accessing parent class prototype and using JavaScript's call or apply:
+var MyChildClass = MyClass.extend({
+ initialize: function () {
+ MyClass.prototype.initialize.call(this, "Yo");
+ },
+ greet: function (name) {
+ MyClass.prototype.greet.call(this, 'bro ' + name + '!');
+ }
+});
+var a = new MyChildClass();
+a.greet('Jason'); // alerts "Yo, bro Jason!"
+
+
+
+
+
+Options
+
+
+
+options is a special property that unlike other objects that you pass
+to extend will be merged with the parent one instead of overriding it
+completely, which makes managing configuration of objects and default
+values convenient:
+var MyClass = L.Class.extend({
+ options: {
+ myOption1: 'foo',
+ myOption2: 'bar'
+ }
+});
+var MyChildClass = MyClass.extend({
+ options: {
+ myOption1: 'baz',
+ myOption3: 5
+ }
+});
+var a = new MyChildClass();
+a.options.myOption1; // 'baz'
+a.options.myOption2; // 'bar'
+a.options.myOption3; // 5
+
+There's also L.Util.setOptions , a method for
+conveniently merging options passed to constructor with the defaults
+defines in the class:
+var MyClass = L.Class.extend({
+ options: {
+ foo: 'bar',
+ bla: 5
+ },
+ initialize: function (options) {
+ L.Util.setOptions(this, options);
+ ...
+ }
+});
+var a = new MyClass({bla: 10});
+a.options; // {foo: 'bar', bla: 10}
+
+Note that the options object allows any keys, not just
+the options defined by the class and its base classes.
+This means you can use the options object to store
+application specific information, as long as you avoid
+keys that are already used by the class in question.
+
+
+
+
+
+Includes
+
+
+
+includes is a special class property that merges all specified objects into the class (such objects are called mixins).
+ var MyMixin = {
+ foo: function () { ... },
+ bar: 5
+};
+var MyClass = L.Class.extend({
+ includes: MyMixin
+});
+var a = new MyClass();
+a.foo();
+
+You can also do such includes in runtime with the include method:
+MyClass.include(MyMixin);
+
+statics is just a convenience property that injects specified object properties as the static properties of the class, useful for defining constants:
+var MyClass = L.Class.extend({
+ statics: {
+ FOO: 'bar',
+ BLA: 5
+ }
+});
+MyClass.FOO; // 'bar'
+
+
+
+
+
+
+Constructor hooks
+
+
+
+If you're a plugin developer, you often need to add additional initialization code to existing classes (e.g. editing hooks for L.Polyline ). Leaflet comes with a way to do it easily using the addInitHook method:
+MyClass.addInitHook(function () {
+ // ... do something in constructor additionally
+ // e.g. add event listeners, set custom properties etc.
+});
+
+You can also use the following shortcut when you just need to make one additional method call:
+MyClass.addInitHook('methodName', arg1, arg2, …);
+
+
+
+
+
+
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ extend (<Object> props )
+ Function
+ Extends the current class given the properties to be included.
+Returns a Javascript function that is a class constructor (to be called with new).
+
+
+ include (<Object> properties )
+ this
+ Includes a mixin into the current class.
+
+
+ mergeOptions (<Object> options )
+ this
+ Merges options into the defaults of the class.
+
+
+ addInitHook (<Function> fn )
+ this
+ Adds a constructor hook to the class.
+
+
+
+
+
+
+ Evented A set of methods shared between event-powered classes (like Map and Marker ). Generally, events allow you to execute some function when something happens with an object (e.g. the user clicks on the map, causing the map to fire 'click' event).
+
+
+Usage example
+
+
+
+
+
+
+
+map.on('click', function(e) {
+ alert(e.latlng);
+} );
+
+Leaflet deals with event listeners by reference, so if you want to add a listener and then remove it, define it as a function:
+function onClick(e) { ... }
+map.on('click', onClick);
+map.off('click', onClick);
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+ Layer A set of methods from the Layer base class that all Leaflet layers use.
+Inherits all methods, options and events from L.Evented .
+
+
+Usage example
+
+
+
+
+
+
+
+var layer = L.Marker(latlng).addTo(map);
+layer.addTo(map);
+layer.remove();
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ onAdd (<Map > map )
+ this
+ Should contain code that creates DOM elements for the layer, adds them to map panes where they should belong and puts listeners on relevant map events. Called on map.addLayer(layer) .
+
+
+
+ onRemove (<Map > map )
+ this
+ Should contain all clean up code that removes the layer's elements from the DOM and removes listeners previously added in onAdd . Called on map.removeLayer(layer) .
+
+
+
+ getEvents ()
+ Object
+ This optional method should return an object like { viewreset: this._reset } for addEventListener . The event handlers in this object will be automatically added and removed from the map with your layer.
+
+
+
+ getAttribution ()
+ String
+ This optional method should return a string containing HTML to be shown on the Attribution control whenever the layer is visible.
+
+
+
+ beforeAdd (<Map > map )
+ this
+ Optional method. Called on map.addLayer(layer) , before the layer is added to the map, before events are initialized, without waiting until the map is in a usable state. Use for early initialization only.
+
+
+
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Interactive layer Some Layer s can be made interactive - when the user interacts
+with such a layer, mouse events like click and mouseover can be handled.
+Use the event handling methods to handle these events.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this layer will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+Mouse events
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Control L.Control is a base class for implementing map controls. Handles positioning.
+All other controls extend from this class.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ onAdd (<Map > map )
+ HTMLElement
+ Should return the container DOM element for the control and add listeners on relevant map events. Called on control.addTo(map) .
+
+
+
+ onRemove (<Map > map )
+
+ Optional method. Should contain all clean up code that removes the listeners previously added in onAdd . Called on control.remove() .
+
+
+
+
+
+
+
+ Handler Abstract class for map interaction handlers
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ enable ()
+ this
+ Enables the handler
+
+
+
+ disable ()
+ this
+ Disables the handler
+
+
+
+ enabled ()
+ Boolean
+ Returns true if the handler is enabled
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addHooks ()
+
+ Called when the handler is enabled, should add event hooks.
+
+
+
+ removeHooks ()
+
+ Called when the handler is disabled, should remove the event hooks added previously.
+
+
+
+
+
+
+
+
+Functions
+
+
+
+There is static function which can be called without instantiating L.Handler:
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ addTo (<Map > map , <String> name )
+ this
+ Adds a new Handler to the given map with the given name.
+
+
+
+
+
+
+ Projection An object with methods for projecting geographical coordinates of the world onto
+a flat surface (and back). See Map projection .
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ project (<LatLng > latlng )
+ Point
+ Projects geographical coordinates into a 2D point.
+Only accepts actual L.LatLng instances, not arrays.
+
+
+
+ unproject (<Point > point )
+ LatLng
+ The inverse of project. Projects a 2D point into a geographical location.
+Only accepts actual L.Point instances, not arrays.
+Note that the projection instances do not inherit from Leaflet's Class object,
+and can't be instantiated. Also, new classes can't inherit from them,
+and methods can't be added to them with the include function.
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ bounds
+ Bounds
+ The bounds (specified in CRS units) where the projection is valid
+
+
+
+
+
+
+
+Defined projections
+
+
+
+
+
+
+
+
+
+ Projection
+ Description
+
+
+
+ L.Projection.LonLat
+ Equirectangular, or Plate Carree projection — the most simple projection,
+mostly used by GIS enthusiasts. Directly maps x as longitude, and y as
+latitude. Also suitable for flat worlds, e.g. game maps. Used by the
+EPSG:4326 and Simple CRS.
+
+
+ L.Projection.Mercator
+ Elliptical Mercator projection — more complex than Spherical Mercator. Takes into account that Earth is a geoid, not a perfect sphere. Used by the EPSG:3395 CRS.
+
+
+ L.Projection.SphericalMercator
+ Spherical Mercator projection — the most common projection for online maps,
+used by almost all free and commercial tile providers. Assumes that Earth is
+a sphere. Used by the EPSG:3857 CRS.
+
+
+
+
+
+
+ CRS
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ latLngToPoint (<LatLng > latlng , <Number> zoom )
+ Point
+ Projects geographical coordinates into pixel coordinates for a given zoom.
+
+
+
+ pointToLatLng (<Point > point , <Number> zoom )
+ LatLng
+ The inverse of latLngToPoint. Projects pixel coordinates on a given
+zoom into geographical coordinates.
+
+
+
+ project (<LatLng > latlng )
+ Point
+ Projects geographical coordinates into coordinates in units accepted for
+this CRS (e.g. meters for EPSG:3857, for passing it to WMS services).
+
+
+
+ unproject (<Point > point )
+ LatLng
+ Given a projected coordinate returns the corresponding LatLng.
+The inverse of project.
+
+
+
+ scale (<Number> zoom )
+ Number
+ Returns the scale used when transforming projected coordinates into
+pixel coordinates for a particular zoom. For example, it returns
+256 * 2^zoom for Mercator-based CRS.
+
+
+
+ zoom (<Number> scale )
+ Number
+ Inverse of scale(), returns the zoom level corresponding to a scale
+factor of scale.
+
+
+
+ getProjectedBounds (<Number> zoom )
+ Bounds
+ Returns the projection's bounds scaled and transformed for the provided zoom.
+
+
+
+ distance (<LatLng > latlng1 , <LatLng > latlng2 )
+ Number
+ Returns the distance between two geographical coordinates.
+
+
+
+ wrapLatLng (<LatLng > latlng )
+ LatLng
+ Returns a LatLng where lat and lng has been wrapped according to the
+CRS's wrapLat and wrapLng properties, if they are outside the CRS's bounds.
+
+
+
+ wrapLatLngBounds (<LatLngBounds > bounds )
+ LatLngBounds
+ Returns a LatLngBounds with the same size as the given one, ensuring
+that its center is within the CRS's bounds.
+Only accepts actual L.LatLngBounds instances, not arrays.
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ code
+ String
+ Standard code name of the CRS passed into WMS services (e.g. 'EPSG:3857')
+
+
+ wrapLng
+ Number[]
+ An array of two numbers defining whether the longitude (horizontal) coordinate
+axis wraps around a given range and how. Defaults to [-180, 180] in most
+geographical CRSs. If undefined, the longitude axis does not wrap around.
+
+
+ wrapLat
+ Number[]
+ Like wrapLng, but for the latitude (vertical) axis.
+
+
+ infinite
+ Boolean
+ If true, the coordinate space will be unbounded (infinite in both axes)
+
+
+
+
+
+
+
+Defined CRSs
+
+
+
+
+
+
+
+
+ CRS
+ Description
+
+
+
+ L.CRS.Earth
+ Serves as the base for CRS that are global such that they cover the earth.
+Can only be used as the base for other CRS and cannot be used directly,
+since it does not have a code, projection or transformation . distance() returns
+meters.
+
+
+ L.CRS.EPSG3395
+ Rarely used by some commercial tile providers. Uses Elliptical Mercator projection.
+
+
+ L.CRS.EPSG3857
+ The most common CRS for online maps, used by almost all free and commercial
+tile providers. Uses Spherical Mercator projection. Set in by default in
+Map's crs option.
+
+
+ L.CRS.EPSG4326
+ A common CRS among GIS enthusiasts. Uses simple Equirectangular projection.
+Leaflet 1.0.x complies with the TMS coordinate scheme for EPSG:4326 ,
+which is a breaking change from 0.7.x behaviour. If you are using a TileLayer
+with this CRS, ensure that there are two 256x256 pixel tiles covering the
+whole earth at zoom level zero, and that the tile coordinate origin is (-180,+90),
+or (-180,-90) for TileLayers with the tms option set.
+
+
+ L.CRS.Base
+ Object that defines coordinate reference systems for projecting
+geographical points into pixel (screen) coordinates and back (and to
+coordinates in other units for WMS services). See
+spatial reference system .
+Leaflet defines the most usual CRSs by default. If you want to use a
+CRS not defined by default, take a look at the
+Proj4Leaflet plugin.
+Note that the CRS instances do not inherit from Leaflet's Class object,
+and can't be instantiated. Also, new classes can't inherit from them,
+and methods can't be added to them with the include function.
+
+
+ L.CRS.Simple
+ A simple CRS that maps longitude and latitude into x and y directly.
+May be used for maps of flat surfaces (e.g. game maps). Note that the y
+axis should still be inverted (going from bottom to top). distance() returns
+simple euclidean distance.
+
+
+
+
+
+
+ Renderer Base class for vector renderer implementations (SVG , Canvas ). Handles the
+DOM container of the renderer, its bounds, and its zoom animation.
+A Renderer works as an implicit layer group for all Path s - the renderer
+itself can be added or removed to the map. All paths use a renderer, which can
+be implicit (the map will decide the type of renderer and use it automatically)
+or explicit (using the renderer option of the path).
+Do not use this class directly, use SVG and Canvas instead.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ padding
+ Number
+ 0.1
+ How much to extend the clip area around the map view (relative to its size)
+e.g. 0.1 would be 10% of map view in each direction
+
+
+ tolerance
+ Number
+ 0
+ How much to extend click tolerance round a path/object on the map
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ update
+ Event
+ Fired when the renderer updates its bounds, center and zoom, for example when
+its map has moved
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Event objects Whenever a class inheriting from Evented fires an event, a listener function
+will be called with an event argument, which is a plain object containing
+information about the event. For example:
+
map.on('click', function(ev) {
+ alert(ev.latlng); // ev is an event object (MouseEvent in this case)
+});
+
+
The information available depends on the event type:
+
+
+
+
+Event
+
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+KeyboardEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ originalEvent
+ DOMEvent
+ The original DOM KeyboardEvent that triggered this Leaflet event.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+MouseEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ latlng
+ LatLng
+ The geographical point where the mouse event occurred.
+
+
+ layerPoint
+ Point
+ Pixel coordinates of the point where the mouse event occurred relative to the map layer.
+
+
+ containerPoint
+ Point
+ Pixel coordinates of the point where the mouse event occurred relative to the map сontainer.
+
+
+ originalEvent
+ DOMEvent
+ The original DOM MouseEvent or DOM TouchEvent that triggered this Leaflet event.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+LocationEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ latlng
+ LatLng
+ Detected geographical location of the user.
+
+
+ bounds
+ LatLngBounds
+ Geographical bounds of the area user is located in (with respect to the accuracy of location).
+
+
+ accuracy
+ Number
+ Accuracy of location in meters.
+
+
+ altitude
+ Number
+ Height of the position above the WGS84 ellipsoid in meters.
+
+
+ altitudeAccuracy
+ Number
+ Accuracy of altitude in meters.
+
+
+ heading
+ Number
+ The direction of travel in degrees counting clockwise from true North.
+
+
+ speed
+ Number
+ Current velocity in meters per second.
+
+
+ timestamp
+ Number
+ The time when the position was acquired.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+ErrorEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ message
+ String
+ Error message.
+
+
+ code
+ Number
+ Error code (if applicable).
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+LayerEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ layer
+ Layer
+ The layer that was added or removed.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+
+
+
+
+
+
+
+
+LayersControlEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ layer
+ Layer
+ The layer that was added or removed.
+
+
+ name
+ String
+ The name of the layer that was added or removed.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+
+
+
+
+
+
+
+
+TileEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ tile
+ HTMLElement
+ The tile element (image).
+
+
+ coords
+ Point
+ Point object with the tile's x, y, and z (zoom level) coordinates.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+TileErrorEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ tile
+ HTMLElement
+ The tile element (image).
+
+
+ coords
+ Point
+ Point object with the tile's x, y, and z (zoom level) coordinates.
+
+
+ error
+ *
+ Error passed to the tile's done() callback.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+ResizeEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ oldSize
+ Point
+ The old size before resize event.
+
+
+ newSize
+ Point
+ The new size after the resize event.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+GeoJSONEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ layer
+ Layer
+ The layer for the GeoJSON feature that is being added to the map.
+
+
+ properties
+ Object
+ GeoJSON properties of the feature.
+
+
+ geometryType
+ String
+ GeoJSON geometry type of the feature.
+
+
+ id
+ String
+ GeoJSON ID of the feature (if present).
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ tooltip
+ Tooltip
+ The tooltip that was opened or closed.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+DragEndEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ distance
+ Number
+ The distance in pixels the draggable element was moved by.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+ZoomAnimEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ center
+ LatLng
+ The current center of the map
+
+
+ zoom
+ Number
+ The current zoom level of the map
+
+
+ noUpdate
+ Boolean
+ Whether layers should update their contents due to this event
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+ DivOverlay Base model for L.Popup and L.Tooltip. Inherit from it for custom popup like plugins.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ offset
+ Point
+ Point(0, 7)
+ The offset of the popup position. Useful to control the anchor
+of the popup when opening it on some overlays.
+
+
+ className
+ String
+ ''
+ A custom CSS class name to assign to the popup.
+
+
+ pane
+ String
+ 'popupPane'
+ Map pane where the popup will be added.
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Global Switches Global switches are created for rare cases and generally make
+Leaflet to not detect a particular browser feature even if it's
+there. You need to set the switch as a global variable to true
+before including Leaflet on the page, like this:
+
<script>L_NO_TOUCH = true;</script>
+<script src="leaflet.js"></script>
+
+
+
+
+Switch
+Description
+
+
+
+
+L_NO_TOUCH
+Forces Leaflet to not use touch events even if it detects them.
+
+
+L_DISABLE_3D
+Forces Leaflet to not use hardware-accelerated CSS 3D transforms for positioning (which may cause glitches in some rare environments) even if they're supported.
+
+
+
+
+
noConflict This method restores the L global variable to the original value
+it had before Leaflet inclusion, and returns the real Leaflet
+namespace so you can put it elsewhere, like this:
+
<script src='libs/l.js'>
+<!-- L points to some other library -->
+<script src='leaflet.js'>
+<!-- you include Leaflet, it replaces the L variable to Leaflet namespace -->
+<script>
+var Leaflet = L.noConflict();
+// now L points to that other library again, and you can use Leaflet.Map etc.
+</script>
+
+
+
version A constant that represents the Leaflet version in use.
+
L.version; // contains "1.0.0" (or whatever version is currently in use)
+
diff --git a/src/public/Leaflet-1.7.1/docs/reference-1.5.1.html b/src/public/Leaflet-1.7.1/docs/reference-1.5.1.html
new file mode 100644
index 0000000..e04f280
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/reference-1.5.1.html
@@ -0,0 +1,4 @@
+---
+layout: redirected
+redirect_to: reference-1.5.0.html
+---
\ No newline at end of file
diff --git a/src/public/Leaflet-1.7.1/docs/reference-1.6.0.html b/src/public/Leaflet-1.7.1/docs/reference-1.6.0.html
new file mode 100644
index 0000000..86cc9d4
--- /dev/null
+++ b/src/public/Leaflet-1.7.1/docs/reference-1.6.0.html
@@ -0,0 +1,24886 @@
+---
+layout: v2
+title: Documentation
+bodyclass: api-page
+---
+
+
Leaflet API reference
+
+
This reference reflects Leaflet 1.6.0 . Check this list if you are using a different version of Leaflet.
+
+
+
+
Map
+
+
Map Methods
+
+
Map Misc
+
+
+
+
UI Layers
+
+
Raster Layers
+
+
Vector Layers
+
+
+
+
Other Layers
+
+
Basic Types
+
+
Controls
+
+
+
+
+
+
+
+
+
+
Utility
+
+
DOM Utility
+
+
+
+
Base Classes
+
+
+
Misc
+
+
+
+
+
Map The central class of the API — it is used to create a map on a page and manipulate it.
+
+
+Usage example
+
+
+
+
+
+
+
+// initialize the map on the "map" div with a given center and zoom
+var map = L.map('map', {
+ center: [51.505, -0.09],
+ zoom: 13
+});
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.map (<String> id , <Map options> options? )
+ Instantiates a map object given the DOM ID of a <div> element
+and optionally an object literal with Map options.
+
+
+ L.map (<HTMLElement> el , <Map options> options? )
+ Instantiates a map object given an instance of a <div> HTML element
+and optionally an object literal with Map options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ preferCanvas
+ Boolean
+ false
+ Whether Path s should be rendered on a Canvas renderer.
+By default, all Paths are rendered in a SVG renderer.
+
+
+
+
+
+Control options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attributionControl
+ Boolean
+ true
+ Whether a attribution control is added to the map by default.
+
+
+ zoomControl
+ Boolean
+ true
+ Whether a zoom control is added to the map by default.
+
+
+
+
+
+Interaction Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+
+ zoomSnap
+ Number
+ 1
+ Forces the map's zoom level to always be a multiple of this, particularly
+right after a fitBounds() or a pinch-zoom.
+By default, the zoom level snaps to the nearest integer; lower values
+(e.g. 0.5 or 0.1) allow for greater granularity. A value of 0
+means the zoom level will not be snapped after fitBounds or a pinch-zoom.
+
+
+ zoomDelta
+ Number
+ 1
+ Controls how much the map's zoom level will change after a
+zoomIn() , zoomOut() , pressing +
+or - on the keyboard, or using the zoom controls .
+Values smaller than 1 (e.g. 0.5) allow for greater granularity.
+
+
+ trackResize
+ Boolean
+ true
+ Whether the map automatically handles browser window resize to update itself.
+
+
+ boxZoom
+ Boolean
+ true
+ Whether the map can be zoomed to a rectangular area specified by
+dragging the mouse while pressing the shift key.
+
+
+ doubleClickZoom
+ Boolean|String
+ true
+ Whether the map can be zoomed in by double clicking on it and
+zoomed out by double clicking while holding shift. If passed
+'center', double-click zoom will zoom to the center of the
+ view regardless of where the mouse was.
+
+
+ dragging
+ Boolean
+ true
+ Whether the map be draggable with mouse/touch or not.
+
+
+
+
+
+Map State Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ crs
+ CRS
+ L.CRS.EPSG3857
+ The Coordinate Reference System to use. Don't change this if you're not
+sure what it means.
+
+
+ center
+ LatLng
+ undefined
+ Initial geographic center of the map
+
+
+ zoom
+ Number
+ undefined
+ Initial map zoom level
+
+
+ minZoom
+ Number
+ *
+ Minimum zoom level of the map.
+If not specified and at least one GridLayer or TileLayer is in the map,
+the lowest of their minZoom options will be used instead.
+
+
+ maxZoom
+ Number
+ *
+ Maximum zoom level of the map.
+If not specified and at least one GridLayer or TileLayer is in the map,
+the highest of their maxZoom options will be used instead.
+
+
+ layers
+ Layer[]
+ []
+ Array of layers that will be added to the map initially
+
+
+ maxBounds
+ LatLngBounds
+ null
+ When this option is set, the map restricts the view to the given
+geographical bounds, bouncing the user back if the user tries to pan
+outside the view. To set the restriction dynamically, use
+setMaxBounds method.
+
+
+ renderer
+ Renderer
+ *
+ The default method for drawing vector layers on the map. L.SVG
+or L.Canvas by default depending on browser support.
+
+
+
+
+
+Animation Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ zoomAnimation
+ Boolean
+ true
+ Whether the map zoom animation is enabled. By default it's enabled
+in all browsers that support CSS3 Transitions except Android.
+
+
+ zoomAnimationThreshold
+ Number
+ 4
+ Won't animate zoom if the zoom difference exceeds this value.
+
+
+ fadeAnimation
+ Boolean
+ true
+ Whether the tile fade animation is enabled. By default it's enabled
+in all browsers that support CSS3 Transitions except Android.
+
+
+ markerZoomAnimation
+ Boolean
+ true
+ Whether markers animate their zoom with the zoom animation, if disabled
+they will disappear for the length of the animation. By default it's
+enabled in all browsers that support CSS3 Transitions except Android.
+
+
+ transform3DLimit
+ Number
+ 2^23
+ Defines the maximum size of a CSS translation transform. The default
+value should not be changed unless a web browser positions layers in
+the wrong place after doing a large panBy.
+
+
+
+
+
+Panning Inertia Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ inertia
+ Boolean
+ *
+ If enabled, panning of the map will have an inertia effect where
+the map builds momentum while dragging and continues moving in
+the same direction for some time. Feels especially nice on touch
+devices. Enabled by default unless running on old Android devices.
+
+
+ inertiaDeceleration
+ Number
+ 3000
+ The rate with which the inertial movement slows down, in pixels/second².
+
+
+ inertiaMaxSpeed
+ Number
+ Infinity
+ Max speed of the inertial movement, in pixels/second.
+
+
+ easeLinearity
+ Number
+ 0.2
+
+
+
+ worldCopyJump
+ Boolean
+ false
+ With this option enabled, the map tracks when you pan to another "copy"
+of the world and seamlessly jumps to the original one so that all overlays
+like markers and vector layers are still visible.
+
+
+ maxBoundsViscosity
+ Number
+ 0.0
+ If maxBounds is set, this option will control how solid the bounds
+are when dragging the map around. The default value of 0.0 allows the
+user to drag outside the bounds at normal speed, higher values will
+slow down map dragging outside bounds, and 1.0 makes the bounds fully
+solid, preventing the user from dragging outside the bounds.
+
+
+
+
+
+Keyboard Navigation Options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ keyboard
+ Boolean
+ true
+ Makes the map focusable and allows users to navigate the map with keyboard
+arrows and +/- keys.
+
+
+ keyboardPanDelta
+ Number
+ 80
+ Amount of pixels to pan when pressing an arrow key.
+
+
+
+
+
+Mousewheel options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ scrollWheelZoom
+ Boolean|String
+ true
+ Whether the map can be zoomed by using the mouse wheel. If passed 'center',
+it will zoom to the center of the view regardless of where the mouse was.
+
+
+ wheelDebounceTime
+ Number
+ 40
+ Limits the rate at which a wheel can fire (in milliseconds). By default
+user can't zoom via wheel more often than once per 40 ms.
+
+
+ wheelPxPerZoomLevel
+ Number
+ 60
+ How many scroll pixels (as reported by L.DomEvent.getWheelDelta )
+mean a change of one full zoom level. Smaller values will make wheel-zooming
+faster (and vice versa).
+
+
+
+
+
+Touch interaction options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ tap
+ Boolean
+ true
+ Enables mobile hacks for supporting instant taps (fixing 200ms click
+delay on iOS/Android) and touch holds (fired as contextmenu events).
+
+
+ tapTolerance
+ Number
+ 15
+ The max number of pixels a user can shift his finger during touch
+for it to be considered a valid tap.
+
+
+ touchZoom
+ Boolean|String
+ *
+ Whether the map can be zoomed by touch-dragging with two fingers. If
+passed 'center', it will zoom to the center of the view regardless of
+where the touch events (fingers) were. Enabled for touch-capable web
+browsers except for old Androids.
+
+
+ bounceAtZoomLimits
+ Boolean
+ true
+ Set it to false if you don't want the map to zoom beyond min/max zoom
+and then bounce back when pinch-zooming.
+
+
+
+
+
+
+
+Events
+
+
+
+Layer events
+
+
+
+
+
+
+Map state change events
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ zoomlevelschange
+ Event
+ Fired when the number of zoomlevels on the map is changed due
+to adding or removing a layer.
+
+
+ resize
+ ResizeEvent
+ Fired when the map is resized.
+
+
+ unload
+ Event
+ Fired when the map is destroyed with remove method.
+
+
+ viewreset
+ Event
+ Fired when the map needs to redraw its content (this usually happens
+on map zoom or load). Very useful for creating custom overlays.
+
+
+ load
+ Event
+ Fired when the map is initialized (when its center and zoom are set
+for the first time).
+
+
+ zoomstart
+ Event
+ Fired when the map zoom is about to change (e.g. before zoom animation).
+
+
+ movestart
+ Event
+ Fired when the view of the map starts changing (e.g. user starts dragging the map).
+
+
+ zoom
+ Event
+ Fired repeatedly during any change in zoom level, including zoom
+and fly animations.
+
+
+ move
+ Event
+ Fired repeatedly during any movement of the map, including pan and
+fly animations.
+
+
+ zoomend
+ Event
+ Fired when the map has changed, after any animations.
+
+
+ moveend
+ Event
+ Fired when the center of the map stops changing (e.g. user stopped
+dragging the map).
+
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+ autopanstart
+ Event
+ Fired when the map starts autopanning when opening a popup.
+
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip is opened in the map.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip in the map is closed.
+
+
+
+
+
+Location events
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ locationerror
+ ErrorEvent
+ Fired when geolocation (using the locate method) failed.
+
+
+ locationfound
+ LocationEvent
+ Fired when geolocation (using the locate method)
+went successfully.
+
+
+
+
+
+Interaction events
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the map.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the map.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the map.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button on the map.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the map.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the map.
+
+
+ mousemove
+ MouseEvent
+ Fired while the mouse moves over the map.
+
+
+
+ keypress
+ KeyboardEvent
+ Fired when the user presses a key from the keyboard that produces a character value while the map is focused.
+
+
+ keydown
+ KeyboardEvent
+ Fired when the user presses a key from the keyboard while the map is focused. Unlike the keypress event,
+the keydown event is fired for keys that produce a character value and for keys
+that do not produce a character value.
+
+
+ keyup
+ KeyboardEvent
+ Fired when the user releases a key from the keyboard while the map is focused.
+
+
+ preclick
+ MouseEvent
+ Fired before mouse click on the map (sometimes useful when you
+want something to happen on click before any existing click
+handlers start running).
+
+
+
+
+
+Other Events
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ zoomanim
+ ZoomAnimEvent
+ Fired at least once per zoom animation. For continuous zoom, like pinch zooming, fired once per frame during zoom.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getRenderer (<Path > layer )
+ Renderer
+ Returns the instance of Renderer that should be used to render the given
+Path . It will ensure that the renderer options of the map and paths
+are respected, and that the renderers do exist on the map.
+
+
+
+
+
+
+Methods for Layers and Controls
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addControl (<Control > control )
+ this
+ Adds the given control to the map
+
+
+
+ removeControl (<Control > control )
+ this
+ Removes the given control from the map
+
+
+
+ addLayer (<Layer > layer )
+ this
+ Adds the given layer to the map
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Removes the given layer from the map.
+
+
+
+ hasLayer (<Layer > layer )
+ Boolean
+ Returns true if the given layer is currently added to the map
+
+
+
+ eachLayer (<Function> fn , <Object> context? )
+ this
+ Iterates over the layers of the map, optionally specifying context of the iterator function.
+map.eachLayer(function(layer){
+ layer.bindPopup('Hello');
+});
+
+
+
+
+
+
+ openTooltip (<Tooltip > tooltip )
+ this
+ Opens the specified tooltip.
+
+
+
+ openTooltip (<String|HTMLElement> content , <LatLng > latlng , <Tooltip options > options? )
+ this
+ Creates a tooltip with the specified content and options and open it.
+
+
+
+ closeTooltip (<Tooltip > tooltip? )
+ this
+ Closes the tooltip given as parameter.
+
+
+
+
+
+
+Methods for modifying map state
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setView (<LatLng > center , <Number> zoom , <Zoom/pan options > options? )
+ this
+ Sets the view of the map (geographical center and zoom) with the given
+animation options.
+
+
+
+ setZoom (<Number> zoom , <Zoom/pan options > options? )
+ this
+ Sets the zoom of the map.
+
+
+
+ zoomIn (<Number> delta? , <Zoom options > options? )
+ this
+ Increases the zoom of the map by delta (zoomDelta by default).
+
+
+
+ zoomOut (<Number> delta? , <Zoom options > options? )
+ this
+ Decreases the zoom of the map by delta (zoomDelta by default).
+
+
+
+ setZoomAround (<LatLng > latlng , <Number> zoom , <Zoom options > options )
+ this
+ Zooms the map while keeping a specified geographical point on the map
+stationary (e.g. used internally for scroll zoom and double-click zoom).
+
+
+
+ setZoomAround (<Point > offset , <Number> zoom , <Zoom options > options )
+ this
+ Zooms the map while keeping a specified pixel on the map (relative to the top-left corner) stationary.
+
+
+
+ fitBounds (<LatLngBounds > bounds , <fitBounds options > options? )
+ this
+ Sets a map view that contains the given geographical bounds with the
+maximum zoom level possible.
+
+
+
+ fitWorld (<fitBounds options > options? )
+ this
+ Sets a map view that mostly contains the whole world with the maximum
+zoom level possible.
+
+
+
+ panTo (<LatLng > latlng , <Pan options > options? )
+ this
+ Pans the map to a given center.
+
+
+
+ panBy (<Point > offset , <Pan options > options? )
+ this
+ Pans the map by a given number of pixels (animated).
+
+
+
+ flyTo (<LatLng > latlng , <Number> zoom? , <Zoom/pan options > options? )
+ this
+ Sets the view of the map (geographical center and zoom) performing a smooth
+pan-zoom animation.
+
+
+
+ flyToBounds (<LatLngBounds > bounds , <fitBounds options > options? )
+ this
+ Sets the view of the map with a smooth animation like flyTo ,
+but takes a bounds parameter like fitBounds .
+
+
+
+ setMaxBounds (<Bounds > bounds )
+ this
+ Restricts the map view to the given bounds (see the maxBounds option).
+
+
+
+ setMinZoom (<Number> zoom )
+ this
+ Sets the lower limit for the available zoom levels (see the minZoom option).
+
+
+
+ setMaxZoom (<Number> zoom )
+ this
+ Sets the upper limit for the available zoom levels (see the maxZoom option).
+
+
+
+ panInsideBounds (<LatLngBounds > bounds , <Pan options > options? )
+ this
+ Pans the map to the closest view that would lie inside the given bounds (if it's not already), controlling the animation using the options specific, if any.
+
+
+
+ panInside (<LatLng > latlng , <options> options? )
+ this
+ Pans the map the minimum amount to make the latlng visible. Use
+padding, paddingTopLeft and paddingTopRight options to fit
+the display to more restricted bounds, like fitBounds .
+If latlng is already within the (optionally padded) display bounds,
+the map will not be panned.
+
+
+
+ invalidateSize (<Zoom/pan options > options )
+ this
+ Checks if the map container size changed and updates the map if so —
+call it after you've changed the map size dynamically, also animating
+pan by default. If options.pan is false, panning will not occur.
+If options.debounceMoveend is true, it will delay moveend event so
+that it doesn't happen often even if the method is called many
+times in a row.
+
+
+
+ invalidateSize (<Boolean> animate )
+ this
+ Checks if the map container size changed and updates the map if so —
+call it after you've changed the map size dynamically, also animating
+pan by default.
+
+
+
+ stop ()
+ this
+ Stops the currently running panTo or flyTo animation, if any.
+
+
+
+
+
+
+Geolocation methods
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ locate (<Locate options > options? )
+ this
+ Tries to locate the user using the Geolocation API, firing a locationfound
+event with location data on success or a locationerror event on failure,
+and optionally sets the map view to the user's location with respect to
+detection accuracy (or to the world view if geolocation failed).
+Note that, if your page doesn't use HTTPS, this method will fail in
+modern browsers (Chrome 50 and newer )
+See Locate options for more details.
+
+
+
+ stopLocate ()
+ this
+ Stops watching location previously initiated by map.locate({watch: true})
+and aborts resetting the map view if map.locate was called with
+{setView: true}.
+
+
+
+
+
+
+Other Methods
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addHandler (<String> name , <Function> HandlerClass )
+ this
+ Adds a new Handler to the map, given its name and constructor function.
+
+
+
+ remove ()
+ this
+ Destroys the map and clears all related event listeners.
+
+
+
+ createPane (<String> name , <HTMLElement> container? )
+ HTMLElement
+ Creates a new map pane with the given name if it doesn't exist already,
+then returns it. The pane is created as a child of container, or
+as a child of the main map pane if not set.
+
+
+
+ getPane (<String|HTMLElement> pane )
+ HTMLElement
+ Returns a map pane , given its name or its HTML element (its identity).
+
+
+
+ getPanes ()
+ Object
+ Returns a plain object containing the names of all panes as keys and
+the panes as values.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTML element that contains the map.
+
+
+
+ whenReady (<Function> fn , <Object> context? )
+ this
+ Runs the given function fn when the map gets initialized with
+a view (center and zoom) and at least one layer, or immediately
+if it's already initialized, optionally passing a function context.
+
+
+
+
+
+
+Methods for Getting Map State
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getCenter ()
+ LatLng
+ Returns the geographical center of the map view
+
+
+
+ getZoom ()
+ Number
+ Returns the current zoom level of the map view
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the geographical bounds visible in the current map view
+
+
+
+ getMinZoom ()
+ Number
+ Returns the minimum zoom level of the map (if set in the minZoom option of the map or of any layers), or 0 by default.
+
+
+
+ getMaxZoom ()
+ Number
+ Returns the maximum zoom level of the map (if set in the maxZoom option of the map or of any layers).
+
+
+
+ getBoundsZoom (<LatLngBounds > bounds , <Boolean> inside? , <Point > padding? )
+ Number
+ Returns the maximum zoom level on which the given bounds fit to the map
+view in its entirety. If inside (optional) is set to true, the method
+instead returns the minimum zoom level on which the map view fits into
+the given bounds in its entirety.
+
+
+
+ getSize ()
+ Point
+ Returns the current size of the map container (in pixels).
+
+
+
+ getPixelBounds ()
+ Bounds
+ Returns the bounds of the current map view in projected pixel
+coordinates (sometimes useful in layer and overlay implementations).
+
+
+
+ getPixelOrigin ()
+ Point
+ Returns the projected pixel coordinates of the top left point of
+the map layer (useful in custom layer and overlay implementations).
+
+
+
+ getPixelWorldBounds (<Number> zoom? )
+ Bounds
+ Returns the world's bounds in pixel coordinates for zoom level zoom.
+If zoom is omitted, the map's current zoom level is used.
+
+
+
+
+
+
+Conversion Methods
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getZoomScale (<Number> toZoom , <Number> fromZoom )
+ Number
+ Returns the scale factor to be applied to a map transition from zoom level
+fromZoom to toZoom. Used internally to help with zoom animations.
+
+
+
+ getScaleZoom (<Number> scale , <Number> fromZoom )
+ Number
+ Returns the zoom level that the map would end up at, if it is at fromZoom
+level and everything is scaled by a factor of scale. Inverse of
+getZoomScale .
+
+
+
+ project (<LatLng > latlng , <Number> zoom )
+ Point
+ Projects a geographical coordinate LatLng according to the projection
+of the map's CRS, then scales it according to zoom and the CRS's
+Transformation . The result is pixel coordinate relative to
+the CRS origin.
+
+
+
+ unproject (<Point > point , <Number> zoom )
+ LatLng
+ Inverse of project .
+
+
+
+ layerPointToLatLng (<Point > point )
+ LatLng
+ Given a pixel coordinate relative to the origin pixel ,
+returns the corresponding geographical coordinate (for the current zoom level).
+
+
+
+ latLngToLayerPoint (<LatLng > latlng )
+ Point
+ Given a geographical coordinate, returns the corresponding pixel coordinate
+relative to the origin pixel .
+
+
+
+ wrapLatLng (<LatLng > latlng )
+ LatLng
+ Returns a LatLng where lat and lng has been wrapped according to the
+map's CRS's wrapLat and wrapLng properties, if they are outside the
+CRS's bounds.
+By default this means longitude is wrapped around the dateline so its
+value is between -180 and +180 degrees.
+
+
+
+ wrapLatLngBounds (<LatLngBounds > bounds )
+ LatLngBounds
+ Returns a LatLngBounds with the same size as the given one, ensuring that
+its center is within the CRS's bounds.
+By default this means the center longitude is wrapped around the dateline so its
+value is between -180 and +180 degrees, and the majority of the bounds
+overlaps the CRS's bounds.
+
+
+
+ distance (<LatLng > latlng1 , <LatLng > latlng2 )
+ Number
+ Returns the distance between two geographical coordinates according to
+the map's CRS. By default this measures distance in meters.
+
+
+
+ containerPointToLayerPoint (<Point > point )
+ Point
+ Given a pixel coordinate relative to the map container, returns the corresponding
+pixel coordinate relative to the origin pixel .
+
+
+
+ layerPointToContainerPoint (<Point > point )
+ Point
+ Given a pixel coordinate relative to the origin pixel ,
+returns the corresponding pixel coordinate relative to the map container.
+
+
+
+ containerPointToLatLng (<Point > point )
+ LatLng
+ Given a pixel coordinate relative to the map container, returns
+the corresponding geographical coordinate (for the current zoom level).
+
+
+
+ latLngToContainerPoint (<LatLng > latlng )
+ Point
+ Given a geographical coordinate, returns the corresponding pixel coordinate
+relative to the map container.
+
+
+
+ mouseEventToContainerPoint (<MouseEvent > ev )
+ Point
+ Given a MouseEvent object, returns the pixel coordinate relative to the
+map container where the event took place.
+
+
+
+ mouseEventToLayerPoint (<MouseEvent > ev )
+ Point
+ Given a MouseEvent object, returns the pixel coordinate relative to
+the origin pixel where the event took place.
+
+
+
+ mouseEventToLatLng (<MouseEvent > ev )
+ LatLng
+ Given a MouseEvent object, returns geographical coordinate where the
+event took place.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+
+Properties
+
+
+
+Controls
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ zoomControl
+ Control.Zoom
+ The default zoom control (only available if the
+zoomControl option was true when creating the map).
+
+
+
+
+
+Handlers
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ boxZoom
+ Handler
+ Box (shift-drag with mouse) zoom handler.
+
+
+ doubleClickZoom
+ Handler
+ Double click zoom handler.
+
+
+ dragging
+ Handler
+ Map dragging handler (by both mouse and touch).
+
+
+ keyboard
+ Handler
+ Keyboard navigation handler.
+
+
+ scrollWheelZoom
+ Handler
+ Scroll wheel zoom handler.
+
+
+ tap
+ Handler
+ Mobile touch hacks (quick tap and touch hold) handler.
+
+
+ touchZoom
+ Handler
+ Touch zoom handler.
+
+
+
+
+
+
+
+Map panes
+
+
+
+
+
+
+
+
+
+ Pane
+ Type
+ Z-index
+ Description
+
+
+
+ mapPane
+ HTMLElement
+ 'auto'
+ Pane that contains all other map panes
+
+
+ tilePane
+ HTMLElement
+ 200
+ Pane for GridLayer s and TileLayer s
+
+
+ overlayPane
+ HTMLElement
+ 400
+ Pane for vectors (Path s, like Polyline s and Polygon s), ImageOverlay s and VideoOverlay s
+
+
+ shadowPane
+ HTMLElement
+ 500
+ Pane for overlay shadows (e.g. Marker shadows)
+
+
+ markerPane
+ HTMLElement
+ 600
+ Pane for Icon s of Marker s
+
+
+ tooltipPane
+ HTMLElement
+ 650
+ Pane for Tooltip s.
+
+
+
+
+
+
+
+
+
+
+Locate options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ watch
+ Boolean
+ false
+ If true, starts continuous watching of location changes (instead of detecting it
+once) using W3C watchPosition method. You can later stop watching using
+map.stopLocate() method.
+
+
+ setView
+ Boolean
+ false
+ If true, automatically sets the map view to the user location with respect to
+detection accuracy, or to world view if geolocation failed.
+
+
+ maxZoom
+ Number
+ Infinity
+ The maximum zoom for automatic view setting when using setView option.
+
+
+ timeout
+ Number
+ 10000
+ Number of milliseconds to wait for a response from geolocation before firing a
+locationerror event.
+
+
+ maximumAge
+ Number
+ 0
+ Maximum age of detected location. If less than this amount of milliseconds
+passed since last geolocation response, locate will return a cached location.
+
+
+ enableHighAccuracy
+ Boolean
+ false
+ Enables high accuracy, see description in the W3C spec .
+
+
+
+
+
+
+
+
+
+Zoom options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ animate
+ Boolean
+
+ If not specified, zoom animation will happen if the zoom origin is inside the
+current view. If true, the map will attempt animating zoom disregarding where
+zoom origin is. Setting false will make it always reset the view completely
+without animation.
+
+
+
+
+
+
+
+
+
+Pan options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ animate
+ Boolean
+
+ If true, panning will always be animated if possible. If false, it will
+not animate panning, either resetting the map view if panning more than a
+screen away, or just setting a new offset for the map pane (except for panBy
+which always does the latter).
+
+
+ duration
+ Number
+ 0.25
+ Duration of animated panning, in seconds.
+
+
+ easeLinearity
+ Number
+ 0.25
+ The curvature factor of panning animation easing (third parameter of the
+Cubic Bezier curve ). 1.0 means linear animation,
+and the smaller this number, the more bowed the curve.
+
+
+ noMoveStart
+ Boolean
+ false
+ If true, panning won't fire movestart event on start (used internally for
+panning inertia).
+
+
+
+
+
+
+
+
+
+Zoom/pan options
+
+
+
+
+
+
▶ Options inherited from Zoom options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ animate
+ Boolean
+
+ If not specified, zoom animation will happen if the zoom origin is inside the
+current view. If true, the map will attempt animating zoom disregarding where
+zoom origin is. Setting false will make it always reset the view completely
+without animation.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Pan options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ duration
+ Number
+ 0.25
+ Duration of animated panning, in seconds.
+
+
+ easeLinearity
+ Number
+ 0.25
+ The curvature factor of panning animation easing (third parameter of the
+Cubic Bezier curve ). 1.0 means linear animation,
+and the smaller this number, the more bowed the curve.
+
+
+ noMoveStart
+ Boolean
+ false
+ If true, panning won't fire movestart event on start (used internally for
+panning inertia).
+
+
+
+
+
+
+
+
+
+
+FitBounds options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ paddingTopLeft
+ Point
+ [0, 0]
+ Sets the amount of padding in the top left corner of a map container that
+shouldn't be accounted for when setting the view to fit bounds. Useful if you
+have some control overlays on the map like a sidebar and you don't want them
+to obscure objects you're zooming to.
+
+
+ paddingBottomRight
+ Point
+ [0, 0]
+ The same for the bottom right corner of the map.
+
+
+ padding
+ Point
+ [0, 0]
+ Equivalent of setting both top left and bottom right padding to the same value.
+
+
+ maxZoom
+ Number
+ null
+ The maximum possible zoom to use.
+
+
+
+
+
+
+
+
▶ Options inherited from Zoom options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ animate
+ Boolean
+
+ If not specified, zoom animation will happen if the zoom origin is inside the
+current view. If true, the map will attempt animating zoom disregarding where
+zoom origin is. Setting false will make it always reset the view completely
+without animation.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Pan options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ duration
+ Number
+ 0.25
+ Duration of animated panning, in seconds.
+
+
+ easeLinearity
+ Number
+ 0.25
+ The curvature factor of panning animation easing (third parameter of the
+Cubic Bezier curve ). 1.0 means linear animation,
+and the smaller this number, the more bowed the curve.
+
+
+ noMoveStart
+ Boolean
+ false
+ If true, panning won't fire movestart event on start (used internally for
+panning inertia).
+
+
+
+
+
+
+
+ Marker L.Marker is used to display clickable/draggable icons on the map. Extends Layer .
+
+
+Usage example
+
+
+
+
+
+
+
+L.marker([50.5, 30.5]).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.marker (<LatLng > latlng , <Marker options > options? )
+ Instantiates a Marker object given a geographical point and optionally an options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ icon
+ Icon
+ *
+ Icon instance to use for rendering the marker.
+See Icon documentation for details on how to customize the marker icon.
+If not specified, a common instance of L.Icon.Default is used.
+
+
+ keyboard
+ Boolean
+ true
+ Whether the marker can be tabbed to with a keyboard and clicked by pressing enter.
+
+
+ title
+ String
+ ''
+ Text for the browser tooltip that appear on marker hover (no tooltip by default).
+
+
+ alt
+ String
+ ''
+ Text for the alt attribute of the icon image (useful for accessibility).
+
+
+ zIndexOffset
+ Number
+ 0
+ By default, marker images zIndex is set automatically based on its latitude. Use this option if you want to put the marker on top of all others (or below), specifying a high value like 1000 (or high negative value, respectively).
+
+
+ opacity
+ Number
+ 1.0
+ The opacity of the marker.
+
+
+ riseOnHover
+ Boolean
+ false
+ If true, the marker will get on top of others when you hover the mouse over it.
+
+
+ riseOffset
+ Number
+ 250
+ The z-index offset used for the riseOnHover feature.
+
+
+ pane
+ String
+ 'markerPane'
+ Map pane where the markers icon will be added.
+Map pane where the markers shadow will be added.
+
+
+ bubblingMouseEvents
+ Boolean
+ false
+ When true, a mouse event on this marker will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+
+
+
+Draggable marker options
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ draggable
+ Boolean
+ false
+ Whether the marker is draggable with mouse/touch or not.
+
+
+ autoPan
+ Boolean
+ false
+ Whether to pan the map when dragging this marker near its edge or not.
+
+
+ autoPanPadding
+ Point
+ Point(50, 50)
+ Distance (in pixels to the left/right and to the top/bottom) of the
+map edge to start panning the map.
+
+
+ autoPanSpeed
+ Number
+ 10
+ Number of pixels the map should pan by.
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ move
+ Event
+ Fired when the marker is moved via setLatLng or by dragging . Old and new coordinates are included in event arguments as oldLatLng, latlng .
+
+
+
+
+
+Dragging events
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ dragstart
+ Event
+ Fired when the user starts dragging the marker.
+
+
+ movestart
+ Event
+ Fired when the marker starts moving (because of dragging).
+
+
+ drag
+ Event
+ Fired repeatedly while the user drags the marker.
+
+
+ dragend
+ DragEndEvent
+ Fired when the user stops dragging the marker.
+
+
+ moveend
+ Event
+ Fired when the marker stops moving (because of dragging).
+
+
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getLatLng ()
+ LatLng
+ Returns the current geographical position of the marker.
+
+
+
+ setLatLng (<LatLng > latlng )
+ this
+ Changes the marker position to the given point.
+
+
+
+ setZIndexOffset (<Number> offset )
+ this
+ Changes the zIndex offset of the marker.
+
+
+
+ getIcon ()
+ Icon
+ Returns the current icon used by the marker
+
+
+
+ setIcon (<Icon > icon )
+ this
+ Changes the marker icon.
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Changes the opacity of the marker.
+
+
+
+
+
+
+Other methods
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON (<Number> precision? )
+ Object
+ precision is the number of decimal places for coordinates.
+The default value is 6 places.
+Returns a GeoJSON representation of the marker (as a GeoJSON Point Feature).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+
+Properties
+
+
+
+Interaction handlers
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ dragging
+ Handler
+ Marker dragging handler (by both mouse and touch). Only valid when the marker is on the map (Otherwise set marker.options.draggable ).
+
+
+
+
+
+
+ Used to open popups in certain places of the map. Use Map.openPopup to
+open popups while making sure that only one popup is open at one time
+(recommended for usability), or use Map.addLayer to open as many as you want.
+
+
+
+
+
+
+
+
+
+
+If you want to just bind a popup to marker click and then open it, it's really easy:
+marker.bindPopup(popupContent).openPopup();
+
+Path overlays like polylines also have a bindPopup method.
+Here's a more complicated way to open a popup on a map:
+var popup = L.popup()
+ .setLatLng(latlng)
+ .setContent('<p>Hello world!<br />This is a nice popup.</p>')
+ .openOn(map);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Options inherited from DivOverlay
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Used to display small texts on top of map layers.
+
+
+
+
+
+
+
+
+
+
+marker.bindTooltip("my tooltip text").openTooltip();
+
+Note about tooltip offset. Leaflet takes two options in consideration
+for computing tooltip offsetting:
+
+the offset Tooltip option: it defaults to [0, 0], and it's specific to one tooltip.
+Add a positive x offset to move the tooltip to the right, and a positive y offset to
+move it to the bottom. Negatives will move to the left and top.
+the tooltipAnchor Icon option: this will only be considered for Marker. You
+should adapt this value if you use a custom icon.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.tooltip (<Tooltip options > options? , <Layer > source? )
+ Instantiates a Tooltip object given an optional options object that describes its appearance and location and an optional source object that is used to tag the tooltip with a reference to the Layer to which it refers.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'tooltipPane'
+ Map pane where the tooltip will be added.
+
+
+ offset
+ Point
+ Point(0, 0)
+ Optional offset of the tooltip position.
+
+
+ direction
+ String
+ 'auto'
+ Direction where to open the tooltip. Possible values are: right, left,
+top, bottom, center, auto.
+auto will dynamically switch between right and left according to the tooltip
+position on the map.
+
+
+ permanent
+ Boolean
+ false
+ Whether to open the tooltip permanently or only on mouseover.
+
+
+ sticky
+ Boolean
+ false
+ If true, the tooltip will follow the mouse instead of being fixed at the feature center.
+
+
+ interactive
+ Boolean
+ false
+ If true, the tooltip will listen to the feature events.
+
+
+ opacity
+ Number
+ 0.9
+ Tooltip container opacity.
+
+
+
+
+
+
+
+
▶ Options inherited from DivOverlay
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ className
+ String
+ ''
+ A custom CSS class name to assign to the popup.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ TileLayer Used to load and display tile layers on the map. Note that most tile servers require attribution, which you can set under Layer . Extends GridLayer .
+
+
+Usage example
+
+
+
+
+
+
+
+L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png?{foo}', {foo: 'bar', attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'}).addTo(map);
+
+
+
+
+
+
+URL template
+
+
+
+A string of the following form:
+'http://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png'
+{s} means one of the available subdomains (used sequentially to help with browser parallel requests per domain limitation; subdomain values are specified in options; a, b or c by default, can be omitted), {z} — zoom level, {x} and {y} — tile coordinates. {r} can be used to add "@2x" to the URL to load retina tiles.
+You can use custom keys in the template, which will be evaluated from TileLayer options, like this:
+L.tileLayer('http://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png', {foo: 'bar'});
+
+
+
+
+
+
+
+Creation
+
+
+
+Extension methods
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.tilelayer (<String> urlTemplate , <TileLayer options > options? )
+ Instantiates a tile layer object given a URL template and optionally an options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ minZoom
+ Number
+ 0
+ The minimum zoom level down to which this layer will be displayed (inclusive).
+
+
+ maxZoom
+ Number
+ 18
+ The maximum zoom level up to which this layer will be displayed (inclusive).
+
+
+ subdomains
+ String|String[]
+ 'abc'
+ Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.
+
+
+ errorTileUrl
+ String
+ ''
+ URL to the tile image to show in place of the tile that failed to load.
+
+
+ zoomOffset
+ Number
+ 0
+ The zoom number used in tile URLs will be offset with this value.
+
+
+ tms
+ Boolean
+ false
+ If true, inverses Y axis numbering for tiles (turn this on for TMS services).
+
+
+ zoomReverse
+ Boolean
+ false
+ If set to true, the zoom number used in tile URLs will be reversed (maxZoom - zoom instead of zoom)
+
+
+ detectRetina
+ Boolean
+ false
+ If true and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.
+
+
+ crossOrigin
+ Boolean|String
+ false
+ Whether the crossOrigin attribute will be added to the tiles.
+If a String is provided, all tiles will have their crossOrigin attribute set to the String provided. This is needed if you want to access tile pixel data.
+Refer to CORS Settings for valid String values.
+
+
+
+
+
+
+
+
▶ Options inherited from GridLayer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ tileSize
+ Number|Point
+ 256
+ Width and height of tiles in the grid. Use a number if width and height are equal, or L.point(width, height) otherwise.
+
+
+ opacity
+ Number
+ 1.0
+ Opacity of the tiles. Can be used in the createTile() function.
+
+
+ updateWhenIdle
+ Boolean
+ (depends)
+ Load new tiles only when panning ends.
+true by default on mobile browsers, in order to avoid too many requests and keep smooth navigation.
+false otherwise in order to display new tiles during panning, since it is easy to pan outside the
+keepBuffer option in desktop browsers.
+
+
+ updateWhenZooming
+ Boolean
+ true
+ By default, a smooth zoom animation (during a touch zoom or a flyTo() ) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends.
+
+
+ updateInterval
+ Number
+ 200
+ Tiles will not update more than once every updateInterval milliseconds when panning.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the tile layer.
+
+
+ bounds
+ LatLngBounds
+ undefined
+ If set, tiles will only be loaded inside the set LatLngBounds .
+
+
+ maxNativeZoom
+ Number
+ undefined
+ Maximum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels higher than maxNativeZoom will be loaded
+from maxNativeZoom level and auto-scaled.
+
+
+ minNativeZoom
+ Number
+ undefined
+ Minimum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels lower than minNativeZoom will be loaded
+from minNativeZoom level and auto-scaled.
+
+
+ noWrap
+ Boolean
+ false
+ Whether the layer is wrapped around the antimeridian. If true, the
+GridLayer will only be displayed once at low zoom levels. Has no
+effect when the map CRS doesn't wrap around. Can be used
+in combination with bounds to prevent requesting
+tiles outside the CRS limits.
+
+
+ pane
+ String
+ 'tilePane'
+ Map pane where the grid layer will be added.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the tile layer. Empty by default.
+
+
+ keepBuffer
+ Number
+ 2
+ When panning the map, keep this many rows and columns of tiles before unloading them.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from GridLayer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ loading
+ Event
+ Fired when the grid layer starts loading tiles.
+
+
+ tileunload
+ TileEvent
+ Fired when a tile is removed (e.g. when a tile goes off the screen).
+
+
+ tileloadstart
+ TileEvent
+ Fired when a tile is requested and starts loading.
+
+
+ tileerror
+ TileErrorEvent
+ Fired when there is an error loading a tile.
+
+
+ tileload
+ TileEvent
+ Fired when a tile loads.
+
+
+ load
+ Event
+ Fired when the grid layer loaded all visible tiles.
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setUrl (<String> url , <Boolean> noRedraw? )
+ this
+ Updates the layer's URL template and redraws it (unless noRedraw is set to true).
+If the URL does not change, the layer will not be redrawn unless
+the noRedraw parameter is set to false.
+
+
+
+ createTile (<Object> coords , <Function> done? )
+ HTMLElement
+ Called only internally, overrides GridLayer's createTile()
+to return an <img> HTML element with the appropriate image URL given coords. The done
+callback is called when the tile has been loaded.
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getTileUrl (<Object> coords )
+ String
+ Called only internally, returns the URL for a tile given its coordinates.
+Classes extending TileLayer can override this function to provide custom tile URL naming schemes.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from GridLayer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bringToFront ()
+ this
+ Brings the tile layer to the top of all tile layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the tile layer to the bottom of all tile layers.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTML element that contains the tiles for this layer.
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Changes the opacity of the grid layer.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Changes the zIndex of the grid layer.
+
+
+
+ isLoading ()
+ Boolean
+ Returns true if any tile in the grid layer has not finished loading.
+
+
+
+ redraw ()
+ this
+ Causes the layer to clear all the tiles and request them again.
+
+
+
+ getTileSize ()
+ Point
+ Normalizes the tileSize option into a point. Used by the createTile() method.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ TileLayer.WMS Used to display WMS services as tile layers on the map. Extends TileLayer .
+
+
+Usage example
+
+
+
+
+
+
+
+var nexrad = L.tileLayer.wms("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi", {
+ layers: 'nexrad-n0r-900913',
+ format: 'image/png',
+ transparent: true,
+ attribution: "Weather data © 2012 IEM Nexrad"
+});
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.tileLayer.wms (<String> baseUrl , <TileLayer.WMS options > options )
+ Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ layers
+ String
+ ''
+ (required) Comma-separated list of WMS layers to show.
+
+
+ styles
+ String
+ ''
+ Comma-separated list of WMS styles.
+
+
+ format
+ String
+ 'image/jpeg'
+ WMS image format (use 'image/png' for layers with transparency).
+
+
+ transparent
+ Boolean
+ false
+ If true, the WMS service will return images with transparency.
+
+
+ version
+ String
+ '1.1.1'
+ Version of the WMS service to use
+
+
+ crs
+ CRS
+ null
+ Coordinate Reference System to use for the WMS requests, defaults to
+map CRS. Don't change this if you're not sure what it means.
+
+
+ uppercase
+ Boolean
+ false
+ If true, WMS request parameter keys will be uppercase.
+
+
+
+
+
+
+
+
▶ Options inherited from TileLayer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ minZoom
+ Number
+ 0
+ The minimum zoom level down to which this layer will be displayed (inclusive).
+
+
+ maxZoom
+ Number
+ 18
+ The maximum zoom level up to which this layer will be displayed (inclusive).
+
+
+ subdomains
+ String|String[]
+ 'abc'
+ Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.
+
+
+ errorTileUrl
+ String
+ ''
+ URL to the tile image to show in place of the tile that failed to load.
+
+
+ zoomOffset
+ Number
+ 0
+ The zoom number used in tile URLs will be offset with this value.
+
+
+ tms
+ Boolean
+ false
+ If true, inverses Y axis numbering for tiles (turn this on for TMS services).
+
+
+ zoomReverse
+ Boolean
+ false
+ If set to true, the zoom number used in tile URLs will be reversed (maxZoom - zoom instead of zoom)
+
+
+ detectRetina
+ Boolean
+ false
+ If true and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.
+
+
+ crossOrigin
+ Boolean|String
+ false
+ Whether the crossOrigin attribute will be added to the tiles.
+If a String is provided, all tiles will have their crossOrigin attribute set to the String provided. This is needed if you want to access tile pixel data.
+Refer to CORS Settings for valid String values.
+
+
+
+
+
+
+
+
+
▶ Options inherited from GridLayer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ tileSize
+ Number|Point
+ 256
+ Width and height of tiles in the grid. Use a number if width and height are equal, or L.point(width, height) otherwise.
+
+
+ opacity
+ Number
+ 1.0
+ Opacity of the tiles. Can be used in the createTile() function.
+
+
+ updateWhenIdle
+ Boolean
+ (depends)
+ Load new tiles only when panning ends.
+true by default on mobile browsers, in order to avoid too many requests and keep smooth navigation.
+false otherwise in order to display new tiles during panning, since it is easy to pan outside the
+keepBuffer option in desktop browsers.
+
+
+ updateWhenZooming
+ Boolean
+ true
+ By default, a smooth zoom animation (during a touch zoom or a flyTo() ) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends.
+
+
+ updateInterval
+ Number
+ 200
+ Tiles will not update more than once every updateInterval milliseconds when panning.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the tile layer.
+
+
+ bounds
+ LatLngBounds
+ undefined
+ If set, tiles will only be loaded inside the set LatLngBounds .
+
+
+ maxNativeZoom
+ Number
+ undefined
+ Maximum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels higher than maxNativeZoom will be loaded
+from maxNativeZoom level and auto-scaled.
+
+
+ minNativeZoom
+ Number
+ undefined
+ Minimum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels lower than minNativeZoom will be loaded
+from minNativeZoom level and auto-scaled.
+
+
+ noWrap
+ Boolean
+ false
+ Whether the layer is wrapped around the antimeridian. If true, the
+GridLayer will only be displayed once at low zoom levels. Has no
+effect when the map CRS doesn't wrap around. Can be used
+in combination with bounds to prevent requesting
+tiles outside the CRS limits.
+
+
+ pane
+ String
+ 'tilePane'
+ Map pane where the grid layer will be added.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the tile layer. Empty by default.
+
+
+ keepBuffer
+ Number
+ 2
+ When panning the map, keep this many rows and columns of tiles before unloading them.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from GridLayer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ loading
+ Event
+ Fired when the grid layer starts loading tiles.
+
+
+ tileunload
+ TileEvent
+ Fired when a tile is removed (e.g. when a tile goes off the screen).
+
+
+ tileloadstart
+ TileEvent
+ Fired when a tile is requested and starts loading.
+
+
+ tileerror
+ TileErrorEvent
+ Fired when there is an error loading a tile.
+
+
+ tileload
+ TileEvent
+ Fired when a tile loads.
+
+
+ load
+ Event
+ Fired when the grid layer loaded all visible tiles.
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setParams (<Object> params , <Boolean> noRedraw? )
+ this
+ Merges an object with the new parameters and re-requests tiles on the current screen (unless noRedraw was set to true).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from TileLayer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setUrl (<String> url , <Boolean> noRedraw? )
+ this
+ Updates the layer's URL template and redraws it (unless noRedraw is set to true).
+If the URL does not change, the layer will not be redrawn unless
+the noRedraw parameter is set to false.
+
+
+
+ createTile (<Object> coords , <Function> done? )
+ HTMLElement
+ Called only internally, overrides GridLayer's createTile()
+to return an <img> HTML element with the appropriate image URL given coords. The done
+callback is called when the tile has been loaded.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from GridLayer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bringToFront ()
+ this
+ Brings the tile layer to the top of all tile layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the tile layer to the bottom of all tile layers.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTML element that contains the tiles for this layer.
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Changes the opacity of the grid layer.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Changes the zIndex of the grid layer.
+
+
+
+ isLoading ()
+ Boolean
+ Returns true if any tile in the grid layer has not finished loading.
+
+
+
+ redraw ()
+ this
+ Causes the layer to clear all the tiles and request them again.
+
+
+
+ getTileSize ()
+ Point
+ Normalizes the tileSize option into a point. Used by the createTile() method.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ ImageOverlay Used to load and display a single image over specific bounds of the map. Extends Layer .
+
+
+Usage example
+
+
+
+
+
+
+
+var imageUrl = 'http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg',
+ imageBounds = [[40.712216, -74.22655], [40.773941, -74.12544]];
+L.imageOverlay(imageUrl, imageBounds).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.imageOverlay (<String> imageUrl , <LatLngBounds > bounds , <ImageOverlay options > options? )
+ Instantiates an image overlay object given the URL of the image and the
+geographical bounds it is tied to.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ opacity
+ Number
+ 1.0
+ The opacity of the image overlay.
+
+
+ alt
+ String
+ ''
+ Text for the alt attribute of the image (useful for accessibility).
+
+
+ interactive
+ Boolean
+ false
+ If true, the image overlay will emit mouse events when clicked or hovered.
+
+
+ crossOrigin
+ Boolean|String
+ false
+ Whether the crossOrigin attribute will be added to the image.
+If a String is provided, the image will have its crossOrigin attribute set to the String provided. This is needed if you want to access image pixel data.
+Refer to CORS Settings for valid String values.
+
+
+ errorOverlayUrl
+ String
+ ''
+ URL to the overlay image to show in place of the overlay that failed to load.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the overlay layer.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the image. Empty by default.
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this layer will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ load
+ Event
+ Fired when the ImageOverlay layer has loaded its image
+
+
+ error
+ Event
+ Fired when the ImageOverlay layer fails to load its image
+
+
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Sets the opacity of the overlay.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all overlays.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all overlays.
+
+
+
+ setUrl (<String> url )
+ this
+ Changes the URL of the image.
+
+
+
+ setBounds (<LatLngBounds > bounds )
+ this
+ Update the bounds that this ImageOverlay covers
+
+
+
+ setZIndex (<Number> value )
+ this
+ Changes the zIndex of the image overlay.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Get the bounds that this ImageOverlay covers
+
+
+
+ getElement ()
+ HTMLElement
+ Returns the instance of HTMLImageElement
+used by this overlay.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ VideoOverlay Used to load and display a video player over specific bounds of the map. Extends ImageOverlay .
+A video overlay uses the <video>
+HTML5 element.
+
+
+Usage example
+
+
+
+
+
+
+
+var videoUrl = 'https://www.mapbox.com/bites/00188/patricia_nasa.webm',
+ videoBounds = [[ 32, -130], [ 13, -100]];
+L.videoOverlay(videoUrl, videoBounds ).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.videoOverlay (<String|Array|HTMLVideoElement> video , <LatLngBounds > bounds , <VideoOverlay options > options? )
+ Instantiates an image overlay object given the URL of the video (or array of URLs, or even a video element) and the
+geographical bounds it is tied to.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ autoplay
+ Boolean
+ true
+ Whether the video starts playing automatically when loaded.
+
+
+ loop
+ Boolean
+ true
+ Whether the video will loop back to the beginning when played.
+
+
+ keepAspectRatio
+ Boolean
+ true
+ Whether the video will save aspect ratio after the projection.
+Relevant for supported browsers. Browser compatibility- https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit
+
+
+
+
+
+
+
+
▶ Options inherited from ImageOverlay
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ opacity
+ Number
+ 1.0
+ The opacity of the image overlay.
+
+
+ alt
+ String
+ ''
+ Text for the alt attribute of the image (useful for accessibility).
+
+
+ interactive
+ Boolean
+ false
+ If true, the image overlay will emit mouse events when clicked or hovered.
+
+
+ crossOrigin
+ Boolean|String
+ false
+ Whether the crossOrigin attribute will be added to the image.
+If a String is provided, the image will have its crossOrigin attribute set to the String provided. This is needed if you want to access image pixel data.
+Refer to CORS Settings for valid String values.
+
+
+ errorOverlayUrl
+ String
+ ''
+ URL to the overlay image to show in place of the overlay that failed to load.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the overlay layer.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the image. Empty by default.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this layer will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ load
+ Event
+ Fired when the video has finished loading the first frame
+
+
+
+
+
+
+
+
▶ Events inherited from ImageOverlay
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ error
+ Event
+ Fired when the ImageOverlay layer fails to load its image
+
+
+
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getElement ()
+ HTMLVideoElement
+ Returns the instance of HTMLVideoElement
+used by this overlay.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from ImageOverlay
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Sets the opacity of the overlay.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all overlays.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all overlays.
+
+
+
+ setUrl (<String> url )
+ this
+ Changes the URL of the image.
+
+
+
+ setBounds (<LatLngBounds > bounds )
+ this
+ Update the bounds that this ImageOverlay covers
+
+
+
+ setZIndex (<Number> value )
+ this
+ Changes the zIndex of the image overlay.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Get the bounds that this ImageOverlay covers
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ SVGOverlay Used to load, display and provide DOM access to an SVG file over specific bounds of the map. Extends ImageOverlay .
+An SVG overlay uses the <svg> element.
+
+
+Usage example
+
+
+
+
+
+
+
+var svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
+svgElement.setAttribute('xmlns', "http://www.w3.org/2000/svg");
+svgElement.setAttribute('viewBox', "0 0 200 200");
+svgElement.innerHTML = '<rect width="200" height="200"/><rect x="75" y="23" width="50" height="50" style="fill:red"/><rect x="75" y="123" width="50" height="50" style="fill:#0013ff"/>';
+var svgElementBounds = [ [ 32, -130 ], [ 13, -100 ] ];
+L.svgOverlay(svgElement, svgElementBounds).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.svgOverlay (<String|SVGElement> svg , <LatLngBounds > bounds , <SVGOverlay options> options? )
+ Instantiates an image overlay object given an SVG element and the geographical bounds it is tied to.
+A viewBox attribute is required on the SVG element to zoom in and out properly.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from ImageOverlay
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ opacity
+ Number
+ 1.0
+ The opacity of the image overlay.
+
+
+ alt
+ String
+ ''
+ Text for the alt attribute of the image (useful for accessibility).
+
+
+ interactive
+ Boolean
+ false
+ If true, the image overlay will emit mouse events when clicked or hovered.
+
+
+ crossOrigin
+ Boolean|String
+ false
+ Whether the crossOrigin attribute will be added to the image.
+If a String is provided, the image will have its crossOrigin attribute set to the String provided. This is needed if you want to access image pixel data.
+Refer to CORS Settings for valid String values.
+
+
+ errorOverlayUrl
+ String
+ ''
+ URL to the overlay image to show in place of the overlay that failed to load.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the overlay layer.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the image. Empty by default.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this layer will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from ImageOverlay
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ load
+ Event
+ Fired when the ImageOverlay layer has loaded its image
+
+
+ error
+ Event
+ Fired when the ImageOverlay layer fails to load its image
+
+
+
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getElement ()
+ SVGElement
+ Returns the instance of SVGElement
+used by this overlay.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from ImageOverlay
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Sets the opacity of the overlay.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all overlays.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all overlays.
+
+
+
+ setUrl (<String> url )
+ this
+ Changes the URL of the image.
+
+
+
+ setBounds (<LatLngBounds > bounds )
+ this
+ Update the bounds that this ImageOverlay covers
+
+
+
+ setZIndex (<Number> value )
+ this
+ Changes the zIndex of the image overlay.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Get the bounds that this ImageOverlay covers
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Path An abstract class that contains options and constants shared between vector
+overlays (Polygon, Polyline, Circle). Do not use it directly. Extends Layer .
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Polyline A class for drawing polyline overlays on a map. Extends Path .
+
+
+Usage example
+
+
+
+
+
+
+
+// create a red polyline from an array of LatLng points
+var latlngs = [
+ [45.51, -122.68],
+ [37.77, -122.43],
+ [34.04, -118.2]
+];
+var polyline = L.polyline(latlngs, {color: 'red'}).addTo(map);
+// zoom the map to the polyline
+map.fitBounds(polyline.getBounds());
+
+You can also pass a multi-dimensional array to represent a MultiPolyline shape:
+// create a red polyline from an array of arrays of LatLng points
+var latlngs = [
+ [[45.51, -122.68],
+ [37.77, -122.43],
+ [34.04, -118.2]],
+ [[40.78, -73.91],
+ [41.83, -87.62],
+ [32.76, -96.72]]
+];
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.polyline (<LatLng[]> latlngs , <Polyline options > options? )
+ Instantiates a polyline object given an array of geographical points and
+optionally an options object. You can create a Polyline object with
+multiple separate lines (MultiPolyline) by passing an array of arrays
+of geographic points.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ smoothFactor
+ Number
+ 1.0
+ How much to simplify the polyline on each zoom level. More means
+better performance and smoother look, and less means more accurate representation.
+
+
+ noClip
+ Boolean
+ false
+ Disable polyline clipping.
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON (<Number> precision? )
+ Object
+ precision is the number of decimal places for coordinates.
+The default value is 6 places.
+Returns a GeoJSON representation of the polyline (as a GeoJSON LineString or MultiLineString Feature).
+
+
+
+ getLatLngs ()
+ LatLng[]
+ Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.
+
+
+
+ setLatLngs (<LatLng[]> latlngs )
+ this
+ Replaces all the points in the polyline with the given array of geographical points.
+
+
+
+ isEmpty ()
+ Boolean
+ Returns true if the Polyline has no LatLngs.
+
+
+
+ closestLayerPoint (<Point > p )
+ Point
+ Returns the point closest to p on the Polyline.
+
+
+
+ getCenter ()
+ LatLng
+ Returns the center (centroid ) of the polyline.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the path.
+
+
+
+ addLatLng (<LatLng > latlng )
+ this
+ Adds a given point to the polyline. By default, adds to the first ring of
+the polyline in case of a multi-polyline, but can be overridden by passing
+a specific ring as a LatLng array (that you can earlier access with getLatLngs ).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Polygon A class for drawing polygon overlays on a map. Extends Polyline .
+Note that points you pass when creating a polygon shouldn't have an additional last point equal to the first one — it's better to filter out such points.
+
+
+Usage example
+
+
+
+
+
+
+
+// create a red polygon from an array of LatLng points
+var latlngs = [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]];
+var polygon = L.polygon(latlngs, {color: 'red'}).addTo(map);
+// zoom the map to the polygon
+map.fitBounds(polygon.getBounds());
+
+You can also pass an array of arrays of latlngs, with the first array representing the outer shape and the other arrays representing holes in the outer shape:
+var latlngs = [
+ [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring
+ [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole
+];
+
+Additionally, you can pass a multi-dimensional array to represent a MultiPolygon shape.
+var latlngs = [
+ [ // first polygon
+ [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring
+ [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole
+ ],
+ [ // second polygon
+ [[41, -111.03],[45, -111.04],[45, -104.05],[41, -104.05]]
+ ]
+];
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.polygon (<LatLng[]> latlngs , <Polyline options > options? )
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Polyline
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ smoothFactor
+ Number
+ 1.0
+ How much to simplify the polyline on each zoom level. More means
+better performance and smoother look, and less means more accurate representation.
+
+
+ noClip
+ Boolean
+ false
+ Disable polyline clipping.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON (<Number> precision? )
+ Object
+ precision is the number of decimal places for coordinates.
+The default value is 6 places.
+Returns a GeoJSON representation of the polygon (as a GeoJSON Polygon or MultiPolygon Feature).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Polyline
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getLatLngs ()
+ LatLng[]
+ Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.
+
+
+
+ setLatLngs (<LatLng[]> latlngs )
+ this
+ Replaces all the points in the polyline with the given array of geographical points.
+
+
+
+ isEmpty ()
+ Boolean
+ Returns true if the Polyline has no LatLngs.
+
+
+
+ closestLayerPoint (<Point > p )
+ Point
+ Returns the point closest to p on the Polyline.
+
+
+
+ getCenter ()
+ LatLng
+ Returns the center (centroid ) of the polyline.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the path.
+
+
+
+ addLatLng (<LatLng > latlng )
+ this
+ Adds a given point to the polyline. By default, adds to the first ring of
+the polyline in case of a multi-polyline, but can be overridden by passing
+a specific ring as a LatLng array (that you can earlier access with getLatLngs ).
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Rectangle A class for drawing rectangle overlays on a map. Extends Polygon .
+
+
+Usage example
+
+
+
+
+
+
+
+// define rectangle geographical bounds
+var bounds = [[54.559322, -5.767822], [56.1210604, -3.021240]];
+// create an orange rectangle
+L.rectangle(bounds, {color: "#ff7800", weight: 1}).addTo(map);
+// zoom the map to the rectangle bounds
+map.fitBounds(bounds);
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Polyline
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ smoothFactor
+ Number
+ 1.0
+ How much to simplify the polyline on each zoom level. More means
+better performance and smoother look, and less means more accurate representation.
+
+
+ noClip
+ Boolean
+ false
+ Disable polyline clipping.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setBounds (<LatLngBounds > latLngBounds )
+ this
+ Redraws the rectangle with the passed bounds.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Polygon
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON (<Number> precision? )
+ Object
+ precision is the number of decimal places for coordinates.
+The default value is 6 places.
+Returns a GeoJSON representation of the polygon (as a GeoJSON Polygon or MultiPolygon Feature).
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Polyline
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getLatLngs ()
+ LatLng[]
+ Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.
+
+
+
+ setLatLngs (<LatLng[]> latlngs )
+ this
+ Replaces all the points in the polyline with the given array of geographical points.
+
+
+
+ isEmpty ()
+ Boolean
+ Returns true if the Polyline has no LatLngs.
+
+
+
+ closestLayerPoint (<Point > p )
+ Point
+ Returns the point closest to p on the Polyline.
+
+
+
+ getCenter ()
+ LatLng
+ Returns the center (centroid ) of the polyline.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the path.
+
+
+
+ addLatLng (<LatLng > latlng )
+ this
+ Adds a given point to the polyline. By default, adds to the first ring of
+the polyline in case of a multi-polyline, but can be overridden by passing
+a specific ring as a LatLng array (that you can earlier access with getLatLngs ).
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Circle A class for drawing circle overlays on a map. Extends CircleMarker .
+It's an approximation and starts to diverge from a real circle closer to poles (due to projection distortion).
+
+
+Usage example
+
+
+
+
+
+
+
+L.circle([50.5, 30.5], {radius: 200}).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.circle (<LatLng > latlng , <Circle options > options? )
+ Instantiates a circle object given a geographical point, and an options object
+which contains the circle radius.
+
+
+ L.circle (<LatLng > latlng , <Number> radius , <Circle options > options? )
+ Obsolete way of instantiating a circle, for compatibility with 0.7.x code.
+Do not use in new applications or plugins.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ radius
+ Number
+
+ Radius of the circle, in meters.
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from CircleMarker
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ move
+ Event
+ Fired when the marker is moved via setLatLng . Old and new coordinates are included in event arguments as oldLatLng, latlng .
+
+
+
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setRadius (<Number> radius )
+ this
+ Sets the radius of a circle. Units are in meters.
+
+
+
+ getRadius ()
+ Number
+ Returns the current radius of a circle. Units are in meters.
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the path.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from CircleMarker
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON (<Number> precision? )
+ Object
+ precision is the number of decimal places for coordinates.
+The default value is 6 places.
+Returns a GeoJSON representation of the circle marker (as a GeoJSON Point Feature).
+
+
+
+ setLatLng (<LatLng > latLng )
+ this
+ Sets the position of a circle marker to a new location.
+
+
+
+ getLatLng ()
+ LatLng
+ Returns the current geographical position of the circle marker
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ CircleMarker A circle of a fixed size with radius specified in pixels. Extends Path .
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.circleMarker (<LatLng > latlng , <CircleMarker options > options? )
+ Instantiates a circle marker object given a geographical point, and an optional options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ radius
+ Number
+ 10
+ Radius of the circle marker, in pixels
+
+
+
+
+
+
+
+
▶ Options inherited from Path
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ stroke
+ Boolean
+ true
+ Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
+
+
+ color
+ String
+ '#3388ff'
+ Stroke color
+
+
+ weight
+ Number
+ 3
+ Stroke width in pixels
+
+
+ opacity
+ Number
+ 1.0
+ Stroke opacity
+
+
+ lineCap
+ String
+ 'round'
+ A string that defines shape to be used at the end of the stroke.
+
+
+ lineJoin
+ String
+ 'round'
+ A string that defines shape to be used at the corners of the stroke.
+
+
+ dashArray
+ String
+ null
+ A string that defines the stroke dash pattern . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ dashOffset
+ String
+ null
+ A string that defines the distance into the dash pattern to start the dash . Doesn't work on Canvas -powered layers in some old browsers .
+
+
+ fill
+ Boolean
+ depends
+ Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
+
+
+ fillColor
+ String
+ *
+ Fill color. Defaults to the value of the color option
+
+
+ fillOpacity
+ Number
+ 0.2
+ Fill opacity.
+
+
+ fillRule
+ String
+ 'evenodd'
+ A string that defines how the inside of a shape is determined.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this path will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+ renderer
+ Renderer
+
+ Use this specific instance of Renderer for this path. Takes
+precedence over the map's default renderer .
+
+
+ className
+ String
+ null
+ Custom class name set on an element. Only for SVG renderer.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ move
+ Event
+ Fired when the marker is moved via setLatLng . Old and new coordinates are included in event arguments as oldLatLng, latlng .
+
+
+
+
+
+
+
+
▶ Mouse events inherited from Interactive layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON (<Number> precision? )
+ Object
+ precision is the number of decimal places for coordinates.
+The default value is 6 places.
+Returns a GeoJSON representation of the circle marker (as a GeoJSON Point Feature).
+
+
+
+ setLatLng (<LatLng > latLng )
+ this
+ Sets the position of a circle marker to a new location.
+
+
+
+ getLatLng ()
+ LatLng
+ Returns the current geographical position of the circle marker
+
+
+
+ setRadius (<Number> radius )
+ this
+ Sets the radius of a circle marker. Units are in pixels.
+
+
+
+ getRadius ()
+ Number
+ Returns the current radius of the circle
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Path
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ redraw ()
+ this
+ Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
+
+
+
+ setStyle (<Path options > style )
+ this
+ Changes the appearance of a Path based on the options in the Path options object.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer to the top of all path layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the layer to the bottom of all path layers.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ SVG VML was deprecated in 2012, which means VML functionality exists only for backwards compatibility
+with old versions of Internet Explorer.
+
Allows vector layers to be displayed with SVG .
+Inherits Renderer .
+Due to technical limitations , SVG is not
+available in all web browsers, notably Android 2.x and 3.x.
+Although SVG is not available on IE7 and IE8, these browsers support
+VML
+(a now deprecated technology), and the SVG renderer will fall back to VML in
+this case.
+
+
+Usage example
+
+
+
+
+
+
+
+Use SVG by default for all paths in the map:
+var map = L.map('map', {
+ renderer: L.svg()
+});
+
+Use a SVG renderer with extra padding for specific vector geometries:
+var map = L.map('map');
+var myRenderer = L.svg({ padding: 0.5 });
+var line = L.polyline( coordinates, { renderer: myRenderer } );
+var circle = L.circle( center, { renderer: myRenderer } );
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.svg (<Renderer options > options? )
+ Creates a SVG renderer with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Renderer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ padding
+ Number
+ 0.1
+ How much to extend the clip area around the map view (relative to its size)
+e.g. 0.1 would be 10% of map view in each direction
+
+
+ tolerance
+ Number
+ 0
+ How much to extend click tolerance round a path/object on the map
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Renderer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ update
+ Event
+ Fired when the renderer updates its bounds, center and zoom, for example when
+its map has moved
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+
+Functions
+
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ create (<String> name )
+ SVGElement
+ Returns a instance of SVGElement ,
+corresponding to the class name passed. For example, using 'line' will return
+an instance of SVGLineElement .
+
+
+ pointsToPath (<Point[]> rings , <Boolean> closed )
+ String
+ Generates a SVG path string for multiple rings, with each ring turning
+into "M..L..L.." instructions
+
+
+
+
+
+
+ Canvas Allows vector layers to be displayed with <canvas> .
+Inherits Renderer .
+Due to technical limitations , Canvas is not
+available in all web browsers, notably IE8, and overlapping geometries might
+not display properly in some edge cases.
+
+
+Usage example
+
+
+
+
+
+
+
+Use Canvas by default for all paths in the map:
+var map = L.map('map', {
+ renderer: L.canvas()
+});
+
+Use a Canvas renderer with extra padding for specific vector geometries:
+var map = L.map('map');
+var myRenderer = L.canvas({ padding: 0.5 });
+var line = L.polyline( coordinates, { renderer: myRenderer } );
+var circle = L.circle( center, { renderer: myRenderer } );
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.canvas (<Renderer options > options? )
+ Creates a Canvas renderer with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Renderer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ padding
+ Number
+ 0.1
+ How much to extend the clip area around the map view (relative to its size)
+e.g. 0.1 would be 10% of map view in each direction
+
+
+ tolerance
+ Number
+ 0
+ How much to extend click tolerance round a path/object on the map
+
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Renderer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ update
+ Event
+ Fired when the renderer updates its bounds, center and zoom, for example when
+its map has moved
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ LayerGroup Used to group several layers and handle them as one. If you add it to the map,
+any layers added or removed from the group will be added/removed on the map as
+well. Extends Layer .
+
+
+Usage example
+
+
+
+
+
+
+
+L.layerGroup([marker1, marker2])
+ .addLayer(polyline)
+ .addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.layerGroup (<Layer[]> layers? , <Object> options? )
+ Create a layer group, optionally given an initial set of layers and an options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON (<Number> precision? )
+ Object
+ precision is the number of decimal places for coordinates.
+The default value is 6 places.
+Returns a GeoJSON representation of the layer group (as a GeoJSON FeatureCollection, GeometryCollection, or MultiPoint).
+
+
+
+ addLayer (<Layer > layer )
+ this
+ Adds the given layer to the group.
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Removes the given layer from the group.
+
+
+
+ removeLayer (<Number> id )
+ this
+ Removes the layer with the given internal ID from the group.
+
+
+
+ hasLayer (<Layer > layer )
+ Boolean
+ Returns true if the given layer is currently added to the group.
+
+
+
+ hasLayer (<Number> id )
+ Boolean
+ Returns true if the given internal ID is currently added to the group.
+
+
+
+ clearLayers ()
+ this
+ Removes all the layers from the group.
+
+
+
+ invoke (<String> methodName , … )
+ this
+ Calls methodName on every layer contained in this group, passing any
+additional parameters. Has no effect if the layers contained do not
+implement methodName.
+
+
+
+ eachLayer (<Function> fn , <Object> context? )
+ this
+ Iterates over the layers of the group, optionally specifying context of the iterator function.
+group.eachLayer(function (layer) {
+ layer.bindPopup('Hello');
+});
+
+
+
+
+ getLayer (<Number> id )
+ Layer
+ Returns the layer with the given internal ID.
+
+
+
+ getLayers ()
+ Layer[]
+ Returns an array of all the layers added to the group.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Calls setZIndex on every layer contained in this group, passing the z-index.
+
+
+
+ getLayerId (<Layer > layer )
+ Number
+ Returns the internal ID for a layer
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ FeatureGroup Extended LayerGroup that makes it easier to do the same thing to all its member layers:
+
+bindPopup binds a popup to all of the layers at once (likewise with bindTooltip )
+Events are propagated to the FeatureGroup , so if the group has an event
+handler, it will handle events from any of the layers. This includes mouse events
+and custom events.
+Has layeradd and layerremove events
+
+
+
+Usage example
+
+
+
+
+
+
+
+L.featureGroup([marker1, marker2, polyline])
+ .bindPopup('Hello world!')
+ .on('click', function() { alert('Clicked on a member of the group!'); })
+ .addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.featureGroup (<Layer[]> layers )
+ Create a feature group, optionally given an initial set of layers.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setStyle (<Path options > style )
+ this
+ Sets the given path options to each layer of the group that has a setStyle method.
+
+
+
+ bringToFront ()
+ this
+ Brings the layer group to the top of all other layers
+
+
+
+ bringToBack ()
+ this
+ Brings the layer group to the back of all other layers
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from LayerGroup
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON (<Number> precision? )
+ Object
+ precision is the number of decimal places for coordinates.
+The default value is 6 places.
+Returns a GeoJSON representation of the layer group (as a GeoJSON FeatureCollection, GeometryCollection, or MultiPoint).
+
+
+
+ addLayer (<Layer > layer )
+ this
+ Adds the given layer to the group.
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Removes the given layer from the group.
+
+
+
+ removeLayer (<Number> id )
+ this
+ Removes the layer with the given internal ID from the group.
+
+
+
+ hasLayer (<Layer > layer )
+ Boolean
+ Returns true if the given layer is currently added to the group.
+
+
+
+ hasLayer (<Number> id )
+ Boolean
+ Returns true if the given internal ID is currently added to the group.
+
+
+
+ clearLayers ()
+ this
+ Removes all the layers from the group.
+
+
+
+ invoke (<String> methodName , … )
+ this
+ Calls methodName on every layer contained in this group, passing any
+additional parameters. Has no effect if the layers contained do not
+implement methodName.
+
+
+
+ eachLayer (<Function> fn , <Object> context? )
+ this
+ Iterates over the layers of the group, optionally specifying context of the iterator function.
+group.eachLayer(function (layer) {
+ layer.bindPopup('Hello');
+});
+
+
+
+
+ getLayer (<Number> id )
+ Layer
+ Returns the layer with the given internal ID.
+
+
+
+ getLayers ()
+ Layer[]
+ Returns an array of all the layers added to the group.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Calls setZIndex on every layer contained in this group, passing the z-index.
+
+
+
+ getLayerId (<Layer > layer )
+ Number
+ Returns the internal ID for a layer
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ GeoJSON Represents a GeoJSON object or an array of GeoJSON objects. Allows you to parse
+GeoJSON data and display it on the map. Extends FeatureGroup .
+
+
+Usage example
+
+
+
+
+
+
+
+L.geoJSON(data, {
+ style: function (feature) {
+ return {color: feature.properties.color};
+ }
+}).bindPopup(function (layer) {
+ return layer.feature.properties.description;
+}).addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.geoJSON (<Object> geojson? , <GeoJSON options > options? )
+ Creates a GeoJSON layer. Optionally accepts an object in
+GeoJSON format to display on the map
+(you can alternatively add it later with addData method) and an options object.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pointToLayer
+ Function
+ *
+ A Function defining how GeoJSON points spawn Leaflet layers. It is internally
+called when data is added, passing the GeoJSON point feature and its LatLng .
+The default is to spawn a default Marker :
+function(geoJsonPoint, latlng) {
+ return L.marker(latlng);
+}
+
+
+
+ style
+ Function
+ *
+ A Function defining the Path options for styling GeoJSON lines and polygons,
+called internally when data is added.
+The default value is to not override any defaults:
+function (geoJsonFeature) {
+ return {}
+}
+
+
+
+ onEachFeature
+ Function
+ *
+ A Function that will be called once for each created Feature, after it has
+been created and styled. Useful for attaching events and popups to features.
+The default is to do nothing with the newly created layers:
+function (feature, layer) {}
+
+
+
+ filter
+ Function
+ *
+ A Function that will be used to decide whether to include a feature or not.
+The default is to include all features:
+function (geoJsonFeature) {
+ return true;
+}
+
+Note: dynamically changing the filter option will have effect only on newly
+added data. It will not re-evaluate already included features.
+
+
+ coordsToLatLng
+ Function
+ *
+ A Function that will be used for converting GeoJSON coordinates to LatLng s.
+The default is the coordsToLatLng static method.
+
+
+ markersInheritOptions
+ Boolean
+ false
+ Whether default Markers for "Point" type Features inherit from group options.
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addData (data )
+ this
+ Adds a GeoJSON object to the layer.
+
+
+
+ resetStyle (layer? )
+ this
+ Resets the given vector layer's style to the original GeoJSON style, useful for resetting style after hover events.
+If layer is omitted, the style of all features in the current layer is reset.
+
+
+
+ setStyle (style )
+ this
+ Changes styles of GeoJSON vector layers with the given style function.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from FeatureGroup
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bringToFront ()
+ this
+ Brings the layer group to the top of all other layers
+
+
+
+ bringToBack ()
+ this
+ Brings the layer group to the back of all other layers
+
+
+
+ getBounds ()
+ LatLngBounds
+ Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from LayerGroup
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ toGeoJSON (<Number> precision? )
+ Object
+ precision is the number of decimal places for coordinates.
+The default value is 6 places.
+Returns a GeoJSON representation of the layer group (as a GeoJSON FeatureCollection, GeometryCollection, or MultiPoint).
+
+
+
+ addLayer (<Layer > layer )
+ this
+ Adds the given layer to the group.
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Removes the given layer from the group.
+
+
+
+ removeLayer (<Number> id )
+ this
+ Removes the layer with the given internal ID from the group.
+
+
+
+ hasLayer (<Layer > layer )
+ Boolean
+ Returns true if the given layer is currently added to the group.
+
+
+
+ hasLayer (<Number> id )
+ Boolean
+ Returns true if the given internal ID is currently added to the group.
+
+
+
+ clearLayers ()
+ this
+ Removes all the layers from the group.
+
+
+
+ invoke (<String> methodName , … )
+ this
+ Calls methodName on every layer contained in this group, passing any
+additional parameters. Has no effect if the layers contained do not
+implement methodName.
+
+
+
+ eachLayer (<Function> fn , <Object> context? )
+ this
+ Iterates over the layers of the group, optionally specifying context of the iterator function.
+group.eachLayer(function (layer) {
+ layer.bindPopup('Hello');
+});
+
+
+
+
+ getLayer (<Number> id )
+ Layer
+ Returns the layer with the given internal ID.
+
+
+
+ getLayers ()
+ Layer[]
+ Returns an array of all the layers added to the group.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Calls setZIndex on every layer contained in this group, passing the z-index.
+
+
+
+ getLayerId (<Layer > layer )
+ Number
+ Returns the internal ID for a layer
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+
+Functions
+
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ geometryToLayer (<Object> featureData , <GeoJSON options > options? )
+ Layer
+ Creates a Layer from a given GeoJSON feature. Can use a custom
+pointToLayer and/or coordsToLatLng
+functions if provided as options.
+
+
+ coordsToLatLng (<Array> coords )
+ LatLng
+ Creates a LatLng object from an array of 2 numbers (longitude, latitude)
+or 3 numbers (longitude, latitude, altitude) used in GeoJSON for points.
+
+
+ coordsToLatLngs (<Array> coords , <Number> levelsDeep? , <Function> coordsToLatLng? )
+ Array
+ Creates a multidimensional array of LatLng s from a GeoJSON coordinates array.
+levelsDeep specifies the nesting level (0 is for an array of points, 1 for an array of arrays of points, etc., 0 by default).
+Can use a custom coordsToLatLng function.
+
+
+ latLngToCoords (<LatLng > latlng , <Number> precision? )
+ Array
+ Reverse of coordsToLatLng
+
+
+ latLngsToCoords (<Array> latlngs , <Number> levelsDeep? , <Boolean> closed? )
+ Array
+ Reverse of coordsToLatLngs
+closed determines whether the first point should be appended to the end of the array to close the feature, only used when levelsDeep is 0. False by default.
+
+
+ asFeature (<Object> geojson )
+ Object
+ Normalize GeoJSON geometries/features into GeoJSON features.
+
+
+
+
+
+
+ GridLayer Generic class for handling a tiled grid of HTML elements. This is the base class for all tile layers and replaces TileLayer.Canvas.
+GridLayer can be extended to create a tiled grid of HTML elements like <canvas>, <img> or <div>. GridLayer will handle creating and animating these DOM elements for you.
+
+
+Usage example
+
+
+
+Synchronous usage
+
+
+
+To create a custom layer, extend GridLayer and implement the createTile() method, which will be passed a Point object with the x, y, and z (zoom level) coordinates to draw your tile.
+var CanvasLayer = L.GridLayer.extend({
+ createTile: function(coords){
+ // create a <canvas> element for drawing
+ var tile = L.DomUtil.create('canvas', 'leaflet-tile');
+ // setup tile width and height according to the options
+ var size = this.getTileSize();
+ tile.width = size.x;
+ tile.height = size.y;
+ // get a canvas context and draw something on it using coords.x, coords.y and coords.z
+ var ctx = tile.getContext('2d');
+ // return the tile so it can be rendered on screen
+ return tile;
+ }
+});
+
+
+
+
+
+
+Asynchronous usage
+
+
+
+Tile creation can also be asynchronous, this is useful when using a third-party drawing library. Once the tile is finished drawing it can be passed to the done() callback.
+var CanvasLayer = L.GridLayer.extend({
+ createTile: function(coords, done){
+ var error;
+ // create a <canvas> element for drawing
+ var tile = L.DomUtil.create('canvas', 'leaflet-tile');
+ // setup tile width and height according to the options
+ var size = this.getTileSize();
+ tile.width = size.x;
+ tile.height = size.y;
+ // draw something asynchronously and pass the tile to the done() callback
+ setTimeout(function() {
+ done(error, tile);
+ }, 1000);
+ return tile;
+ }
+});
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.gridLayer (<GridLayer options > options? )
+ Creates a new instance of GridLayer with the supplied options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ tileSize
+ Number|Point
+ 256
+ Width and height of tiles in the grid. Use a number if width and height are equal, or L.point(width, height) otherwise.
+
+
+ opacity
+ Number
+ 1.0
+ Opacity of the tiles. Can be used in the createTile() function.
+
+
+ updateWhenIdle
+ Boolean
+ (depends)
+ Load new tiles only when panning ends.
+true by default on mobile browsers, in order to avoid too many requests and keep smooth navigation.
+false otherwise in order to display new tiles during panning, since it is easy to pan outside the
+keepBuffer option in desktop browsers.
+
+
+ updateWhenZooming
+ Boolean
+ true
+ By default, a smooth zoom animation (during a touch zoom or a flyTo() ) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends.
+
+
+ updateInterval
+ Number
+ 200
+ Tiles will not update more than once every updateInterval milliseconds when panning.
+
+
+ zIndex
+ Number
+ 1
+ The explicit zIndex of the tile layer.
+
+
+ bounds
+ LatLngBounds
+ undefined
+ If set, tiles will only be loaded inside the set LatLngBounds .
+
+
+ minZoom
+ Number
+ 0
+ The minimum zoom level down to which this layer will be displayed (inclusive).
+
+
+ maxZoom
+ Number
+ undefined
+ The maximum zoom level up to which this layer will be displayed (inclusive).
+
+
+ maxNativeZoom
+ Number
+ undefined
+ Maximum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels higher than maxNativeZoom will be loaded
+from maxNativeZoom level and auto-scaled.
+
+
+ minNativeZoom
+ Number
+ undefined
+ Minimum zoom number the tile source has available. If it is specified,
+the tiles on all zoom levels lower than minNativeZoom will be loaded
+from minNativeZoom level and auto-scaled.
+
+
+ noWrap
+ Boolean
+ false
+ Whether the layer is wrapped around the antimeridian. If true, the
+GridLayer will only be displayed once at low zoom levels. Has no
+effect when the map CRS doesn't wrap around. Can be used
+in combination with bounds to prevent requesting
+tiles outside the CRS limits.
+
+
+ pane
+ String
+ 'tilePane'
+ Map pane where the grid layer will be added.
+
+
+ className
+ String
+ ''
+ A custom class name to assign to the tile layer. Empty by default.
+
+
+ keepBuffer
+ Number
+ 2
+ When panning the map, keep this many rows and columns of tiles before unloading them.
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ loading
+ Event
+ Fired when the grid layer starts loading tiles.
+
+
+ tileunload
+ TileEvent
+ Fired when a tile is removed (e.g. when a tile goes off the screen).
+
+
+ tileloadstart
+ TileEvent
+ Fired when a tile is requested and starts loading.
+
+
+ tileerror
+ TileErrorEvent
+ Fired when there is an error loading a tile.
+
+
+ tileload
+ TileEvent
+ Fired when a tile loads.
+
+
+ load
+ Event
+ Fired when the grid layer loaded all visible tiles.
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bringToFront ()
+ this
+ Brings the tile layer to the top of all tile layers.
+
+
+
+ bringToBack ()
+ this
+ Brings the tile layer to the bottom of all tile layers.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTML element that contains the tiles for this layer.
+
+
+
+ setOpacity (<Number> opacity )
+ this
+ Changes the opacity of the grid layer.
+
+
+
+ setZIndex (<Number> zIndex )
+ this
+ Changes the zIndex of the grid layer.
+
+
+
+ isLoading ()
+ Boolean
+ Returns true if any tile in the grid layer has not finished loading.
+
+
+
+ redraw ()
+ this
+ Causes the layer to clear all the tiles and request them again.
+
+
+
+ getTileSize ()
+ Point
+ Normalizes the tileSize option into a point. Used by the createTile() method.
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ createTile (<Object> coords , <Function> done? )
+ HTMLElement
+ Called only internally, must be overridden by classes extending GridLayer .
+Returns the HTMLElement corresponding to the given coords. If the done callback
+is specified, it must be called when the tile has finished loading and drawing.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ LatLng Represents a geographical point with a certain latitude and longitude.
+
+
+Usage example
+
+
+
+
+
+
+
+var latlng = L.latLng(50.5, 30.5);
+All Leaflet methods that accept LatLng objects also accept them in a simple Array form and simple object form (unless noted otherwise), so these lines are equivalent:
+map.panTo([50, 30]);
+map.panTo({lon: 30, lat: 50});
+map.panTo({lat: 50, lng: 30});
+map.panTo(L.latLng(50, 30));
+Note that LatLng does not inherit from Leaflet's Class object,
+which means new classes can't inherit from it, and new methods
+can't be added to it with the include function.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.latLng (<Number> latitude , <Number> longitude , <Number> altitude? )
+ Creates an object representing a geographical point with the given latitude and longitude (and optionally altitude).
+
+
+ L.latLng (<Array> coords )
+ Expects an array of the form [Number, Number] or [Number, Number, Number] instead.
+
+
+ L.latLng (<Object> coords )
+ Expects an plain object of the form {lat: Number, lng: Number} or {lat: Number, lng: Number, alt: Number} instead.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ equals (<LatLng > otherLatLng , <Number> maxMargin? )
+ Boolean
+ Returns true if the given LatLng point is at the same position (within a small margin of error). The margin of error can be overridden by setting maxMargin to a small number.
+
+
+
+ toString ()
+ String
+ Returns a string representation of the point (for debugging purposes).
+
+
+
+ distanceTo (<LatLng > otherLatLng )
+ Number
+ Returns the distance (in meters) to the given LatLng calculated using the Spherical Law of Cosines .
+
+
+
+ wrap ()
+ LatLng
+ Returns a new LatLng object with the longitude wrapped so it's always between -180 and +180 degrees.
+
+
+
+ toBounds (<Number> sizeInMeters )
+ LatLngBounds
+ Returns a new LatLngBounds object in which each boundary is sizeInMeters/2 meters apart from the LatLng .
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ lat
+ Number
+ Latitude in degrees
+
+
+ lng
+ Number
+ Longitude in degrees
+
+
+ alt
+ Number
+ Altitude in meters (optional)
+
+
+
+
+
+
+ LatLngBounds Represents a rectangular geographical area on a map.
+
+
+Usage example
+
+
+
+
+
+
+
+var corner1 = L.latLng(40.712, -74.227),
+corner2 = L.latLng(40.774, -74.125),
+bounds = L.latLngBounds(corner1, corner2);
+
+All Leaflet methods that accept LatLngBounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:
+map.fitBounds([
+ [40.712, -74.227],
+ [40.774, -74.125]
+]);
+
+Caution: if the area crosses the antimeridian (often confused with the International Date Line), you must specify corners outside the [-180, 180] degrees longitude range.
+Note that LatLngBounds does not inherit from Leafet's Class object,
+which means new classes can't inherit from it, and new methods
+can't be added to it with the include function.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.latLngBounds (<LatLng > corner1 , <LatLng > corner2 )
+ Creates a LatLngBounds object by defining two diagonally opposite corners of the rectangle.
+
+
+ L.latLngBounds (<LatLng[]> latlngs )
+ Creates a LatLngBounds object defined by the geographical points it contains. Very useful for zooming the map to fit a particular set of locations with fitBounds .
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ extend (<LatLng > latlng )
+ this
+ Extend the bounds to contain the given point
+
+
+
+ extend (<LatLngBounds > otherBounds )
+ this
+ Extend the bounds to contain the given bounds
+
+
+
+ pad (<Number> bufferRatio )
+ LatLngBounds
+ Returns bounds created by extending or retracting the current bounds by a given ratio in each direction.
+For example, a ratio of 0.5 extends the bounds by 50% in each direction.
+Negative values will retract the bounds.
+
+
+
+ getCenter ()
+ LatLng
+ Returns the center point of the bounds.
+
+
+
+ getSouthWest ()
+ LatLng
+ Returns the south-west point of the bounds.
+
+
+
+ getNorthEast ()
+ LatLng
+ Returns the north-east point of the bounds.
+
+
+
+ getNorthWest ()
+ LatLng
+ Returns the north-west point of the bounds.
+
+
+
+ getSouthEast ()
+ LatLng
+ Returns the south-east point of the bounds.
+
+
+
+ getWest ()
+ Number
+ Returns the west longitude of the bounds
+
+
+
+ getSouth ()
+ Number
+ Returns the south latitude of the bounds
+
+
+
+ getEast ()
+ Number
+ Returns the east longitude of the bounds
+
+
+
+ getNorth ()
+ Number
+ Returns the north latitude of the bounds
+
+
+
+ contains (<LatLngBounds > otherBounds )
+ Boolean
+ Returns true if the rectangle contains the given one.
+
+
+
+ contains (<LatLng > latlng )
+ Boolean
+ Returns true if the rectangle contains the given point.
+
+
+
+ intersects (<LatLngBounds > otherBounds )
+ Boolean
+ Returns true if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common.
+
+
+
+ overlaps (<Bounds > otherBounds )
+ Boolean
+ Returns true if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area.
+
+
+
+ toBBoxString ()
+ String
+ Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format. Useful for sending requests to web services that return geo data.
+
+
+
+ equals (<LatLngBounds > otherBounds , <Number> maxMargin? )
+ Boolean
+ Returns true if the rectangle is equivalent (within a small margin of error) to the given bounds. The margin of error can be overridden by setting maxMargin to a small number.
+
+
+
+ isValid ()
+ Boolean
+ Returns true if the bounds are properly initialized.
+
+
+
+
+
+
+
+ Point Represents a point with x and y coordinates in pixels.
+
+
+Usage example
+
+
+
+
+
+
+
+var point = L.point(200, 300);
+
+All Leaflet methods and options that accept Point objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent:
+map.panBy([200, 300]);
+map.panBy(L.point(200, 300));
+
+Note that Point does not inherit from Leafet's Class object,
+which means new classes can't inherit from it, and new methods
+can't be added to it with the include function.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.point (<Number> x , <Number> y , <Boolean> round? )
+ Creates a Point object with the given x and y coordinates. If optional round is set to true, rounds the x and y values.
+
+
+ L.point (<Number[]> coords )
+ Expects an array of the form [x, y] instead.
+
+
+ L.point (<Object> coords )
+ Expects a plain object of the form {x: Number, y: Number} instead.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ clone ()
+ Point
+ Returns a copy of the current point.
+
+
+
+ add (<Point > otherPoint )
+ Point
+ Returns the result of addition of the current and the given points.
+
+
+
+ subtract (<Point > otherPoint )
+ Point
+ Returns the result of subtraction of the given point from the current.
+
+
+
+ divideBy (<Number> num )
+ Point
+ Returns the result of division of the current point by the given number.
+
+
+
+ multiplyBy (<Number> num )
+ Point
+ Returns the result of multiplication of the current point by the given number.
+
+
+
+ scaleBy (<Point > scale )
+ Point
+ Multiply each coordinate of the current point by each coordinate of
+scale. In linear algebra terms, multiply the point by the
+scaling matrix
+defined by scale.
+
+
+
+ unscaleBy (<Point > scale )
+ Point
+ Inverse of scaleBy. Divide each coordinate of the current point by
+each coordinate of scale.
+
+
+
+ round ()
+ Point
+ Returns a copy of the current point with rounded coordinates.
+
+
+
+ floor ()
+ Point
+ Returns a copy of the current point with floored coordinates (rounded down).
+
+
+
+ ceil ()
+ Point
+ Returns a copy of the current point with ceiled coordinates (rounded up).
+
+
+
+ trunc ()
+ Point
+ Returns a copy of the current point with truncated coordinates (rounded towards zero).
+
+
+
+ distanceTo (<Point > otherPoint )
+ Number
+ Returns the cartesian distance between the current and the given points.
+
+
+
+ equals (<Point > otherPoint )
+ Boolean
+ Returns true if the given point has the same coordinates.
+
+
+
+ contains (<Point > otherPoint )
+ Boolean
+ Returns true if both coordinates of the given point are less than the corresponding current point coordinates (in absolute values).
+
+
+
+ toString ()
+ String
+ Returns a string representation of the point for debugging purposes.
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ x
+ Number
+ The x coordinate of the point
+
+
+ y
+ Number
+ The y coordinate of the point
+
+
+
+
+
+
+ Bounds Represents a rectangular area in pixel coordinates.
+
+
+Usage example
+
+
+
+
+
+
+
+var p1 = L.point(10, 10),
+p2 = L.point(40, 60),
+bounds = L.bounds(p1, p2);
+
+All Leaflet methods that accept Bounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:
+otherBounds.intersects([[10, 10], [40, 60]]);
+
+Note that Bounds does not inherit from Leafet's Class object,
+which means new classes can't inherit from it, and new methods
+can't be added to it with the include function.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.bounds (<Point > corner1 , <Point > corner2 )
+ Creates a Bounds object from two corners coordinate pairs.
+
+
+ L.bounds (<Point[]> points )
+ Creates a Bounds object from the given array of points.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ extend (<Point > point )
+ this
+ Extends the bounds to contain the given point.
+
+
+
+ getCenter (<Boolean> round? )
+ Point
+ Returns the center point of the bounds.
+
+
+
+ getBottomLeft ()
+ Point
+ Returns the bottom-left point of the bounds.
+
+
+
+ getTopRight ()
+ Point
+ Returns the top-right point of the bounds.
+
+
+
+ getTopLeft ()
+ Point
+ Returns the top-left point of the bounds (i.e. this.min ).
+
+
+
+ getBottomRight ()
+ Point
+ Returns the bottom-right point of the bounds (i.e. this.max ).
+
+
+
+ getSize ()
+ Point
+ Returns the size of the given bounds
+
+
+
+ contains (<Bounds > otherBounds )
+ Boolean
+ Returns true if the rectangle contains the given one.
+
+
+
+ contains (<Point > point )
+ Boolean
+ Returns true if the rectangle contains the given point.
+
+
+
+ intersects (<Bounds > otherBounds )
+ Boolean
+ Returns true if the rectangle intersects the given bounds. Two bounds
+intersect if they have at least one point in common.
+
+
+
+ overlaps (<Bounds > otherBounds )
+ Boolean
+ Returns true if the rectangle overlaps the given bounds. Two bounds
+overlap if their intersection is an area.
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ min
+ Point
+ The top left corner of the rectangle.
+
+
+ max
+ Point
+ The bottom right corner of the rectangle.
+
+
+
+
+
+
+ Icon Represents an icon to provide when creating a marker.
+
+
+Usage example
+
+
+
+
+
+
+
+var myIcon = L.icon({
+ iconUrl: 'my-icon.png',
+ iconSize: [38, 95],
+ iconAnchor: [22, 94],
+ popupAnchor: [-3, -76],
+ shadowUrl: 'my-icon-shadow.png',
+ shadowSize: [68, 95],
+ shadowAnchor: [22, 94]
+});
+L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
+
+L.Icon.Default extends L.Icon and is the blue icon Leaflet uses for markers by default.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.icon (<Icon options > options )
+ Creates an icon instance with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ iconUrl
+ String
+ null
+ (required) The URL to the icon image (absolute or relative to your script path).
+
+
+ iconRetinaUrl
+ String
+ null
+ The URL to a retina sized version of the icon image (absolute or relative to your
+script path). Used for Retina screen devices.
+
+
+ iconSize
+ Point
+ null
+ Size of the icon image in pixels.
+
+
+ iconAnchor
+ Point
+ null
+ The coordinates of the "tip" of the icon (relative to its top left corner). The icon
+will be aligned so that this point is at the marker's geographical location. Centered
+by default if size is specified, also can be set in CSS with negative margins.
+
+
+
+ tooltipAnchor
+ Point
+ [0, 0]
+ The coordinates of the point from which tooltips will "open", relative to the icon anchor.
+
+
+ shadowUrl
+ String
+ null
+ The URL to the icon shadow image. If not specified, no shadow image will be created.
+
+
+ shadowRetinaUrl
+ String
+ null
+
+
+
+ shadowSize
+ Point
+ null
+ Size of the shadow image in pixels.
+
+
+ shadowAnchor
+ Point
+ null
+ The coordinates of the "tip" of the shadow (relative to its top left corner) (the same
+as iconAnchor if not specified).
+
+
+ className
+ String
+ ''
+ A custom class name to assign to both icon and shadow images. Empty by default.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ createIcon (<HTMLElement> oldIcon? )
+ HTMLElement
+ Called internally when the icon has to be shown, returns a <img> HTML element
+styled according to the options.
+
+
+
+ createShadow (<HTMLElement> oldIcon? )
+ HTMLElement
+ As createIcon, but for the shadow beneath it.
+
+
+
+
+
+
+
+
+
+
+Icon.Default
+
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ imagePath
+ String
+
+ Icon.Default will try to auto-detect the location of the
+blue icon images. If you are placing these images in a non-standard
+way, set this option to point to the right path.
+
+
+
+
+
+
+ DivIcon Represents a lightweight icon for markers that uses a simple <div>
+element instead of an image. Inherits from Icon but ignores the iconUrl and shadow options.
+
+
+Usage example
+
+
+
+
+
+
+
+var myIcon = L.divIcon({className: 'my-div-icon'});
+// you can set .my-div-icon styles in CSS
+L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
+
+By default, it has a 'leaflet-div-icon' CSS class and is styled as a little white square with a shadow.
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.divIcon (<DivIcon options > options )
+ Creates a DivIcon instance with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ html
+ String|HTMLElement
+ ''
+ Custom HTML code to put inside the div element, empty by default. Alternatively,
+an instance of HTMLElement.
+
+
+ bgPos
+ Point
+ [0, 0]
+ Optional relative position of the background, in pixels
+
+
+
+
+
+
+
+
▶ Options inherited from Icon
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ iconUrl
+ String
+ null
+ (required) The URL to the icon image (absolute or relative to your script path).
+
+
+ iconRetinaUrl
+ String
+ null
+ The URL to a retina sized version of the icon image (absolute or relative to your
+script path). Used for Retina screen devices.
+
+
+ iconSize
+ Point
+ null
+ Size of the icon image in pixels.
+
+
+ iconAnchor
+ Point
+ null
+ The coordinates of the "tip" of the icon (relative to its top left corner). The icon
+will be aligned so that this point is at the marker's geographical location. Centered
+by default if size is specified, also can be set in CSS with negative margins.
+
+
+
+ tooltipAnchor
+ Point
+ [0, 0]
+ The coordinates of the point from which tooltips will "open", relative to the icon anchor.
+
+
+ shadowUrl
+ String
+ null
+ The URL to the icon shadow image. If not specified, no shadow image will be created.
+
+
+ shadowRetinaUrl
+ String
+ null
+
+
+
+ shadowSize
+ Point
+ null
+ Size of the shadow image in pixels.
+
+
+ shadowAnchor
+ Point
+ null
+ The coordinates of the "tip" of the shadow (relative to its top left corner) (the same
+as iconAnchor if not specified).
+
+
+ className
+ String
+ ''
+ A custom class name to assign to both icon and shadow images. Empty by default.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Icon
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ createIcon (<HTMLElement> oldIcon? )
+ HTMLElement
+ Called internally when the icon has to be shown, returns a <img> HTML element
+styled according to the options.
+
+
+
+ createShadow (<HTMLElement> oldIcon? )
+ HTMLElement
+ As createIcon, but for the shadow beneath it.
+
+
+
+
+
+
+
+
+ Control.Zoom A basic zoom control with two buttons (zoom in and zoom out). It is put on the map by default unless you set its zoomControl option to false. Extends Control .
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.control.zoom (<Control.Zoom options > options )
+ Creates a zoom control
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ zoomInText
+ String
+ '+'
+ The text set on the 'zoom in' button.
+
+
+ zoomInTitle
+ String
+ 'Zoom in'
+ The title set on the 'zoom in' button.
+
+
+ zoomOutText
+ String
+ '−
+ '
+The text set on the 'zoom out' button.
+
+
+ zoomOutTitle
+ String
+ 'Zoom out'
+ The title set on the 'zoom out' button.
+
+
+
+
+
+
+
+
▶ Options inherited from Control
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Control
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+
+
+ Control.Attribution The attribution control allows you to display attribution data in a small text box on a map. It is put on the map by default unless you set its attributionControl option to false, and it fetches attribution texts from layers with the getAttribution method automatically. Extends Control.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ prefix
+ String
+ 'Leaflet'
+ The HTML text shown before the attributions. Pass false to disable.
+
+
+
+
+
+
+
+
▶ Options inherited from Control
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ setPrefix (<String> prefix )
+ this
+ Sets the text before the attributions.
+
+
+
+ addAttribution (<String> text )
+ this
+ Adds an attribution text (e.g. 'Vector data © Mapbox').
+
+
+
+ removeAttribution (<String> text )
+ this
+ Removes an attribution text.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Control
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+
+
+ Control.Layers The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the detailed example ). Extends Control .
+
+
+Usage example
+
+
+
+
+
+
+
+var baseLayers = {
+ "Mapbox": mapbox,
+ "OpenStreetMap": osm
+};
+var overlays = {
+ "Marker": marker,
+ "Roads": roadsLayer
+};
+L.control.layers(baseLayers, overlays).addTo(map);
+
+The baseLayers and overlays parameters are object literals with layer names as keys and Layer objects as values:
+{
+ "<someName1>": layer1,
+ "<someName2>": layer2
+}
+
+The layer names can contain HTML, which allows you to add additional styling to the items:
+{"<img src='my-layer-icon' /> <span class='my-layer-item'>My Layer</span>": myLayer}
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.control.layers (<Object> baselayers? , <Object> overlays? , <Control.Layers options > options? )
+ Creates a layers control with the given layers. Base layers will be switched with radio buttons, while overlays will be switched with checkboxes. Note that all base layers should be passed in the base layers object, but only one should be added to the map during map instantiation.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ collapsed
+ Boolean
+ true
+ If true, the control will be collapsed into an icon and expanded on mouse hover or touch.
+
+
+ autoZIndex
+ Boolean
+ true
+ If true, the control will assign zIndexes in increasing order to all of its layers so that the order is preserved when switching them on/off.
+
+
+ hideSingleBase
+ Boolean
+ false
+ If true, the base layers in the control will be hidden when there is only one.
+
+
+ sortLayers
+ Boolean
+ false
+ Whether to sort the layers. When false, layers will keep the order
+in which they were added to the control.
+
+
+ sortFunction
+ Function
+ *
+ A compare function
+that will be used for sorting the layers, when sortLayers is true.
+The function receives both the L.Layer instances and their names, as in
+sortFunction(layerA, layerB, nameA, nameB).
+By default, it sorts layers alphabetically by their name.
+
+
+
+
+
+
+
+
▶ Options inherited from Control
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addBaseLayer (<Layer > layer , <String> name )
+ this
+ Adds a base layer (radio button entry) with the given name to the control.
+
+
+
+ addOverlay (<Layer > layer , <String> name )
+ this
+ Adds an overlay (checkbox entry) with the given name to the control.
+
+
+
+ removeLayer (<Layer > layer )
+ this
+ Remove the given layer from the control.
+
+
+
+ expand ()
+ this
+ Expand the control container if collapsed.
+
+
+
+ collapse ()
+ this
+ Collapse the control container if expanded.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Control
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+
+
+ Control.Scale A simple scale control that shows the scale of the current center of screen in metric (m/km) and imperial (mi/ft) systems. Extends Control .
+
+
+Usage example
+
+
+
+
+
+
+
+L.control.scale().addTo(map);
+
+
+
+
+
+
+
+
+Creation
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.control.scale (<Control.Scale options > options? )
+ Creates an scale control with the given options.
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ maxWidth
+ Number
+ 100
+ Maximum width of the control in pixels. The width is set dynamically to show round values (e.g. 100, 200, 500).
+
+
+ metric
+ Boolean
+ True
+ Whether to show the metric scale line (m/km).
+
+
+ imperial
+ Boolean
+ True
+ Whether to show the imperial scale line (mi/ft).
+
+
+ updateWhenIdle
+ Boolean
+ false
+ If true, the control is updated on moveend , otherwise it's always up-to-date (updated on move ).
+
+
+
+
+
+
+
+
▶ Options inherited from Control
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Control
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+
+
+ Browser A namespace with static properties for browser/feature detection used by Leaflet internally.
+
+
+Usage example
+
+
+
+
+
+
+
+if (L.Browser.ielt9) {
+ alert('Upgrade your browser, dude!');
+}
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ ie
+ Boolean
+ true for all Internet Explorer versions (not Edge).
+
+
+ ielt9
+ Boolean
+ true for Internet Explorer versions less than 9.
+
+
+ edge
+ Boolean
+ true for the Edge web browser.
+
+
+ webkit
+ Boolean
+ true for webkit-based browsers like Chrome and Safari (including mobile versions).
+
+
+ android
+ Boolean
+ true for any browser running on an Android platform.
+
+
+ android23
+ Boolean
+ true for browsers running on Android 2 or Android 3.
+
+
+ androidStock
+ Boolean
+ true for the Android stock browser (i.e. not Chrome)
+
+
+ opera
+ Boolean
+ true for the Opera browser
+
+
+ chrome
+ Boolean
+ true for the Chrome browser.
+
+
+ gecko
+ Boolean
+ true for gecko-based browsers like Firefox.
+
+
+ safari
+ Boolean
+ true for the Safari browser.
+
+
+ opera12
+ Boolean
+ true for the Opera browser supporting CSS transforms (version 12 or later).
+
+
+ win
+ Boolean
+ true when the browser is running in a Windows platform
+
+
+ ie3d
+ Boolean
+ true for all Internet Explorer versions supporting CSS transforms.
+
+
+ webkit3d
+ Boolean
+ true for webkit-based browsers supporting CSS transforms.
+
+
+ gecko3d
+ Boolean
+ true for gecko-based browsers supporting CSS transforms.
+
+
+ any3d
+ Boolean
+ true for all browsers supporting CSS transforms.
+
+
+ mobile
+ Boolean
+ true for all browsers running in a mobile device.
+
+
+ mobileWebkit
+ Boolean
+ true for all webkit-based browsers in a mobile device.
+
+
+ mobileWebkit3d
+ Boolean
+ true for all webkit-based browsers in a mobile device supporting CSS transforms.
+
+
+ msPointer
+ Boolean
+ true for browsers implementing the Microsoft touch events model (notably IE10).
+
+
+ pointer
+ Boolean
+ true for all browsers supporting pointer events .
+
+
+ touch
+ Boolean
+ true for all browsers supporting touch events .
+This does not necessarily mean that the browser is running in a computer with
+a touchscreen, it only means that the browser is capable of understanding
+touch events.
+
+
+ mobileOpera
+ Boolean
+ true for the Opera browser in a mobile device.
+
+
+ mobileGecko
+ Boolean
+ true for gecko-based browsers running in a mobile device.
+
+
+ retina
+ Boolean
+ true for browsers on a high-resolution "retina" screen or on any screen when browser's display zoom is more than 100%.
+
+
+ passiveEvents
+ Boolean
+ true for browsers that support passive events.
+
+
+ canvas
+ Boolean
+ true when the browser supports <canvas> .
+
+
+ svg
+ Boolean
+ true when the browser supports SVG .
+
+
+ vml
+ Boolean
+ true if the browser supports VML .
+
+
+
+
+
+
+ Util Various utility functions, used by Leaflet internally.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ extend (<Object> dest , <Object> src? )
+ Object
+ Merges the properties of the src object (or multiple objects) into dest object and returns the latter. Has an L.extend shortcut.
+
+
+ create (<Object> proto , <Object> properties? )
+ Object
+ Compatibility polyfill for Object.create
+
+
+ bind (<Function> fn , … )
+ Function
+ Returns a new function bound to the arguments passed, like Function.prototype.bind .
+Has a L.bind() shortcut.
+
+
+ stamp (<Object> obj )
+ Number
+ Returns the unique ID of an object, assigning it one if it doesn't have it.
+
+
+ throttle (<Function> fn , <Number> time , <Object> context )
+ Function
+ Returns a function which executes function fn with the given scope context
+(so that the this keyword refers to context inside fn's code). The function
+fn will be called no more than one time per given amount of time. The arguments
+received by the bound function will be any arguments passed when binding the
+function, followed by any arguments passed when invoking the bound function.
+Has an L.throttle shortcut.
+
+
+ wrapNum (<Number> num , <Number[]> range , <Boolean> includeMax? )
+ Number
+ Returns the number num modulo range in such a way so it lies within
+range[0] and range[1]. The returned value will be always smaller than
+range[1] unless includeMax is set to true.
+
+
+ falseFn ()
+ Function
+ Returns a function which always returns false.
+
+
+ formatNum (<Number> num , <Number> digits? )
+ Number
+ Returns the number num rounded to digits decimals, or to 6 decimals by default.
+
+
+ trim (<String> str )
+ String
+ Compatibility polyfill for String.prototype.trim
+
+
+ splitWords (<String> str )
+ String[]
+ Trims and splits the string on whitespace and returns the array of parts.
+
+
+ setOptions (<Object> obj , <Object> options )
+ Object
+ Merges the given properties to the options of the obj object, returning the resulting options. See Class options. Has an L.setOptions shortcut.
+
+
+ getParamString (<Object> obj , <String> existingUrl? , <Boolean> uppercase? )
+ String
+ Converts an object into a parameter URL string, e.g. {a: "foo", b: "bar"}
+translates to '?a=foo&b=bar'. If existingUrl is set, the parameters will
+be appended at the end. If uppercase is true, the parameter names will
+be uppercased (e.g. '?A=foo&B=bar')
+
+
+ template (<String> str , <Object> data )
+ String
+ Simple templating facility, accepts a template string of the form 'Hello {a}, {b}'
+and a data object like {a: 'foo', b: 'bar'}, returns evaluated string
+('Hello foo, bar'). You can also specify functions instead of strings for
+data values — they will be evaluated passing data as an argument.
+
+
+ isArray (obj )
+ Boolean
+ Compatibility polyfill for Array.isArray
+
+
+ indexOf (<Array> array , <Object> el )
+ Number
+ Compatibility polyfill for Array.prototype.indexOf
+
+
+ requestAnimFrame (<Function> fn , <Object> context? , <Boolean> immediate? )
+ Number
+ Schedules fn to be executed when the browser repaints. fn is bound to
+context if given. When immediate is set, fn is called immediately if
+the browser doesn't have native support for
+window.requestAnimationFrame ,
+otherwise it's delayed. Returns a request ID that can be used to cancel the request.
+
+
+ cancelAnimFrame (<Number> id )
+ undefined
+ Cancels a previous requestAnimFrame. See also window.cancelAnimationFrame .
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ lastId
+ Number
+ Last unique ID used by stamp()
+
+
+ emptyImageUrl
+ String
+ Data URI string containing a base64-encoded empty GIF image.
+Used as a hack to free memory from unused images on WebKit-powered
+mobile devices (by setting image src to this string).
+
+
+
+
+
+
+ Represents an affine transformation: a set of coefficients a, b, c, d
+for transforming a point of a form (x, y) into (a*x + b, c*y + d) and doing
+the reverse. Used by Leaflet in its projections code.
+
+
+
+
+
+
+
+
+
+
+var transformation = L.transformation(2, 5, -1, 10),
+ p = L.point(1, 2),
+ p2 = transformation.transform(p), // L.point(7, 8)
+ p3 = transformation.untransform(p2); // L.point(1, 2)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Factory
+ Description
+
+
+
+ L.transformation (<Number> a , <Number> b , <Number> c , <Number> d )
+ Instantiates a Transformation object with the given coefficients.
+
+
+ L.transformation (<Array> coefficients )
+ Expects an coefficients array of the form
+[a: Number, b: Number, c: Number, d: Number].
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ transform (<Point > point , <Number> scale? )
+ Point
+ Returns a transformed point, optionally multiplied by the given scale.
+Only accepts actual L.Point instances, not arrays.
+
+
+
+ untransform (<Point > point , <Number> scale? )
+ Point
+ Returns the reverse transformation of the given point, optionally divided
+by the given scale. Only accepts actual L.Point instances, not arrays.
+
+
+
+
+
+
+
+ LineUtil Various utility functions for polyline points processing, used by Leaflet internally to make polylines lightning-fast.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ simplify (<Point[]> points , <Number> tolerance )
+ Point[]
+ Dramatically reduces the number of points in a polyline while retaining
+its shape and returns a new array of simplified points, using the
+Douglas-Peucker algorithm .
+Used for a huge performance boost when processing/displaying Leaflet polylines for
+each zoom level and also reducing visual noise. tolerance affects the amount of
+simplification (lesser value means higher quality but slower and with more points).
+Also released as a separated micro-library Simplify.js .
+
+
+ pointToSegmentDistance (<Point > p , <Point > p1 , <Point > p2 )
+ Number
+ Returns the distance between point p and segment p1 to p2.
+
+
+ closestPointOnSegment (<Point > p , <Point > p1 , <Point > p2 )
+ Number
+ Returns the closest point from a point p on a segment p1 to p2.
+
+
+ clipSegment (<Point > a , <Point > b , <Bounds > bounds , <Boolean> useLastCode? , <Boolean> round? )
+ Point[]|Boolean
+ Clips the segment a to b by rectangular bounds with the
+Cohen-Sutherland algorithm
+(modifying the segment points directly!). Used by Leaflet to only show polyline
+points that are on the screen or near, increasing performance.
+
+
+ isFlat (<LatLng[]> latlngs )
+ Boolean
+ Returns true if latlngs is a flat array, false is nested.
+
+
+
+
+
+
+ PolyUtil Various utility functions for polygon geometries.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ clipPolygon (<Point[]> points , <Bounds > bounds , <Boolean> round? )
+ Point[]
+ Clips the polygon geometry defined by the given points by the given bounds (using the Sutherland-Hodgman algorithm ).
+Used by Leaflet to only show polygon points that are on the screen or near, increasing
+performance. Note that polygon points needs different algorithm for clipping
+than polyline, so there's a separate method for it.
+
+
+
+
+
+
+ DomEvent Utility functions to work with the DOM events , used by Leaflet internally.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ on (<HTMLElement> el , <String> types , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular DOM event type of the
+element el. You can optionally specify the context of the listener
+(object the this keyword will point to). You can also pass several
+space-separated types (e.g. 'click dblclick').
+
+
+ on (<HTMLElement> el , <Object> eventMap , <Object> context? )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+ off (<HTMLElement> el , <String> types , <Function> fn , <Object> context? )
+ this
+ Removes a previously added listener function.
+Note that if you passed a custom context to on, you must pass the same
+context to off in order to remove the listener.
+
+
+ off (<HTMLElement> el , <Object> eventMap , <Object> context? )
+ this
+ Removes a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+ stopPropagation (<DOMEvent> ev )
+ this
+ Stop the given event from propagation to parent elements. Used inside the listener functions:
+L.DomEvent.on(div, 'click', function (ev) {
+ L.DomEvent.stopPropagation(ev);
+});
+
+
+
+ disableScrollPropagation (<HTMLElement> el )
+ this
+ Adds stopPropagation to the element's 'mousewheel' events (plus browser variants).
+
+
+ disableClickPropagation (<HTMLElement> el )
+ this
+ Adds stopPropagation to the element's 'click', 'doubleclick',
+'mousedown' and 'touchstart' events (plus browser variants).
+
+
+ preventDefault (<DOMEvent> ev )
+ this
+ Prevents the default action of the DOM Event ev from happening (such as
+following a link in the href of the a element, or doing a POST request
+with page reload when a <form> is submitted).
+Use it inside listener functions.
+
+
+ stop (<DOMEvent> ev )
+ this
+ Does stopPropagation and preventDefault at the same time.
+
+
+ getMousePosition (<DOMEvent> ev , <HTMLElement> container? )
+ Point
+ Gets normalized mouse position from a DOM event relative to the
+container (border excluded) or to the whole page if not specified.
+
+
+ getWheelDelta (<DOMEvent> ev )
+ Number
+ Gets normalized wheel delta from a mousewheel DOM event, in vertical
+pixels scrolled (negative if scrolling down).
+Events from pointing devices without precise scrolling are mapped to
+a best guess of 60 pixels.
+
+
+ addListener (… )
+ this
+ Alias to L.DomEvent.on
+
+
+ removeListener (… )
+ this
+ Alias to L.DomEvent.off
+
+
+
+
+
+
+ DomUtil Utility functions to work with the DOM
+tree, used by Leaflet internally.
+Most functions expecting or returning a HTMLElement also work for
+SVG elements. The only difference is that classes refer to CSS classes
+in HTML and SVG classes in SVG.
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ get (<String|HTMLElement> id )
+ HTMLElement
+ Returns an element given its DOM id, or returns the element itself
+if it was passed directly.
+
+
+ getStyle (<HTMLElement> el , <String> styleAttrib )
+ String
+ Returns the value for a certain style attribute on an element,
+including computed values or values set through CSS.
+
+
+ create (<String> tagName , <String> className? , <HTMLElement> container? )
+ HTMLElement
+ Creates an HTML element with tagName, sets its class to className, and optionally appends it to container element.
+
+
+ remove (<HTMLElement> el )
+
+ Removes el from its parent element
+
+
+ empty (<HTMLElement> el )
+
+ Removes all of el's children elements from el
+
+
+ toFront (<HTMLElement> el )
+
+ Makes el the last child of its parent, so it renders in front of the other children.
+
+
+ toBack (<HTMLElement> el )
+
+ Makes el the first child of its parent, so it renders behind the other children.
+
+
+ hasClass (<HTMLElement> el , <String> name )
+ Boolean
+ Returns true if the element's class attribute contains name.
+
+
+ addClass (<HTMLElement> el , <String> name )
+
+ Adds name to the element's class attribute.
+
+
+ removeClass (<HTMLElement> el , <String> name )
+
+ Removes name from the element's class attribute.
+
+
+ setClass (<HTMLElement> el , <String> name )
+
+ Sets the element's class.
+
+
+ getClass (<HTMLElement> el )
+ String
+ Returns the element's class.
+
+
+ setOpacity (<HTMLElement> el , <Number> opacity )
+
+ Set the opacity of an element (including old IE support).
+opacity must be a number from 0 to 1.
+
+
+ testProp (<String[]> props )
+ String|false
+ Goes through the array of style names and returns the first name
+that is a valid style name for an element. If no such name is found,
+it returns false. Useful for vendor-prefixed styles like transform.
+
+
+ setTransform (<HTMLElement> el , <Point > offset , <Number> scale? )
+
+ Resets the 3D CSS transform of el so it is translated by offset pixels
+and optionally scaled by scale. Does not have an effect if the
+browser doesn't support 3D CSS transforms.
+
+
+ setPosition (<HTMLElement> el , <Point > position )
+
+ Sets the position of el to coordinates specified by position,
+using CSS translate or top/left positioning depending on the browser
+(used by Leaflet internally to position its layers).
+
+
+ getPosition (<HTMLElement> el )
+ Point
+ Returns the coordinates of an element previously positioned with setPosition.
+
+
+ disableTextSelection ()
+
+ Prevents the user from generating selectstart DOM events, usually generated
+when the user drags the mouse through a page with text. Used internally
+by Leaflet to override the behaviour of any click-and-drag interaction on
+the map. Affects drag interactions on the whole document.
+
+
+ enableTextSelection ()
+
+ Cancels the effects of a previous L.DomUtil.disableTextSelection .
+
+
+ disableImageDrag ()
+
+ As L.DomUtil.disableTextSelection , but
+for dragstart DOM events, usually generated when the user drags an image.
+
+
+ enableImageDrag ()
+
+ Cancels the effects of a previous L.DomUtil.disableImageDrag .
+
+
+ preventOutline (<HTMLElement> el )
+
+ Makes the outline
+of the element el invisible. Used internally by Leaflet to prevent
+focusable elements from displaying an outline when the user performs a
+drag interaction on them.
+
+
+ restoreOutline ()
+
+ Cancels the effects of a previous L.DomUtil.preventOutline .
+
+
+ getSizedParentNode (<HTMLElement> el )
+ HTMLElement
+ Finds the closest parent node which size (width and height) is not null.
+
+
+ getScale (<HTMLElement> el )
+ Object
+ Computes the CSS scale currently applied on the element.
+Returns an object with x and y members as horizontal and vertical scales respectively,
+and boundingClientRect as the result of getBoundingClientRect() .
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ TRANSFORM
+ String
+ Vendor-prefixed transform style name (e.g. 'webkitTransform' for WebKit).
+
+
+ TRANSITION
+ String
+ Vendor-prefixed transition style name.
+
+
+ TRANSITION_END
+ String
+ Vendor-prefixed transitionend event name.
+
+
+
+
+
+
+ PosAnimation Used internally for panning animations, utilizing CSS3 Transitions for modern browsers and a timer fallback for IE6-9.
+
+
+Usage example
+
+
+
+
+
+
+
+var fx = new L.PosAnimation();
+fx.run(el, [300, 500], 0.5);
+
+
+
+
+
+
+
+
+Constructor
+
+
+
+
+
+
+
+
+ Constructor
+ Description
+
+
+
+ L.PosAnimation ()
+ Creates a PosAnimation object.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ start
+ Event
+ Fired when the animation starts
+
+
+ step
+ Event
+ Fired continuously during the animation.
+
+
+ end
+ Event
+ Fired when the animation ends.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ run (<HTMLElement> el , <Point > newPos , <Number> duration? , <Number> easeLinearity? )
+
+ Run an animation of a given element to a new position, optionally setting
+duration in seconds (0.25 by default) and easing linearity factor (3rd
+argument of the cubic bezier curve ,
+0.5 by default).
+
+
+
+ stop ()
+
+ Stops the animation (if currently running).
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Draggable A class for making DOM elements draggable (including touch support).
+Used internally for map and marker dragging. Only works for elements
+that were positioned with L.DomUtil.setPosition .
+
+
+Usage example
+
+
+
+
+
+
+
+var draggable = new L.Draggable(elementToDrag);
+draggable.enable();
+
+
+
+
+
+
+
+
+Constructor
+
+
+
+
+
+
+
+
+ Constructor
+ Description
+
+
+
+ L.Draggable (<HTMLElement> el , <HTMLElement> dragHandle? , <Boolean> preventOutline? , <Draggable options > options? )
+ Creates a Draggable object for moving el when you start dragging the dragHandle element (equals el itself by default).
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ clickTolerance
+ Number
+ 3
+ The max number of pixels a user can shift the mouse pointer during a click
+for it to be considered a valid click (as opposed to a mouse drag).
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ down
+ Event
+ Fired when a drag is about to start.
+
+
+ dragstart
+ Event
+ Fired when a drag starts
+
+
+ predrag
+ Event
+ Fired continuously during dragging before each corresponding
+update of the element's position.
+
+
+ drag
+ Event
+ Fired continuously during dragging.
+
+
+ dragend
+ DragEndEvent
+ Fired when the drag ends.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ enable ()
+
+ Enables the dragging ability
+
+
+
+ disable ()
+
+ Disables the dragging ability
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Class L.Class powers the OOP facilities of Leaflet and is used to create almost all of the Leaflet classes documented here.
+In addition to implementing a simple classical inheritance model, it introduces several special properties for convenient code organization — options, includes and statics.
+
+
+Usage example
+
+
+
+
+
+
+
+var MyClass = L.Class.extend({
+initialize: function (greeter) {
+ this.greeter = greeter;
+ // class constructor
+},
+greet: function (name) {
+ alert(this.greeter + ', ' + name)
+ }
+});
+// create instance of MyClass, passing "Hello" to the constructor
+var a = new MyClass("Hello");
+// call greet method, alerting "Hello, World"
+a.greet("World");
+
+
+
+
+
+
+Class Factories
+
+
+
+You may have noticed that Leaflet objects are created without using
+the new keyword. This is achieved by complementing each class with a
+lowercase factory method:
+new L.Map('map'); // becomes:
+L.map('map');
+
+The factories are implemented very easily, and you can do this for your own classes:
+L.map = function (id, options) {
+ return new L.Map(id, options);
+};
+
+
+
+
+
+
+Inheritance
+
+
+
+You use L.Class.extend to define new classes, but you can use the same method on any class to inherit from it:
+var MyChildClass = MyClass.extend({
+ // ... new properties and methods
+});
+
+This will create a class that inherits all methods and properties of the parent class (through a proper prototype chain), adding or overriding the ones you pass to extend. It will also properly react to instanceof:
+var a = new MyChildClass();
+a instanceof MyChildClass; // true
+a instanceof MyClass; // true
+
+You can call parent methods (including constructor) from corresponding child ones (as you do with super calls in other languages) by accessing parent class prototype and using JavaScript's call or apply:
+var MyChildClass = MyClass.extend({
+ initialize: function () {
+ MyClass.prototype.initialize.call(this, "Yo");
+ },
+ greet: function (name) {
+ MyClass.prototype.greet.call(this, 'bro ' + name + '!');
+ }
+});
+var a = new MyChildClass();
+a.greet('Jason'); // alerts "Yo, bro Jason!"
+
+
+
+
+
+Options
+
+
+
+options is a special property that unlike other objects that you pass
+to extend will be merged with the parent one instead of overriding it
+completely, which makes managing configuration of objects and default
+values convenient:
+var MyClass = L.Class.extend({
+ options: {
+ myOption1: 'foo',
+ myOption2: 'bar'
+ }
+});
+var MyChildClass = MyClass.extend({
+ options: {
+ myOption1: 'baz',
+ myOption3: 5
+ }
+});
+var a = new MyChildClass();
+a.options.myOption1; // 'baz'
+a.options.myOption2; // 'bar'
+a.options.myOption3; // 5
+
+There's also L.Util.setOptions , a method for
+conveniently merging options passed to constructor with the defaults
+defines in the class:
+var MyClass = L.Class.extend({
+ options: {
+ foo: 'bar',
+ bla: 5
+ },
+ initialize: function (options) {
+ L.Util.setOptions(this, options);
+ ...
+ }
+});
+var a = new MyClass({bla: 10});
+a.options; // {foo: 'bar', bla: 10}
+
+Note that the options object allows any keys, not just
+the options defined by the class and its base classes.
+This means you can use the options object to store
+application specific information, as long as you avoid
+keys that are already used by the class in question.
+
+
+
+
+
+Includes
+
+
+
+includes is a special class property that merges all specified objects into the class (such objects are called mixins).
+ var MyMixin = {
+ foo: function () { ... },
+ bar: 5
+};
+var MyClass = L.Class.extend({
+ includes: MyMixin
+});
+var a = new MyClass();
+a.foo();
+
+You can also do such includes in runtime with the include method:
+MyClass.include(MyMixin);
+
+statics is just a convenience property that injects specified object properties as the static properties of the class, useful for defining constants:
+var MyClass = L.Class.extend({
+ statics: {
+ FOO: 'bar',
+ BLA: 5
+ }
+});
+MyClass.FOO; // 'bar'
+
+
+
+
+
+
+Constructor hooks
+
+
+
+If you're a plugin developer, you often need to add additional initialization code to existing classes (e.g. editing hooks for L.Polyline ). Leaflet comes with a way to do it easily using the addInitHook method:
+MyClass.addInitHook(function () {
+ // ... do something in constructor additionally
+ // e.g. add event listeners, set custom properties etc.
+});
+
+You can also use the following shortcut when you just need to make one additional method call:
+MyClass.addInitHook('methodName', arg1, arg2, …);
+
+
+
+
+
+
+
+
+Functions
+
+
+
+
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ extend (<Object> props )
+ Function
+ Extends the current class given the properties to be included.
+Returns a Javascript function that is a class constructor (to be called with new).
+
+
+ include (<Object> properties )
+ this
+ Includes a mixin into the current class.
+
+
+ mergeOptions (<Object> options )
+ this
+ Merges options into the defaults of the class.
+
+
+ addInitHook (<Function> fn )
+ this
+ Adds a constructor hook to the class.
+
+
+
+
+
+
+ Evented A set of methods shared between event-powered classes (like Map and Marker ). Generally, events allow you to execute some function when something happens with an object (e.g. the user clicks on the map, causing the map to fire 'click' event).
+
+
+Usage example
+
+
+
+
+
+
+
+map.on('click', function(e) {
+ alert(e.latlng);
+} );
+
+Leaflet deals with event listeners by reference, so if you want to add a listener and then remove it, define it as a function:
+function onClick(e) { ... }
+map.on('click', onClick);
+map.off('click', onClick);
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+ Layer A set of methods from the Layer base class that all Leaflet layers use.
+Inherits all methods, options and events from L.Evented .
+
+
+Usage example
+
+
+
+
+
+
+
+var layer = L.marker(latlng).addTo(map);
+layer.addTo(map);
+layer.remove();
+
+
+
+
+
+
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ onAdd (<Map > map )
+ this
+ Should contain code that creates DOM elements for the layer, adds them to map panes where they should belong and puts listeners on relevant map events. Called on map.addLayer(layer) .
+
+
+
+ onRemove (<Map > map )
+ this
+ Should contain all clean up code that removes the layer's elements from the DOM and removes listeners previously added in onAdd . Called on map.removeLayer(layer) .
+
+
+
+ getEvents ()
+ Object
+ This optional method should return an object like { viewreset: this._reset } for addEventListener . The event handlers in this object will be automatically added and removed from the map with your layer.
+
+
+
+ getAttribution ()
+ String
+ This optional method should return a string containing HTML to be shown on the Attribution control whenever the layer is visible.
+
+
+
+ beforeAdd (<Map > map )
+ this
+ Optional method. Called on map.addLayer(layer) , before the layer is added to the map, before events are initialized, without waiting until the map is in a usable state. Use for early initialization only.
+
+
+
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Interactive layer Some Layer s can be made interactive - when the user interacts
+with such a layer, mouse events like click and mouseover can be handled.
+Use the event handling methods to handle these events.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ interactive
+ Boolean
+ true
+ If false, the layer will not emit mouse events and will act as a part of the underlying map.
+
+
+ bubblingMouseEvents
+ Boolean
+ true
+ When true, a mouse event on this layer will trigger the same event on the map
+(unless L.DomEvent.stopPropagation is used).
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+Mouse events
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ click
+ MouseEvent
+ Fired when the user clicks (or taps) the layer.
+
+
+ dblclick
+ MouseEvent
+ Fired when the user double-clicks (or double-taps) the layer.
+
+
+ mousedown
+ MouseEvent
+ Fired when the user pushes the mouse button on the layer.
+
+
+ mouseup
+ MouseEvent
+ Fired when the user releases the mouse button pushed on the layer.
+
+
+ mouseover
+ MouseEvent
+ Fired when the mouse enters the layer.
+
+
+ mouseout
+ MouseEvent
+ Fired when the mouse leaves the layer.
+
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Control L.Control is a base class for implementing map controls. Handles positioning.
+All other controls extend from this class.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ position
+ String
+ 'topright'
+ The position of the control (one of the map corners). Possible values are 'topleft',
+'topright', 'bottomleft' or 'bottomright'
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ getPosition ()
+ string
+ Returns the position of the control.
+
+
+
+ setPosition (<string> position )
+ this
+ Sets the position of the control.
+
+
+
+ getContainer ()
+ HTMLElement
+ Returns the HTMLElement that contains the control.
+
+
+
+ addTo (<Map > map )
+ this
+ Adds the control to the given map.
+
+
+
+ remove ()
+ this
+ Removes the control from the map it is currently active on.
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ onAdd (<Map > map )
+ HTMLElement
+ Should return the container DOM element for the control and add listeners on relevant map events. Called on control.addTo(map) .
+
+
+
+ onRemove (<Map > map )
+
+ Optional method. Should contain all clean up code that removes the listeners previously added in onAdd . Called on control.remove() .
+
+
+
+
+
+
+
+ Handler Abstract class for map interaction handlers
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ enable ()
+ this
+ Enables the handler
+
+
+
+ disable ()
+ this
+ Disables the handler
+
+
+
+ enabled ()
+ Boolean
+ Returns true if the handler is enabled
+
+
+
+
+
+
+Extension methods
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addHooks ()
+
+ Called when the handler is enabled, should add event hooks.
+
+
+
+ removeHooks ()
+
+ Called when the handler is disabled, should remove the event hooks added previously.
+
+
+
+
+
+
+
+
+Functions
+
+
+
+There is static function which can be called without instantiating L.Handler:
+
+
+
+
+ Function
+ Returns
+ Description
+
+
+
+ addTo (<Map > map , <String> name )
+ this
+ Adds a new Handler to the given map with the given name.
+
+
+
+
+
+
+ Projection An object with methods for projecting geographical coordinates of the world onto
+a flat surface (and back). See Map projection .
+
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ project (<LatLng > latlng )
+ Point
+ Projects geographical coordinates into a 2D point.
+Only accepts actual L.LatLng instances, not arrays.
+
+
+
+ unproject (<Point > point )
+ LatLng
+ The inverse of project. Projects a 2D point into a geographical location.
+Only accepts actual L.Point instances, not arrays.
+Note that the projection instances do not inherit from Leafet's Class object,
+and can't be instantiated. Also, new classes can't inherit from them,
+and methods can't be added to them with the include function.
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ bounds
+ Bounds
+ The bounds (specified in CRS units) where the projection is valid
+
+
+
+
+
+
+
+Defined projections
+
+
+
+
+
+
+
+
+
+ Projection
+ Description
+
+
+
+ L.Projection.LonLat
+ Equirectangular, or Plate Carree projection — the most simple projection,
+mostly used by GIS enthusiasts. Directly maps x as longitude, and y as
+latitude. Also suitable for flat worlds, e.g. game maps. Used by the
+EPSG:4326 and Simple CRS.
+
+
+ L.Projection.Mercator
+ Elliptical Mercator projection — more complex than Spherical Mercator. Assumes that Earth is an ellipsoid. Used by the EPSG:3395 CRS.
+
+
+ L.Projection.SphericalMercator
+ Spherical Mercator projection — the most common projection for online maps,
+used by almost all free and commercial tile providers. Assumes that Earth is
+a sphere. Used by the EPSG:3857 CRS.
+
+
+
+
+
+
+ CRS
+
+Methods
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ latLngToPoint (<LatLng > latlng , <Number> zoom )
+ Point
+ Projects geographical coordinates into pixel coordinates for a given zoom.
+
+
+
+ pointToLatLng (<Point > point , <Number> zoom )
+ LatLng
+ The inverse of latLngToPoint. Projects pixel coordinates on a given
+zoom into geographical coordinates.
+
+
+
+ project (<LatLng > latlng )
+ Point
+ Projects geographical coordinates into coordinates in units accepted for
+this CRS (e.g. meters for EPSG:3857, for passing it to WMS services).
+
+
+
+ unproject (<Point > point )
+ LatLng
+ Given a projected coordinate returns the corresponding LatLng.
+The inverse of project.
+
+
+
+ scale (<Number> zoom )
+ Number
+ Returns the scale used when transforming projected coordinates into
+pixel coordinates for a particular zoom. For example, it returns
+256 * 2^zoom for Mercator-based CRS.
+
+
+
+ zoom (<Number> scale )
+ Number
+ Inverse of scale(), returns the zoom level corresponding to a scale
+factor of scale.
+
+
+
+ getProjectedBounds (<Number> zoom )
+ Bounds
+ Returns the projection's bounds scaled and transformed for the provided zoom.
+
+
+
+ distance (<LatLng > latlng1 , <LatLng > latlng2 )
+ Number
+ Returns the distance between two geographical coordinates.
+
+
+
+ wrapLatLng (<LatLng > latlng )
+ LatLng
+ Returns a LatLng where lat and lng has been wrapped according to the
+CRS's wrapLat and wrapLng properties, if they are outside the CRS's bounds.
+
+
+
+ wrapLatLngBounds (<LatLngBounds > bounds )
+ LatLngBounds
+ Returns a LatLngBounds with the same size as the given one, ensuring
+that its center is within the CRS's bounds.
+Only accepts actual L.LatLngBounds instances, not arrays.
+
+
+
+
+
+
+
+
+Properties
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ code
+ String
+ Standard code name of the CRS passed into WMS services (e.g. 'EPSG:3857')
+
+
+ wrapLng
+ Number[]
+ An array of two numbers defining whether the longitude (horizontal) coordinate
+axis wraps around a given range and how. Defaults to [-180, 180] in most
+geographical CRSs. If undefined, the longitude axis does not wrap around.
+
+
+ wrapLat
+ Number[]
+ Like wrapLng, but for the latitude (vertical) axis.
+
+
+ infinite
+ Boolean
+ If true, the coordinate space will be unbounded (infinite in both axes)
+
+
+
+
+
+
+
+Defined CRSs
+
+
+
+
+
+
+
+
+ CRS
+ Description
+
+
+
+ L.CRS.EPSG3395
+ Rarely used by some commercial tile providers. Uses Elliptical Mercator projection.
+
+
+ L.CRS.EPSG3857
+ The most common CRS for online maps, used by almost all free and commercial
+tile providers. Uses Spherical Mercator projection. Set in by default in
+Map's crs option.
+
+
+ L.CRS.EPSG4326
+ A common CRS among GIS enthusiasts. Uses simple Equirectangular projection.
+Leaflet 1.0.x complies with the TMS coordinate scheme for EPSG:4326 ,
+which is a breaking change from 0.7.x behaviour. If you are using a TileLayer
+with this CRS, ensure that there are two 256x256 pixel tiles covering the
+whole earth at zoom level zero, and that the tile coordinate origin is (-180,+90),
+or (-180,-90) for TileLayers with the tms option set.
+
+
+ L.CRS.Earth
+ Serves as the base for CRS that are global such that they cover the earth.
+Can only be used as the base for other CRS and cannot be used directly,
+since it does not have a code, projection or transformation . distance() returns
+meters.
+
+
+ L.CRS.Simple
+ A simple CRS that maps longitude and latitude into x and y directly.
+May be used for maps of flat surfaces (e.g. game maps). Note that the y
+axis should still be inverted (going from bottom to top). distance() returns
+simple euclidean distance.
+
+
+ L.CRS.Base
+ Object that defines coordinate reference systems for projecting
+geographical points into pixel (screen) coordinates and back (and to
+coordinates in other units for WMS services). See
+spatial reference system .
+Leaflet defines the most usual CRSs by default. If you want to use a
+CRS not defined by default, take a look at the
+Proj4Leaflet plugin.
+Note that the CRS instances do not inherit from Leafet's Class object,
+and can't be instantiated. Also, new classes can't inherit from them,
+and methods can't be added to them with the include function.
+
+
+
+
+
+
+ Renderer Base class for vector renderer implementations (SVG , Canvas ). Handles the
+DOM container of the renderer, its bounds, and its zoom animation.
+A Renderer works as an implicit layer group for all Path s - the renderer
+itself can be added or removed to the map. All paths use a renderer, which can
+be implicit (the map will decide the type of renderer and use it automatically)
+or explicit (using the renderer option of the path).
+Do not use this class directly, use SVG and Canvas instead.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ padding
+ Number
+ 0.1
+ How much to extend the clip area around the map view (relative to its size)
+e.g. 0.1 would be 10% of map view in each direction
+
+
+ tolerance
+ Number
+ 0
+ How much to extend click tolerance round a path/object on the map
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ pane
+ String
+ 'overlayPane'
+ By default the layer will be added to the map's overlay pane . Overriding this option will cause the layer to be placed on another pane by default.
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ update
+ Event
+ Fired when the renderer updates its bounds, center and zoom, for example when
+its map has moved
+
+
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Event objects Whenever a class inheriting from Evented fires an event, a listener function
+will be called with an event argument, which is a plain object containing
+information about the event. For example:
+
map.on('click', function(ev) {
+ alert(ev.latlng); // ev is an event object (MouseEvent in this case)
+});
+
+
The information available depends on the event type:
+
+
+
+
+Event
+
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+KeyboardEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ originalEvent
+ DOMEvent
+ The original DOM KeyboardEvent that triggered this Leaflet event.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+MouseEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ latlng
+ LatLng
+ The geographical point where the mouse event occured.
+
+
+ layerPoint
+ Point
+ Pixel coordinates of the point where the mouse event occured relative to the map layer.
+
+
+ containerPoint
+ Point
+ Pixel coordinates of the point where the mouse event occured relative to the map сontainer.
+
+
+ originalEvent
+ DOMEvent
+ The original DOM MouseEvent or DOM TouchEvent that triggered this Leaflet event.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+LocationEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ latlng
+ LatLng
+ Detected geographical location of the user.
+
+
+ bounds
+ LatLngBounds
+ Geographical bounds of the area user is located in (with respect to the accuracy of location).
+
+
+ accuracy
+ Number
+ Accuracy of location in meters.
+
+
+ altitude
+ Number
+ Height of the position above the WGS84 ellipsoid in meters.
+
+
+ altitudeAccuracy
+ Number
+ Accuracy of altitude in meters.
+
+
+ heading
+ Number
+ The direction of travel in degrees counting clockwise from true North.
+
+
+ speed
+ Number
+ Current velocity in meters per second.
+
+
+ timestamp
+ Number
+ The time when the position was acquired.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+ErrorEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ message
+ String
+ Error message.
+
+
+ code
+ Number
+ Error code (if applicable).
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+LayerEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ layer
+ Layer
+ The layer that was added or removed.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+
+
+
+
+
+
+
+
+LayersControlEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ layer
+ Layer
+ The layer that was added or removed.
+
+
+ name
+ String
+ The name of the layer that was added or removed.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+
+
+
+
+
+
+
+
+TileEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ tile
+ HTMLElement
+ The tile element (image).
+
+
+ coords
+ Point
+ Point object with the tile's x, y, and z (zoom level) coordinates.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+TileErrorEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ tile
+ HTMLElement
+ The tile element (image).
+
+
+ coords
+ Point
+ Point object with the tile's x, y, and z (zoom level) coordinates.
+
+
+ error
+ *
+ Error passed to the tile's done() callback.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+ResizeEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ oldSize
+ Point
+ The old size before resize event.
+
+
+ newSize
+ Point
+ The new size after the resize event.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+GeoJSONEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ layer
+ Layer
+ The layer for the GeoJSON feature that is being added to the map.
+
+
+ properties
+ Object
+ GeoJSON properties of the feature.
+
+
+ geometryType
+ String
+ GeoJSON geometry type of the feature.
+
+
+ id
+ String
+ GeoJSON ID of the feature (if present).
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ tooltip
+ Tooltip
+ The tooltip that was opened or closed.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+DragEndEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ distance
+ Number
+ The distance in pixels the draggable element was moved by.
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+
+
+
+ZoomAnimEvent
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ center
+ LatLng
+ The current center of the map
+
+
+ zoom
+ Number
+ The current zoom level of the map
+
+
+ noUpdate
+ Boolean
+ Whether layers should update their contents due to this event
+
+
+
+
+
+
+
+
▶ Properties inherited from Event
+
+
+
+
+
+
+
+
+ Property
+ Type
+ Description
+
+
+
+ type
+ String
+ The event type (e.g. 'click').
+
+
+ target
+ Object
+ The object that fired the event. For propagated events, the last object in
+the propagation chain that fired the event.
+
+
+ sourceTarget
+ Object
+ The object that originally fired the event. For non-propagated events, this will
+be the same as the target.
+
+
+ propagatedFrom
+ Object
+ For propagated events, the last object that propagated the event to its
+event parent.
+
+
+ layer
+ Object
+ Deprecated. The same as propagatedFrom.
+
+
+
+
+
+
+
+ DivOverlay Base model for L.Popup and L.Tooltip. Inherit from it for custom popup like plugins.
+
+
+Options
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ offset
+ Point
+ Point(0, 7)
+ The offset of the popup position. Useful to control the anchor
+of the popup when opening it on some overlays.
+
+
+ className
+ String
+ ''
+ A custom CSS class name to assign to the popup.
+
+
+ pane
+ String
+ 'popupPane'
+ Map pane where the popup will be added.
+
+
+
+
+
+
+
+
▶ Options inherited from Layer
+
+
+
+
+
+
+
+
+ Option
+ Type
+ Default
+ Description
+
+
+
+ attribution
+ String
+ null
+ String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
+
+
+
+
+
+
+
+
+Events
+
+
+
+
+
+
▶ Events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ add
+ Event
+ Fired after the layer is added to a map
+
+
+ remove
+ Event
+ Fired after the layer is removed from a map
+
+
+
+
+
+
+
+
+
▶ Popup events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip events inherited from Layer
+
+
+
+
+
+
+
+
+ Event
+ Data
+ Description
+
+
+
+ tooltipopen
+ TooltipEvent
+ Fired when a tooltip bound to this layer is opened.
+
+
+ tooltipclose
+ TooltipEvent
+ Fired when a tooltip bound to this layer is closed.
+
+
+
+
+
+
+
+
+Methods
+
+
+
+
+
+
▶ Methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ addTo (<Map|LayerGroup> map )
+ this
+ Adds the layer to the given map or layer group.
+
+
+
+ remove ()
+ this
+ Removes the layer from the map it is currently active on.
+
+
+
+ removeFrom (<Map > map )
+ this
+ Removes the layer from the given map
+
+
+
+ getPane (<String> name? )
+ HTMLElement
+ Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
+
+
+
+ getAttribution ()
+ String
+ Used by the attribution control, returns the attribution option .
+
+
+
+
+
+
+
+
+
+
▶ Popup methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
▶ Tooltip methods inherited from Layer
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ bindTooltip (<String|HTMLElement|Function|Tooltip> content , <Tooltip options > options? )
+ this
+ Binds a tooltip to the layer with the passed content and sets up the
+necessary event listeners. If a Function is passed it will receive
+the layer as the first argument and should return a String or HTMLElement.
+
+
+
+ unbindTooltip ()
+ this
+ Removes the tooltip previously bound with bindTooltip.
+
+
+
+ openTooltip (<LatLng > latlng? )
+ this
+ Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
+
+
+
+ closeTooltip ()
+ this
+ Closes the tooltip bound to this layer if it is open.
+
+
+
+ toggleTooltip ()
+ this
+ Opens or closes the tooltip bound to this layer depending on its current state.
+
+
+
+ isTooltipOpen ()
+ boolean
+ Returns true if the tooltip bound to this layer is currently open.
+
+
+
+ setTooltipContent (<String|HTMLElement|Tooltip> content )
+ this
+ Sets the content of the tooltip bound to this layer.
+
+
+
+ getTooltip ()
+ Tooltip
+ Returns the tooltip bound to this layer.
+
+
+
+
+
+
+
+
+
+
▶ Methods inherited from Evented
+
+
+
+
+
+
+
+
+ Method
+ Returns
+ Description
+
+
+
+ on (<String> type , <Function> fn , <Object> context? )
+ this
+ Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
+
+
+
+ on (<Object> eventMap )
+ this
+ Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+
+
+
+ off (<String> type , <Function> fn? , <Object> context? )
+ this
+ Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
+
+
+
+ off (<Object> eventMap )
+ this
+ Removes a set of type/listener pairs.
+
+
+
+ off ()
+ this
+ Removes all listeners to all events on the object. This includes implicitly attached events.
+
+
+
+ fire (<String> type , <Object> data? , <Boolean> propagate? )
+ this
+ Fires an event of the specified type. You can optionally provide an data
+object — the first argument of the listener function will contain its
+properties. The event can optionally be propagated to event parents.
+
+
+
+ listens (<String> type )
+ Boolean
+ Returns true if a particular event type has any listeners attached to it.
+
+
+
+ once (… )
+ this
+ Behaves as on(…) , except the listener will only get fired once and then removed.
+
+
+
+ addEventParent (<Evented > obj )
+ this
+ Adds an event parent - an Evented that will receive propagated events
+
+
+
+ removeEventParent (<Evented > obj )
+ this
+ Removes an event parent, so it will stop receiving propagated events
+
+
+
+ addEventListener (… )
+ this
+ Alias to on(…)
+
+
+
+ removeEventListener (… )
+ this
+ Alias to off(…)
+
+
+
+ clearAllEventListeners (… )
+ this
+ Alias to off()
+
+
+
+ addOneTimeEventListener (… )
+ this
+ Alias to once(…)
+
+
+
+ fireEvent (… )
+ this
+ Alias to fire(…)
+
+
+
+ hasEventListeners (… )
+ Boolean
+ Alias to listens(…)
+
+
+
+
+
+
+
+
+ Global Switches Global switches are created for rare cases and generally make
+Leaflet to not detect a particular browser feature even if it's
+there. You need to set the switch as a global variable to true
+before including Leaflet on the page, like this:
+
<script>L_NO_TOUCH = true;</script>
+<script src="leaflet.js"></script>
+
+
+
+
+Switch
+Description
+
+
+
+
+L_NO_TOUCH
+Forces Leaflet to not use touch events even if it detects them.
+
+
+L_DISABLE_3D
+Forces Leaflet to not use hardware-accelerated CSS 3D transforms for positioning (which may cause glitches in some rare environments) even if they're supported.
+
+
+
+
+
noConflict This method restores the L global variable to the original value
+it had before Leaflet inclusion, and returns the real Leaflet
+namespace so you can put it elsewhere, like this:
+
<script src='libs/l.js'>
+<!-- L points to some other library -->
+<script src='leaflet.js'>
+<!-- you include Leaflet, it replaces the L variable to Leaflet namespace -->
+<script>
+var Leaflet = L.noConflict();
+// now L points to that other library again, and you can use Leaflet.Map etc.
+</script>
+
+
+
version A constant that represents the Leaflet version in use.
+
L.version; // contains "1.0.0" (or whatever version is currently in use)
+
+
+
+
+
+
+
+
+
+
+
+