mirror of
https://github.com/netzmacht/contao-leaflet-libraries.git
synced 2025-11-29 19:43:49 +01:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21fd7c8bd3 | ||
|
|
df8851fc8b | ||
|
|
5ca0430872 | ||
|
|
e985eb6cba | ||
|
|
6203fdc45d | ||
|
|
383bff4d6d |
23
README.md
23
README.md
@@ -12,11 +12,11 @@ Contao CMS.
|
|||||||
|
|
||||||
This package contains following packages:
|
This package contains following packages:
|
||||||
|
|
||||||
- [leaflet 1.0.2](http://leafletjs.com)
|
- [leaflet 1.0.3](http://leafletjs.com)
|
||||||
- [Leaflet-providers 1.1.15](http://leaflet-extras.github.io/leaflet-providers)
|
- [Leaflet-providers 1.1.15](http://leaflet-extras.github.io/leaflet-providers)
|
||||||
- [Leaflet.markercluster 1.0.0](https://github.com/Leaflet/Leaflet.markercluster)
|
- [Leaflet.markercluster 1.0.2](https://github.com/Leaflet/Leaflet.markercluster)
|
||||||
- [Leaflet-omnivore 0.3.4](https://github.com/mapbox/leaflet-omnivore)
|
- [Leaflet-omnivore 0.3.4](https://github.com/mapbox/leaflet-omnivore)
|
||||||
- [Leaflet.loading 0.1.23](https://github.com/ebrelsford/Leaflet.loading)
|
- [Leaflet.loading 0.1.24](https://github.com/ebrelsford/Leaflet.loading)
|
||||||
- [Leaflet.Control.FullScreen 1.4.2](https://github.com/brunob/leaflet.fullscreen)
|
- [Leaflet.Control.FullScreen 1.4.2](https://github.com/brunob/leaflet.fullscreen)
|
||||||
- [Leaflet Control Geocoder 1.5.4](https://github.com/perliedman/leaflet-control-geocoder)
|
- [Leaflet Control Geocoder 1.5.4](https://github.com/perliedman/leaflet-control-geocoder)
|
||||||
- [Leaflet.ExtraMarkers 1.0.6](https://github.com/coryasilva/Leaflet.ExtraMarkers)
|
- [Leaflet.ExtraMarkers 1.0.6](https://github.com/coryasilva/Leaflet.ExtraMarkers)
|
||||||
@@ -33,9 +33,20 @@ You can install this package via composer.
|
|||||||
$ php composer.phar require netzmacht/contao-leaflet-libraries:~1.0
|
$ php composer.phar require netzmacht/contao-leaflet-libraries:~1.0
|
||||||
```
|
```
|
||||||
|
|
||||||
When releasing the first stable version of
|
If you use Contao 4 without the managed edition, you also have to register the module as a bundle.
|
||||||
[netzmacht/contao-leaflet-maps](https://github.com/netzmacht/contao-leaflet-maps) the version number gonna be the same
|
|
||||||
as the included leaflet library.
|
```php
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// Dependency is automatically installed and has to be registered
|
||||||
|
new Contao\CoreBundle\HttpKernel\Bundle\ContaoModuleBundle('leaflet-libs', $this->getRootDir()),
|
||||||
|
```
|
||||||
|
|
||||||
|
Version numbers
|
||||||
|
---------------
|
||||||
|
|
||||||
|
Each release has is tagged with the main leaflet version which is shipped with this bundle. For any bugfix release which
|
||||||
|
is created without shipping a newer version of leaflet, this package uses four parts of the version number.
|
||||||
|
|
||||||
License
|
License
|
||||||
-------
|
-------
|
||||||
|
|||||||
@@ -18,3 +18,4 @@ Your pull requests are very welcome! Please follow these guidelines:
|
|||||||
* [kcwu](https://github.com/kcwu)
|
* [kcwu](https://github.com/kcwu)
|
||||||
* [Robbie Trencheny](https://github.com/robbiet480)
|
* [Robbie Trencheny](https://github.com/robbiet480)
|
||||||
* [David Molineus](https://github.com/dmolineus)
|
* [David Molineus](https://github.com/dmolineus)
|
||||||
|
* [Marwen Arfa](https://github.com/arfa)
|
||||||
|
|||||||
@@ -5,14 +5,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-control-loading,
|
.leaflet-control-loading,
|
||||||
.leaflet-control-zoom a.leaflet-control-loading ,
|
.leaflet-control-zoom a.leaflet-control-loading,
|
||||||
.leaflet-control-zoomslider a.leaflet-control-loading {
|
.leaflet-control-zoomslider a.leaflet-control-loading,
|
||||||
|
.leaflet-control-layer-container {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-control-loading.is-loading,
|
.leaflet-control-loading.is-loading,
|
||||||
.leaflet-control-zoom a.leaflet-control-loading.is-loading,
|
.leaflet-control-zoom a.leaflet-control-loading.is-loading,
|
||||||
.leaflet-control-zoomslider a.leaflet-control-loading.is-loading {
|
.leaflet-control-zoomslider a.leaflet-control-loading.is-loading,
|
||||||
|
.leaflet-control-layer-container.is-loading {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -71,8 +71,9 @@
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Otherwise, create a container for the indicator
|
// Otherwise, create a container for the indicator
|
||||||
container = L.DomUtil.create('div', 'leaflet-control-zoom leaflet-bar');
|
container = L.DomUtil.create('div', 'leaflet-control-zoom leaflet-control-layer-container leaflet-bar');
|
||||||
}
|
}
|
||||||
|
this._indicatorContainer = container;
|
||||||
this._indicator = L.DomUtil.create('a', classes, container);
|
this._indicator = L.DomUtil.create('a', classes, container);
|
||||||
if (this.options.spinjs) {
|
if (this.options.spinjs) {
|
||||||
this._spinner = new Spinner(this.options.spin).spin();
|
this._spinner = new Spinner(this.options.spin).spin();
|
||||||
@@ -156,6 +157,7 @@
|
|||||||
_showIndicator: function() {
|
_showIndicator: function() {
|
||||||
// Show loading indicator
|
// Show loading indicator
|
||||||
L.DomUtil.addClass(this._indicator, 'is-loading');
|
L.DomUtil.addClass(this._indicator, 'is-loading');
|
||||||
|
L.DomUtil.addClass(this._indicatorContainer, 'is-loading');
|
||||||
|
|
||||||
// If zoomControl exists, make the zoom-out button not last
|
// If zoomControl exists, make the zoom-out button not last
|
||||||
if (!this.options.separate) {
|
if (!this.options.separate) {
|
||||||
@@ -171,6 +173,7 @@
|
|||||||
_hideIndicator: function() {
|
_hideIndicator: function() {
|
||||||
// Hide loading indicator
|
// Hide loading indicator
|
||||||
L.DomUtil.removeClass(this._indicator, 'is-loading');
|
L.DomUtil.removeClass(this._indicator, 'is-loading');
|
||||||
|
L.DomUtil.removeClass(this._indicatorContainer, 'is-loading');
|
||||||
|
|
||||||
// If zoomControl exists, make the zoom-out button last
|
// If zoomControl exists, make the zoom-out button last
|
||||||
if (!this.options.separate) {
|
if (!this.options.separate) {
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
.leaflet-control-loading:empty{background-image:url('data:image/gif;base64,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');background-repeat:no-repeat}.leaflet-control-loading,.leaflet-control-zoom a.leaflet-control-loading,.leaflet-control-zoomslider a.leaflet-control-loading{display:none}.leaflet-control-loading.is-loading,.leaflet-control-zoom a.leaflet-control-loading.is-loading,.leaflet-control-zoomslider a.leaflet-control-loading.is-loading{display:block}.leaflet-bar-part-bottom{border-bottom:medium none;border-bottom-left-radius:4px;border-bottom-right-radius:4px}
|
.leaflet-control-loading:empty{background-image:url('data:image/gif;base64,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');background-repeat:no-repeat}.leaflet-control-layer-container,.leaflet-control-loading,.leaflet-control-zoom a.leaflet-control-loading,.leaflet-control-zoomslider a.leaflet-control-loading{display:none}.leaflet-control-layer-container.is-loading,.leaflet-control-loading.is-loading,.leaflet-control-zoom a.leaflet-control-loading.is-loading,.leaflet-control-zoomslider a.leaflet-control-loading.is-loading{display:block}.leaflet-bar-part-bottom{border-bottom:medium none;border-bottom-left-radius:4px;border-bottom-right-radius:4px}
|
||||||
File diff suppressed because one or more lines are too long
@@ -11,7 +11,10 @@ spinner (image-less).
|
|||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Leaflet.loading is only tested on Leaflet version 0.6 or greater. It will almost
|
Leaflet.loading is only tested on Leaflet version 0.6 or greater. It will almost
|
||||||
certainly not work with older versions of Leaflet.
|
certainly not work with older versions of Leaflet. Of course we intend to
|
||||||
|
support Leaflet 1.0, and we have tested against the latest release (beta 2).
|
||||||
|
Please create an issue if you find that any part of this project is not
|
||||||
|
compatible with Leaflet 1.0.
|
||||||
|
|
||||||
Include `Control.Loading.js` and `Control.Loading.css`, then create a map with
|
Include `Control.Loading.js` and `Control.Loading.css`, then create a map with
|
||||||
`loadingControl: true` in its options.
|
`loadingControl: true` in its options.
|
||||||
@@ -31,10 +34,11 @@ Once the above is complete you will have a loading indicator that only appears
|
|||||||
when tiles are loading.
|
when tiles are loading.
|
||||||
|
|
||||||
If you want to show the loading indicator while other AJAX requests or something
|
If you want to show the loading indicator while other AJAX requests or something
|
||||||
else is occurring, simply fire the `dataloading` event on your map when you
|
else is occurring, fire the `dataloading` event on your map when you begin
|
||||||
begin loading and `dataload` when you are finished loading. The control tracks
|
loading and `dataload` when you are finished loading. Please note that there is
|
||||||
the number of concurrent loaders, so it is your responsibility to ensure that
|
[an issue](https://github.com/ebrelsford/Leaflet.loading/issues/26) with the
|
||||||
the `dataloading` and `dataload` are called symmetrically.
|
way this control tracks these events and that this will be re-worked in a
|
||||||
|
future version.
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
@@ -45,6 +49,8 @@ the `dataloading` and `dataload` are called symmetrically.
|
|||||||
- **zoomControl**: (L.Control.Zoom) The zoom control that the control should be
|
- **zoomControl**: (L.Control.Zoom) The zoom control that the control should be
|
||||||
added to. This is only necessary when adding a loading control to a zoom
|
added to. This is only necessary when adding a loading control to a zoom
|
||||||
control that you added manually and do not want a separate loading control.
|
control that you added manually and do not want a separate loading control.
|
||||||
|
- **delayIndicator**: (float) The number of milliseconds to wait before
|
||||||
|
showing the loading indicator. Defaults to `null` (no delay).
|
||||||
- **spinjs**: (boolean) Enable the use of [spin.js][]. Optional, defaults to
|
- **spinjs**: (boolean) Enable the use of [spin.js][]. Optional, defaults to
|
||||||
`false`
|
`false`
|
||||||
- **spin**: (object) A [spin.js][] options object. Optional, defaults to
|
- **spin**: (object) A [spin.js][] options object. Optional, defaults to
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
{
|
{
|
||||||
"name": "leaflet.loading",
|
"name": "leaflet.loading",
|
||||||
"version": "0.1.16",
|
"version": "0.1.24",
|
||||||
"homepage": "https://github.com/ebrelsford/leaflet.loading",
|
"homepage": "https://github.com/ebrelsford/leaflet.loading",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Eric Brelsford <ebrelsford@gmail.com>"
|
"Eric Brelsford <ebrelsford@gmail.com>"
|
||||||
],
|
],
|
||||||
"description": "A loading-indicator control for Leaflet",
|
"description": "A loading-indicator control for Leaflet",
|
||||||
"main": "src/Control.Loading.js",
|
"main": [
|
||||||
|
"src/Control.Loading.css",
|
||||||
|
"src/Control.Loading.js"
|
||||||
|
],
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"leaflet",
|
"leaflet",
|
||||||
"map",
|
"map",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "leaflet-loading",
|
"name": "leaflet-loading",
|
||||||
"version": "0.1.16",
|
"version": "0.1.24",
|
||||||
"description": "A simple loading control for Leaflet",
|
"description": "A simple loading control for Leaflet",
|
||||||
"main": "src/Control.Loading.js",
|
"main": "src/Control.Loading.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -3,7 +3,80 @@ Leaflet.markercluster
|
|||||||
|
|
||||||
(all changes without author notice are by [@danzel](https://github.com/danzel))
|
(all changes without author notice are by [@danzel](https://github.com/danzel))
|
||||||
|
|
||||||
## Master
|
## 1.0.2 (2016-01-27)
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
* Support `layeradd` and `layerremove` events [#647](https://github.com/Leaflet/Leaflet.markercluster/issues/647)
|
||||||
|
|
||||||
|
### Bugfixes
|
||||||
|
|
||||||
|
* Add support for maps with negative minZoom [#704](https://github.com/Leaflet/Leaflet.markercluster/issues/704)
|
||||||
|
* Fixed zoomToShowLayer() markers disappearing bug (by [@z3ut](https://github.com/z3ut)) [#739](https://github.com/Leaflet/Leaflet.markercluster/issues/739)
|
||||||
|
* Fix an issue when opening a popup inside of zoomToShowLayer
|
||||||
|
* If a marker is moved with an open popup on it, re-open the popup after moving it. [#651](https://github.com/Leaflet/Leaflet.markercluster/issues/651)
|
||||||
|
|
||||||
|
|
||||||
|
## 1.0.1 (2016-01-25)
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
* Add install and build steps with jake (by [@kazes](https://github.com/kazes)) [#733](https://github.com/Leaflet/Leaflet.markercluster/pull/733)
|
||||||
|
* Readme improvements (by [@ghybs](https://github.com/ghybs), [@bertyhell](https://github.com/bertyhell)) [#734](https://github.com/Leaflet/Leaflet.markercluster/pull/738), [#734](https://github.com/Leaflet/Leaflet.markercluster/pull/738
|
||||||
|
* Bump all examples to leaflet 1.0.3
|
||||||
|
|
||||||
|
### Bugfixes
|
||||||
|
|
||||||
|
* Fixed leaflet 1.0.2 bug where clearLayers would throw an exception (by [@marcianoviereck92](https://github.com/marcianoviereck92)) [#746](https://github.com/Leaflet/Leaflet.markercluster/pull/746)
|
||||||
|
|
||||||
|
|
||||||
|
## 1.0.0 (2016-10-03)
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
* Compatibility with Leaflet 1.0.0 (by [@danzel](https://githum.com/danzel), [@Eschon](https://github.com/Eschon), [@ghybs](https://github.com/ghybs), [@IvanSanchez](https://github.com/IvanSanchez))
|
||||||
|
* Support moving markers [#57](https://github.com/Leaflet/Leaflet.markercluster/issues/57)
|
||||||
|
* chunkedLoading option to keep browser more responsive during larging a load data set [#292](https://github.com/Leaflet/Leaflet.markercluster/issues/292)
|
||||||
|
* maxClusterRadius can be a function (by [@Schwanksta](https://github.com/Schwanksta)) [#298](https://github.com/Leaflet/Leaflet.markercluster/issues/298)
|
||||||
|
* Spiderfy without zooming when all markers at same location (by [@rdenniston](https://github.com/rdenniston), [@ghybs](https://github.com/ghybs)) [#415](https://github.com/Leaflet/Leaflet.markercluster/issues/415), [#606](https://github.com/Leaflet/Leaflet.markercluster/issues/606)
|
||||||
|
* On becoming visible, markers retain their original opacity. (by [@IvanSanchez](https://github.com/IvanSanchez)) [#444](https://github.com/Leaflet/Leaflet.markercluster/issues/444)
|
||||||
|
* Spiderleg Polyline options (by [@mikeatlas](https://github.com/mikeatlas)) [#466](https://github.com/Leaflet/Leaflet.markercluster/issues/466)
|
||||||
|
* Extra methods to allow refreshing cluster icons (by [@ghybs](https://github.com/ghybs)) [#564](https://github.com/Leaflet/Leaflet.markercluster/issues/564)
|
||||||
|
* Ability to disable animations (by [@ghybs](https://github.com/ghybs)) [#578](https://github.com/Leaflet/Leaflet.markercluster/issues/578)
|
||||||
|
* Optimized performance of bulk addLayers and removeLayers (by [@ghybs](https://github.com/ghybs)) [#584](https://github.com/Leaflet/Leaflet.markercluster/issues/584)
|
||||||
|
* Replaced spiderfy legs animation from SMIL to CSS transition (by [@ghybs](https://github.com/ghybs)) [#585](https://github.com/Leaflet/Leaflet.markercluster/issues/585)
|
||||||
|
* Provide more detailed context information on the spiderfied event (by [@evanvosberg](https://github.com/evanvosberg)) [#421](https://github.com/Leaflet/Leaflet.markercluster/issues/421)
|
||||||
|
* Add unspiderfied event
|
||||||
|
* Readme updates (by [@ghybs](https://github.com/ghybs), [@tomchadwin](https://github.com/tomchadwin) [@Cyrille37](https://github.com/Cyrille37) [@franckl](https://github.com/franckl) [@mikeatlas](https://github.com/mikeatlas)
|
||||||
|
[@rdenniston](https://github.com/rdenniston) [@maackle](https://github.com/maackle) [@fureigh](https://github.com/fureigh) [@Wildhoney](https://github.com/Wildhoney) [@Schwanksta](https://github.com/Schwanksta) [@frankrowe](https://github.com/frankrowe))
|
||||||
|
* Improve adding and removing nested LayerGroups (by [@ghybs](https://github.com/ghybs)) [#624](https://github.com/Leaflet/Leaflet.markercluster/pull/624)
|
||||||
|
* Add public unspiderfy method (by [@zverev](https://github.com/zverev)) [#617](https://github.com/Leaflet/Leaflet.markercluster/pull/617)
|
||||||
|
* Optimized performance of bulk add with complex icon create function (by [@mlazowik](https://github.com/mlazowik)) [#697](https://github.com/Leaflet/Leaflet.markercluster/pull/697)
|
||||||
|
* Remove leaflet from peerDependencies (by [@tyleralves](https://github.com/tyleralves)) [#703](https://github.com/Leaflet/Leaflet.markercluster/pull/703)
|
||||||
|
* Simplified _recursively (by [@ghybs](https://github.com/ghybs)) [#656](https://github.com/Leaflet/Leaflet.markercluster/pull/656)
|
||||||
|
|
||||||
|
### Bugfixes
|
||||||
|
|
||||||
|
* Fix getBounds when removeOutsideVisibleBounds: false is set. [#321](https://github.com/Leaflet/Leaflet.markercluster/issues/321)
|
||||||
|
* Fix zoomToShowLayer fails after initial spiderfy [#286](https://github.com/Leaflet/Leaflet.markercluster/issues/286)
|
||||||
|
* Fix cluster not disappearing on Android [#344](https://github.com/Leaflet/Leaflet.markercluster/issues/344)
|
||||||
|
* Fix RemoveLayers() when spiderified (by [@Grsmto](https://github.com/Grsmto)) [#358](https://github.com/Leaflet/Leaflet.markercluster/issues/358)
|
||||||
|
* Remove lines from map when removing cluster (by [@olive380](https://github.com/olive380)) [#532](https://github.com/Leaflet/Leaflet.markercluster/issues/532)
|
||||||
|
* Fix getConvexHull when all markers are located at same latitude (by [@olive380](https://github.com/olive380)) [#533](https://github.com/Leaflet/Leaflet.markercluster/issues/533)
|
||||||
|
* Fix removeLayers when cluster is not on the map (by [@eschon](https://github.com/eschon)) [#556](https://github.com/Leaflet/Leaflet.markercluster/issues/556)
|
||||||
|
* Improved zoomToShowLayer with callback check (by [@ghybs](https://github.com/ghybs)) [#572](https://github.com/Leaflet/Leaflet.markercluster/issues/572)
|
||||||
|
* Improved reliability of RefreshSpec test suite for PhantomJS (by [@ghybs](https://github.com/ghybs)) [#577](https://github.com/Leaflet/Leaflet.markercluster/issues/577)
|
||||||
|
* Corrected effect of removeOutsideVisibleBounds option (by [@ghybs](https://github.com/ghybs)) [#575](https://github.com/Leaflet/Leaflet.markercluster/issues/575)
|
||||||
|
* Fix getLayer when provided a string [#531](https://github.com/Leaflet/Leaflet.markercluster/issues/531)
|
||||||
|
* Documentation improvements (by [@ghybs](https://github.com/ghybs)) [#579](https://github.com/Leaflet/Leaflet.markercluster/issues/579)
|
||||||
|
* Correct _getExpandedVisibleBounds for Max Latitude (by [@ghybs](https://github.com/ghybs)) [#587](https://github.com/Leaflet/Leaflet.markercluster/issues/587)
|
||||||
|
* Correct unspiderfy vector (by [@ghybs](https://github.com/ghybs)) [#604](https://github.com/Leaflet/Leaflet.markercluster/issues/604)
|
||||||
|
* Remove "leaflet-cluster-anim" class on map remove while spiderfied (by [@ghybs](https://github.com/ghybs)) [#607](https://github.com/Leaflet/Leaflet.markercluster/issues/607)
|
||||||
|
* Fix disableClusteringAtZoom maxZoom troubles (by [@OriginalSin](https://github.com/OriginalSin)) [#609](https://github.com/Leaflet/Leaflet.markercluster/issues/609)
|
||||||
|
* Fix clusters not disappearing when they were near the edge on mobile (by [@ghybs](https://github.com/ghybs)) [#529](https://github.com/Leaflet/Leaflet.markercluster/issues/529)
|
||||||
|
* Remove leaflet from dependencies (by [@ghybs](https://github.com/ghybs)) [#639](https://github.com/Leaflet/Leaflet.markercluster/issues/639)
|
||||||
|
* Fix interaction between zoomOrSpiderfy and disableClusteringAtZoom (by [@ghybs](https://github.com/ghybs)) [#633](https://github.com/Leaflet/Leaflet.markercluster/issues/633) [#648](https://github.com/Leaflet/Leaflet.markercluster/issues/648)
|
||||||
|
|
||||||
|
|
||||||
##0.4 (2013-12-19)
|
##0.4 (2013-12-19)
|
||||||
|
|
||||||
@@ -16,6 +89,7 @@ Leaflet.markercluster
|
|||||||
|
|
||||||
* Fix some cases zoomToShowLayer wouldn't work (Reported by [@absemetov](https://github.com/absemetov)) [#203](https://github.com/Leaflet/Leaflet.markercluster/issues/203) [#228](https://github.com/Leaflet/Leaflet.markercluster/issues/228) [#286](https://github.com/Leaflet/Leaflet.markercluster/issues/286)
|
* Fix some cases zoomToShowLayer wouldn't work (Reported by [@absemetov](https://github.com/absemetov)) [#203](https://github.com/Leaflet/Leaflet.markercluster/issues/203) [#228](https://github.com/Leaflet/Leaflet.markercluster/issues/228) [#286](https://github.com/Leaflet/Leaflet.markercluster/issues/286)
|
||||||
|
|
||||||
|
|
||||||
##0.3 (2013-12-18)
|
##0.3 (2013-12-18)
|
||||||
|
|
||||||
### Improvements
|
### Improvements
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ Provides Beautiful Animated Marker Clustering functionality for [Leaflet](http:/
|
|||||||
|
|
||||||
*Requires Leaflet 1.0.0*
|
*Requires Leaflet 1.0.0*
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
For a Leaflet 0.7 compatible version, [use the leaflet-0.7 branch](https://github.com/Leaflet/Leaflet.markercluster/tree/leaflet-0.7)<br>
|
For a Leaflet 0.7 compatible version, [use the leaflet-0.7 branch](https://github.com/Leaflet/Leaflet.markercluster/tree/leaflet-0.7)<br>
|
||||||
For a Leaflet 0.5 compatible version, [Download b128e950](https://github.com/Leaflet/Leaflet.markercluster/archive/b128e950d8f5d7da5b60bd0aa9a88f6d3dd17c98.zip)<br>
|
For a Leaflet 0.5 compatible version, [Download b128e950](https://github.com/Leaflet/Leaflet.markercluster/archive/b128e950d8f5d7da5b60bd0aa9a88f6d3dd17c98.zip)<br>
|
||||||
For a Leaflet 0.4 compatible version, [Download the 0.2 release](https://github.com/Leaflet/Leaflet.markercluster/archive/0.2.zip)
|
For a Leaflet 0.4 compatible version, [Download the 0.2 release](https://github.com/Leaflet/Leaflet.markercluster/archive/0.2.zip)
|
||||||
@@ -16,6 +18,8 @@ removed link to h1 and indented back 2 spaces all links.
|
|||||||
-->
|
-->
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
* [Using the plugin](#using-the-plugin)
|
* [Using the plugin](#using-the-plugin)
|
||||||
|
* [Building, testing and linting scripts](#building-testing-and-linting-scripts)
|
||||||
|
* [Examples](#examples)
|
||||||
* [Usage](#usage)
|
* [Usage](#usage)
|
||||||
* [Options](#options)
|
* [Options](#options)
|
||||||
* [Defaults](#defaults)
|
* [Defaults](#defaults)
|
||||||
@@ -43,9 +47,23 @@ removed link to h1 and indented back 2 spaces all links.
|
|||||||
|
|
||||||
|
|
||||||
## Using the plugin
|
## Using the plugin
|
||||||
|
Include the plugin CSS and JS files on your page after Leaflet files, using your method of choice:
|
||||||
|
* [Download the `v1.0.0` release](https://github.com/Leaflet/Leaflet.markercluster/archive/v1.0.0.zip)
|
||||||
|
* Use unpkg CDN: `https://unpkg.com/leaflet.markercluster@1.0.0/dist/`
|
||||||
|
* Install with npm: `npm install leaflet.markercluster`
|
||||||
|
|
||||||
Install with npm: `npm install leaflet.markercluster`
|
In each case, use files in the `dist` folder:
|
||||||
|
* `MarkerCluster.css`
|
||||||
|
* `MarkerCluster.Default.css` (not needed if you use your own `iconCreateFunction` instead of the default one)
|
||||||
|
* `leaflet.markercluster.js` (or `leaflet.markercluster-src.js` for the non-minified version)
|
||||||
|
|
||||||
|
### Building, testing and linting scripts
|
||||||
|
Install jake `npm install -g jake` then run `npm install`
|
||||||
|
* To check the code for errors and build Leaflet from source, run `jake`.
|
||||||
|
* To run the tests, run `jake test`.
|
||||||
|
* For a custom build, open `build/build.html` in the browser and follow the instructions
|
||||||
|
|
||||||
|
### Examples
|
||||||
See the included examples for usage.
|
See the included examples for usage.
|
||||||
|
|
||||||
The [realworld example](http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.388.html) is a good place to start, it uses all of the defaults of the clusterer.
|
The [realworld example](http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.388.html) is a good place to start, it uses all of the defaults of the clusterer.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "leaflet.markercluster",
|
"name": "leaflet.markercluster",
|
||||||
"version": "0.4.0-hotfix.1",
|
"version": "1.0.2",
|
||||||
"homepage": "https://github.com/Leaflet/Leaflet.markercluster",
|
"homepage": "https://github.com/Leaflet/Leaflet.markercluster",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Dave Leaver <danzel@localhost.geek.nz>"
|
"Dave Leaver <danzel@localhost.geek.nz>"
|
||||||
@@ -22,6 +22,6 @@
|
|||||||
"tests"
|
"tests"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"leaflet": ">= 0.7.0"
|
"leaflet": ">= 1.0.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -69,6 +69,12 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
|
|
||||||
this._queue = [];
|
this._queue = [];
|
||||||
|
|
||||||
|
this._childMarkerEventHandlers = {
|
||||||
|
'dragstart': this._childMarkerDragStart,
|
||||||
|
'move': this._childMarkerMoved,
|
||||||
|
'dragend': this._childMarkerDragEnd,
|
||||||
|
};
|
||||||
|
|
||||||
// Hook the appropriate animation methods.
|
// Hook the appropriate animation methods.
|
||||||
var animate = L.DomUtil.TRANSITION && this.options.animate;
|
var animate = L.DomUtil.TRANSITION && this.options.animate;
|
||||||
L.extend(this, animate ? this._withAnimation : this._noAnimation);
|
L.extend(this, animate ? this._withAnimation : this._noAnimation);
|
||||||
@@ -85,11 +91,13 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
//Don't cluster non point data
|
//Don't cluster non point data
|
||||||
if (!layer.getLatLng) {
|
if (!layer.getLatLng) {
|
||||||
this._nonPointGroup.addLayer(layer);
|
this._nonPointGroup.addLayer(layer);
|
||||||
|
this.fire('layeradd', { layer: layer });
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this._map) {
|
if (!this._map) {
|
||||||
this._needsClustering.push(layer);
|
this._needsClustering.push(layer);
|
||||||
|
this.fire('layeradd', { layer: layer });
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,6 +113,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
}
|
}
|
||||||
|
|
||||||
this._addLayer(layer, this._maxZoom);
|
this._addLayer(layer, this._maxZoom);
|
||||||
|
this.fire('layeradd', { layer: layer });
|
||||||
|
|
||||||
// Refresh bounds and weighted positions.
|
// Refresh bounds and weighted positions.
|
||||||
this._topClusterLevel._recalculateBounds();
|
this._topClusterLevel._recalculateBounds();
|
||||||
@@ -139,6 +148,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
//Non point layers
|
//Non point layers
|
||||||
if (!layer.getLatLng) {
|
if (!layer.getLatLng) {
|
||||||
this._nonPointGroup.removeLayer(layer);
|
this._nonPointGroup.removeLayer(layer);
|
||||||
|
this.fire('layerremove', { layer: layer });
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,6 +156,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
if (!this._arraySplice(this._needsClustering, layer) && this.hasLayer(layer)) {
|
if (!this._arraySplice(this._needsClustering, layer) && this.hasLayer(layer)) {
|
||||||
this._needsRemoving.push(layer);
|
this._needsRemoving.push(layer);
|
||||||
}
|
}
|
||||||
|
this.fire('layerremove', { layer: layer });
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,13 +171,14 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
|
|
||||||
//Remove the marker from clusters
|
//Remove the marker from clusters
|
||||||
this._removeLayer(layer, true);
|
this._removeLayer(layer, true);
|
||||||
|
this.fire('layerremove', { layer: layer });
|
||||||
|
|
||||||
// Refresh bounds and weighted positions.
|
// Refresh bounds and weighted positions.
|
||||||
this._topClusterLevel._recalculateBounds();
|
this._topClusterLevel._recalculateBounds();
|
||||||
|
|
||||||
this._refreshClustersIcons();
|
this._refreshClustersIcons();
|
||||||
|
|
||||||
layer.off('move', this._childMarkerMoved, this);
|
layer.off(this._childMarkerEventHandlers, this);
|
||||||
|
|
||||||
if (this._featureGroup.hasLayer(layer)) {
|
if (this._featureGroup.hasLayer(layer)) {
|
||||||
this._featureGroup.removeLayer(layer);
|
this._featureGroup.removeLayer(layer);
|
||||||
@@ -179,7 +191,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
//Takes an array of markers and adds them in bulk
|
//Takes an array of markers and adds them in bulk
|
||||||
addLayers: function (layersArray) {
|
addLayers: function (layersArray, skipLayerAddEvent) {
|
||||||
if (!L.Util.isArray(layersArray)) {
|
if (!L.Util.isArray(layersArray)) {
|
||||||
return this.addLayer(layersArray);
|
return this.addLayer(layersArray);
|
||||||
}
|
}
|
||||||
@@ -228,6 +240,9 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
//Not point data, can't be clustered
|
//Not point data, can't be clustered
|
||||||
if (!m.getLatLng) {
|
if (!m.getLatLng) {
|
||||||
npg.addLayer(m);
|
npg.addLayer(m);
|
||||||
|
if (!skipLayerAddEvent) {
|
||||||
|
this.fire('layeradd', { layer: m });
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,6 +251,9 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
}
|
}
|
||||||
|
|
||||||
this._addLayer(m, this._maxZoom);
|
this._addLayer(m, this._maxZoom);
|
||||||
|
if (!skipLayerAddEvent) {
|
||||||
|
this.fire('layeradd', { layer: m });
|
||||||
|
}
|
||||||
|
|
||||||
//If we just made a cluster of size 2 then we need to remove the other marker from the map (if it is) or we never will
|
//If we just made a cluster of size 2 then we need to remove the other marker from the map (if it is) or we never will
|
||||||
if (m.__parent) {
|
if (m.__parent) {
|
||||||
@@ -328,6 +346,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
if (this.hasLayer(m)) {
|
if (this.hasLayer(m)) {
|
||||||
this._needsRemoving.push(m);
|
this._needsRemoving.push(m);
|
||||||
}
|
}
|
||||||
|
this.fire('layerremove', { layer: m });
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -368,10 +387,12 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
|
|
||||||
if (!m.__parent) {
|
if (!m.__parent) {
|
||||||
npg.removeLayer(m);
|
npg.removeLayer(m);
|
||||||
|
this.fire('layerremove', { layer: m });
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._removeLayer(m, true, true);
|
this._removeLayer(m, true, true);
|
||||||
|
this.fire('layerremove', { layer: m });
|
||||||
|
|
||||||
if (fg.hasLayer(m)) {
|
if (fg.hasLayer(m)) {
|
||||||
fg.removeLayer(m);
|
fg.removeLayer(m);
|
||||||
@@ -412,9 +433,9 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
this._nonPointGroup.clearLayers();
|
this._nonPointGroup.clearLayers();
|
||||||
|
|
||||||
this.eachLayer(function (marker) {
|
this.eachLayer(function (marker) {
|
||||||
marker.off('move', this._childMarkerMoved, this);
|
marker.off(this._childMarkerEventHandlers, this);
|
||||||
delete marker.__parent;
|
delete marker.__parent;
|
||||||
});
|
}, this);
|
||||||
|
|
||||||
if (this._map) {
|
if (this._map) {
|
||||||
//Reset _topClusterLevel and the DistanceGrids
|
//Reset _topClusterLevel and the DistanceGrids
|
||||||
@@ -537,20 +558,9 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
this._map.on('moveend', showMarker, this);
|
this._map.on('moveend', showMarker, this);
|
||||||
this._map.panTo(layer.getLatLng());
|
this._map.panTo(layer.getLatLng());
|
||||||
} else {
|
} else {
|
||||||
var moveStart = function () {
|
|
||||||
this._map.off('movestart', moveStart, this);
|
|
||||||
moveStart = null;
|
|
||||||
};
|
|
||||||
|
|
||||||
this._map.on('movestart', moveStart, this);
|
|
||||||
this._map.on('moveend', showMarker, this);
|
this._map.on('moveend', showMarker, this);
|
||||||
this.on('animationend', showMarker, this);
|
this.on('animationend', showMarker, this);
|
||||||
layer.__parent.zoomToBounds();
|
layer.__parent.zoomToBounds();
|
||||||
|
|
||||||
if (moveStart) {
|
|
||||||
//Never started moving, must already be there, probably need clustering however
|
|
||||||
showMarker.call(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -594,7 +604,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
//Actually add our markers to the map:
|
//Actually add our markers to the map:
|
||||||
l = this._needsClustering;
|
l = this._needsClustering;
|
||||||
this._needsClustering = [];
|
this._needsClustering = [];
|
||||||
this.addLayers(l);
|
this.addLayers(l, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
//Overrides FeatureGroup.onRemove
|
//Overrides FeatureGroup.onRemove
|
||||||
@@ -649,32 +659,56 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
*/
|
*/
|
||||||
_removeFromGridUnclustered: function (marker, z) {
|
_removeFromGridUnclustered: function (marker, z) {
|
||||||
var map = this._map,
|
var map = this._map,
|
||||||
gridUnclustered = this._gridUnclustered;
|
gridUnclustered = this._gridUnclustered,
|
||||||
|
minZoom = this._map.getMinZoom();
|
||||||
|
|
||||||
for (; z >= 0; z--) {
|
for (; z >= minZoom; z--) {
|
||||||
if (!gridUnclustered[z].removeObject(marker, map.project(marker.getLatLng(), z))) {
|
if (!gridUnclustered[z].removeObject(marker, map.project(marker.getLatLng(), z))) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_childMarkerMoved: function (e) {
|
_childMarkerDragStart: function (e) {
|
||||||
if (!this._ignoreMove) {
|
e.target.__dragStart = e.target._latlng;
|
||||||
e.target._latlng = e.oldLatLng;
|
},
|
||||||
this.removeLayer(e.target);
|
|
||||||
|
|
||||||
e.target._latlng = e.latlng;
|
_childMarkerMoved: function (e) {
|
||||||
this.addLayer(e.target);
|
if (!this._ignoreMove && !e.target.__dragStart) {
|
||||||
|
var isPopupOpen = e.target._popup && e.target._popup.isOpen();
|
||||||
|
|
||||||
|
this._moveChild(e.target, e.oldLatLng, e.latlng);
|
||||||
|
|
||||||
|
if (isPopupOpen) {
|
||||||
|
e.target.openPopup();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_moveChild: function (layer, from, to) {
|
||||||
|
layer._latlng = from;
|
||||||
|
this.removeLayer(layer);
|
||||||
|
|
||||||
|
layer._latlng = to;
|
||||||
|
this.addLayer(layer);
|
||||||
|
},
|
||||||
|
|
||||||
|
_childMarkerDragEnd: function (e) {
|
||||||
|
if (e.target.__dragStart) {
|
||||||
|
this._moveChild(e.target, e.target.__dragStart, e.target._latlng);
|
||||||
|
}
|
||||||
|
delete e.target.__dragStart;
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
//Internal function for removing a marker from everything.
|
//Internal function for removing a marker from everything.
|
||||||
//dontUpdateMap: set to true if you will handle updating the map manually (for bulk functions)
|
//dontUpdateMap: set to true if you will handle updating the map manually (for bulk functions)
|
||||||
_removeLayer: function (marker, removeFromDistanceGrid, dontUpdateMap) {
|
_removeLayer: function (marker, removeFromDistanceGrid, dontUpdateMap) {
|
||||||
var gridClusters = this._gridClusters,
|
var gridClusters = this._gridClusters,
|
||||||
gridUnclustered = this._gridUnclustered,
|
gridUnclustered = this._gridUnclustered,
|
||||||
fg = this._featureGroup,
|
fg = this._featureGroup,
|
||||||
map = this._map;
|
map = this._map,
|
||||||
|
minZoom = this._map.getMinZoom();
|
||||||
|
|
||||||
//Remove the marker from distance clusters it might be in
|
//Remove the marker from distance clusters it might be in
|
||||||
if (removeFromDistanceGrid) {
|
if (removeFromDistanceGrid) {
|
||||||
@@ -693,7 +727,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
cluster._childCount--;
|
cluster._childCount--;
|
||||||
cluster._boundsNeedUpdate = true;
|
cluster._boundsNeedUpdate = true;
|
||||||
|
|
||||||
if (cluster._zoom < 0) {
|
if (cluster._zoom < minZoom) {
|
||||||
//Top level, do nothing
|
//Top level, do nothing
|
||||||
break;
|
break;
|
||||||
} else if (removeFromDistanceGrid && cluster._childCount <= 1) { //Cluster no longer required
|
} else if (removeFromDistanceGrid && cluster._childCount <= 1) { //Cluster no longer required
|
||||||
@@ -876,6 +910,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
|
|
||||||
_generateInitialClusters: function () {
|
_generateInitialClusters: function () {
|
||||||
var maxZoom = this._map.getMaxZoom(),
|
var maxZoom = this._map.getMaxZoom(),
|
||||||
|
minZoom = this._map.getMinZoom(),
|
||||||
radius = this.options.maxClusterRadius,
|
radius = this.options.maxClusterRadius,
|
||||||
radiusFn = radius;
|
radiusFn = radius;
|
||||||
|
|
||||||
@@ -894,29 +929,30 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
this._gridUnclustered = {};
|
this._gridUnclustered = {};
|
||||||
|
|
||||||
//Set up DistanceGrids for each zoom
|
//Set up DistanceGrids for each zoom
|
||||||
for (var zoom = maxZoom; zoom >= 0; zoom--) {
|
for (var zoom = maxZoom; zoom >= minZoom; zoom--) {
|
||||||
this._gridClusters[zoom] = new L.DistanceGrid(radiusFn(zoom));
|
this._gridClusters[zoom] = new L.DistanceGrid(radiusFn(zoom));
|
||||||
this._gridUnclustered[zoom] = new L.DistanceGrid(radiusFn(zoom));
|
this._gridUnclustered[zoom] = new L.DistanceGrid(radiusFn(zoom));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Instantiate the appropriate L.MarkerCluster class (animated or not).
|
// Instantiate the appropriate L.MarkerCluster class (animated or not).
|
||||||
this._topClusterLevel = new this._markerCluster(this, -1);
|
this._topClusterLevel = new this._markerCluster(this, minZoom - 1);
|
||||||
},
|
},
|
||||||
|
|
||||||
//Zoom: Zoom to start adding at (Pass this._maxZoom to start at the bottom)
|
//Zoom: Zoom to start adding at (Pass this._maxZoom to start at the bottom)
|
||||||
_addLayer: function (layer, zoom) {
|
_addLayer: function (layer, zoom) {
|
||||||
var gridClusters = this._gridClusters,
|
var gridClusters = this._gridClusters,
|
||||||
gridUnclustered = this._gridUnclustered,
|
gridUnclustered = this._gridUnclustered,
|
||||||
|
minZoom = this._map.getMinZoom(),
|
||||||
markerPoint, z;
|
markerPoint, z;
|
||||||
|
|
||||||
if (this.options.singleMarkerMode) {
|
if (this.options.singleMarkerMode) {
|
||||||
this._overrideMarkerIcon(layer);
|
this._overrideMarkerIcon(layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
layer.on('move', this._childMarkerMoved, this);
|
layer.on(this._childMarkerEventHandlers, this);
|
||||||
|
|
||||||
//Find the lowest zoom level to slot this one in
|
//Find the lowest zoom level to slot this one in
|
||||||
for (; zoom >= 0; zoom--) {
|
for (; zoom >= minZoom; zoom--) {
|
||||||
markerPoint = this._map.project(layer.getLatLng(), zoom); // calculate pixel position
|
markerPoint = this._map.project(layer.getLatLng(), zoom); // calculate pixel position
|
||||||
|
|
||||||
//Try find a cluster close by
|
//Try find a cluster close by
|
||||||
@@ -1157,12 +1193,13 @@ L.MarkerClusterGroup.include({
|
|||||||
_animationZoomIn: function (previousZoomLevel, newZoomLevel) {
|
_animationZoomIn: function (previousZoomLevel, newZoomLevel) {
|
||||||
var bounds = this._getExpandedVisibleBounds(),
|
var bounds = this._getExpandedVisibleBounds(),
|
||||||
fg = this._featureGroup,
|
fg = this._featureGroup,
|
||||||
|
minZoom = this._map.getMinZoom(),
|
||||||
i;
|
i;
|
||||||
|
|
||||||
this._ignoreMove = true;
|
this._ignoreMove = true;
|
||||||
|
|
||||||
//Add all children of current clusters to map and remove those clusters from map
|
//Add all children of current clusters to map and remove those clusters from map
|
||||||
this._topClusterLevel._recursively(bounds, previousZoomLevel, 0, function (c) {
|
this._topClusterLevel._recursively(bounds, previousZoomLevel, minZoom, function (c) {
|
||||||
var startPos = c._latlng,
|
var startPos = c._latlng,
|
||||||
markers = c._markers,
|
markers = c._markers,
|
||||||
m;
|
m;
|
||||||
@@ -1212,7 +1249,7 @@ L.MarkerClusterGroup.include({
|
|||||||
//Remove the old clusters and close the zoom animation
|
//Remove the old clusters and close the zoom animation
|
||||||
this._enqueue(function () {
|
this._enqueue(function () {
|
||||||
//update the positions of the just added clusters/markers
|
//update the positions of the just added clusters/markers
|
||||||
this._topClusterLevel._recursively(bounds, previousZoomLevel, 0, function (c) {
|
this._topClusterLevel._recursively(bounds, previousZoomLevel, minZoom, function (c) {
|
||||||
fg.removeLayer(c);
|
fg.removeLayer(c);
|
||||||
c.clusterShow();
|
c.clusterShow();
|
||||||
});
|
});
|
||||||
@@ -1264,7 +1301,8 @@ L.MarkerClusterGroup.include({
|
|||||||
|
|
||||||
// Private methods for animated versions.
|
// Private methods for animated versions.
|
||||||
_animationZoomOutSingle: function (cluster, previousZoomLevel, newZoomLevel) {
|
_animationZoomOutSingle: function (cluster, previousZoomLevel, newZoomLevel) {
|
||||||
var bounds = this._getExpandedVisibleBounds();
|
var bounds = this._getExpandedVisibleBounds(),
|
||||||
|
minZoom = this._map.getMinZoom();
|
||||||
|
|
||||||
//Animate all of the markers in the clusters to move to their cluster center point
|
//Animate all of the markers in the clusters to move to their cluster center point
|
||||||
cluster._recursivelyAnimateChildrenInAndAddSelfToMap(bounds, previousZoomLevel + 1, newZoomLevel);
|
cluster._recursivelyAnimateChildrenInAndAddSelfToMap(bounds, previousZoomLevel + 1, newZoomLevel);
|
||||||
@@ -1290,7 +1328,7 @@ L.MarkerClusterGroup.include({
|
|||||||
m.clusterShow();
|
m.clusterShow();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cluster._recursively(bounds, newZoomLevel, 0, function (c) {
|
cluster._recursively(bounds, newZoomLevel, minZoom, function (c) {
|
||||||
c._recursivelyRemoveChildrenFromMap(bounds, previousZoomLevel + 1);
|
c._recursivelyRemoveChildrenFromMap(bounds, previousZoomLevel + 1);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1536,7 +1574,7 @@ L.MarkerCluster = L.Marker.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_recursivelyAnimateChildrenIn: function (bounds, center, maxZoom) {
|
_recursivelyAnimateChildrenIn: function (bounds, center, maxZoom) {
|
||||||
this._recursively(bounds, 0, maxZoom - 1,
|
this._recursively(bounds, this._group._map.getMinZoom(), maxZoom - 1,
|
||||||
function (c) {
|
function (c) {
|
||||||
var markers = c._markers,
|
var markers = c._markers,
|
||||||
i, m;
|
i, m;
|
||||||
@@ -1565,7 +1603,7 @@ L.MarkerCluster = L.Marker.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_recursivelyAnimateChildrenInAndAddSelfToMap: function (bounds, previousZoomLevel, newZoomLevel) {
|
_recursivelyAnimateChildrenInAndAddSelfToMap: function (bounds, previousZoomLevel, newZoomLevel) {
|
||||||
this._recursively(bounds, newZoomLevel, 0,
|
this._recursively(bounds, newZoomLevel, this._group._map.getMinZoom(),
|
||||||
function (c) {
|
function (c) {
|
||||||
c._recursivelyAnimateChildrenIn(bounds, c._group._map.latLngToLayerPoint(c.getLatLng()).round(), previousZoomLevel);
|
c._recursivelyAnimateChildrenIn(bounds, c._group._map.latLngToLayerPoint(c.getLatLng()).round(), previousZoomLevel);
|
||||||
|
|
||||||
@@ -1584,13 +1622,13 @@ L.MarkerCluster = L.Marker.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_recursivelyBecomeVisible: function (bounds, zoomLevel) {
|
_recursivelyBecomeVisible: function (bounds, zoomLevel) {
|
||||||
this._recursively(bounds, 0, zoomLevel, null, function (c) {
|
this._recursively(bounds, this._group._map.getMinZoom(), zoomLevel, null, function (c) {
|
||||||
c.clusterShow();
|
c.clusterShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
_recursivelyAddChildrenToMap: function (startPos, zoomLevel, bounds) {
|
_recursivelyAddChildrenToMap: function (startPos, zoomLevel, bounds) {
|
||||||
this._recursively(bounds, -1, zoomLevel,
|
this._recursively(bounds, this._group._map.getMinZoom() - 1, zoomLevel,
|
||||||
function (c) {
|
function (c) {
|
||||||
if (zoomLevel === c._zoom) {
|
if (zoomLevel === c._zoom) {
|
||||||
return;
|
return;
|
||||||
@@ -1654,7 +1692,7 @@ L.MarkerCluster = L.Marker.extend({
|
|||||||
//exceptBounds: If set, don't remove any markers/clusters in it
|
//exceptBounds: If set, don't remove any markers/clusters in it
|
||||||
_recursivelyRemoveChildrenFromMap: function (previousBounds, zoomLevel, exceptBounds) {
|
_recursivelyRemoveChildrenFromMap: function (previousBounds, zoomLevel, exceptBounds) {
|
||||||
var m, i;
|
var m, i;
|
||||||
this._recursively(previousBounds, -1, zoomLevel - 1,
|
this._recursively(previousBounds, this._group._map.getMinZoom() - 1, zoomLevel - 1,
|
||||||
function (c) {
|
function (c) {
|
||||||
//Remove markers at every level
|
//Remove markers at every level
|
||||||
for (i = c._markers.length - 1; i >= 0; i--) {
|
for (i = c._markers.length - 1; i >= 0; i--) {
|
||||||
@@ -2336,6 +2374,9 @@ L.MarkerCluster.include({
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Close any popup on the marker first, otherwise setting the location of the marker will make the map scroll
|
||||||
|
m.closePopup();
|
||||||
|
|
||||||
//Fix up the location to the real one
|
//Fix up the location to the real one
|
||||||
m.setLatLng(m._preSpiderfyLatlng);
|
m.setLatLng(m._preSpiderfyLatlng);
|
||||||
delete m._preSpiderfyLatlng;
|
delete m._preSpiderfyLatlng;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "leaflet.markercluster",
|
"name": "leaflet.markercluster",
|
||||||
"repository": "https://github.com/Leaflet/Leaflet.markercluster",
|
"repository": "https://github.com/Leaflet/Leaflet.markercluster",
|
||||||
"version": "1.0.0",
|
"version": "1.0.2",
|
||||||
"description": "Provides Beautiful Animated Marker Clustering functionality for Leaflet",
|
"description": "Provides Beautiful Animated Marker Clustering functionality for Leaflet",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"jshint": "~2.1.3",
|
"jshint": "~2.1.3",
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
"uglify-js": "~2.3.6",
|
"uglify-js": "~2.3.6",
|
||||||
"jake": "~0.5.16",
|
"jake": "~0.5.16",
|
||||||
"magic-string": "^0.7.0",
|
"magic-string": "^0.7.0",
|
||||||
"leaflet": "~1.0.0-rc.1"
|
"leaflet": "~1.0.3"
|
||||||
},
|
},
|
||||||
"main": "dist/leaflet.markercluster.js",
|
"main": "dist/leaflet.markercluster.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
Leaflet 1.0.2+4bbb16c, a JS library for interactive maps. http://leafletjs.com
|
Leaflet 1.0.3+ed36a04, a JS library for interactive maps. http://leafletjs.com
|
||||||
(c) 2010-2016 Vladimir Agafonkin, (c) 2010-2011 CloudMade
|
(c) 2010-2016 Vladimir Agafonkin, (c) 2010-2011 CloudMade
|
||||||
*/
|
*/
|
||||||
(function (window, document, undefined) {
|
(function (window, document, undefined) {
|
||||||
var L = {
|
var L = {
|
||||||
version: "1.0.2+4bbb16c"
|
version: "1.0.3+ed36a04"
|
||||||
};
|
};
|
||||||
|
|
||||||
function expose() {
|
function expose() {
|
||||||
@@ -516,7 +516,6 @@ L.Evented = L.Class.extend({
|
|||||||
}
|
}
|
||||||
|
|
||||||
listeners.push(newListener);
|
listeners.push(newListener);
|
||||||
typeListeners.count++;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_off: function (type, fn, context) {
|
_off: function (type, fn, context) {
|
||||||
@@ -824,6 +823,9 @@ L.Mixin = {Events: proto};
|
|||||||
|
|
||||||
// @property touch: Boolean
|
// @property touch: Boolean
|
||||||
// `true` for all browsers supporting [touch events](https://developer.mozilla.org/docs/Web/API/Touch_events).
|
// `true` for all browsers supporting [touch events](https://developer.mozilla.org/docs/Web/API/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.
|
||||||
touch: !!touch,
|
touch: !!touch,
|
||||||
|
|
||||||
// @property msPointer: Boolean
|
// @property msPointer: Boolean
|
||||||
@@ -1662,7 +1664,7 @@ L.LatLng.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// @method toBounds(sizeInMeters: Number): LatLngBounds
|
// @method toBounds(sizeInMeters: Number): LatLngBounds
|
||||||
// Returns a new `LatLngBounds` object in which each boundary is `sizeInMeters` meters apart from the `LatLng`.
|
// Returns a new `LatLngBounds` object in which each boundary is `sizeInMeters/2` meters apart from the `LatLng`.
|
||||||
toBounds: function (sizeInMeters) {
|
toBounds: function (sizeInMeters) {
|
||||||
var latAccuracy = 180 * sizeInMeters / 40075017,
|
var latAccuracy = 180 * sizeInMeters / 40075017,
|
||||||
lngAccuracy = latAccuracy / Math.cos((Math.PI / 180) * this.lat);
|
lngAccuracy = latAccuracy / Math.cos((Math.PI / 180) * this.lat);
|
||||||
@@ -1869,7 +1871,7 @@ L.LatLngBounds.prototype = {
|
|||||||
// @method contains (latlng: LatLng): Boolean
|
// @method contains (latlng: LatLng): Boolean
|
||||||
// Returns `true` if the rectangle contains the given point.
|
// Returns `true` if the rectangle contains the given point.
|
||||||
contains: function (obj) { // (LatLngBounds) or (LatLng) -> Boolean
|
contains: function (obj) { // (LatLngBounds) or (LatLng) -> Boolean
|
||||||
if (typeof obj[0] === 'number' || obj instanceof L.LatLng) {
|
if (typeof obj[0] === 'number' || obj instanceof L.LatLng || 'lat' in obj) {
|
||||||
obj = L.latLng(obj);
|
obj = L.latLng(obj);
|
||||||
} else {
|
} else {
|
||||||
obj = L.latLngBounds(obj);
|
obj = L.latLngBounds(obj);
|
||||||
@@ -2132,12 +2134,35 @@ L.CRS = {
|
|||||||
// @method wrapLatLng(latlng: LatLng): LatLng
|
// @method wrapLatLng(latlng: LatLng): LatLng
|
||||||
// Returns a `LatLng` where lat and lng has been wrapped according to the
|
// 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.
|
// CRS's `wrapLat` and `wrapLng` properties, if they are outside the CRS's bounds.
|
||||||
|
// Only accepts actual `L.LatLng` instances, not arrays.
|
||||||
wrapLatLng: function (latlng) {
|
wrapLatLng: function (latlng) {
|
||||||
var lng = this.wrapLng ? L.Util.wrapNum(latlng.lng, this.wrapLng, true) : latlng.lng,
|
var lng = this.wrapLng ? L.Util.wrapNum(latlng.lng, this.wrapLng, true) : latlng.lng,
|
||||||
lat = this.wrapLat ? L.Util.wrapNum(latlng.lat, this.wrapLat, true) : latlng.lat,
|
lat = this.wrapLat ? L.Util.wrapNum(latlng.lat, this.wrapLat, true) : latlng.lat,
|
||||||
alt = latlng.alt;
|
alt = latlng.alt;
|
||||||
|
|
||||||
return L.latLng(lat, lng, alt);
|
return L.latLng(lat, lng, alt);
|
||||||
|
},
|
||||||
|
|
||||||
|
// @method wrapLatLngBounds(bounds: LatLngBounds): 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.
|
||||||
|
wrapLatLngBounds: function (bounds) {
|
||||||
|
var center = bounds.getCenter(),
|
||||||
|
newCenter = this.wrapLatLng(center),
|
||||||
|
latShift = center.lat - newCenter.lat,
|
||||||
|
lngShift = center.lng - newCenter.lng;
|
||||||
|
|
||||||
|
if (latShift === 0 && lngShift === 0) {
|
||||||
|
return bounds;
|
||||||
|
}
|
||||||
|
|
||||||
|
var sw = bounds.getSouthWest(),
|
||||||
|
ne = bounds.getNorthEast(),
|
||||||
|
newSw = L.latLng({lat: sw.lat - latShift, lng: sw.lng - lngShift}),
|
||||||
|
newNe = L.latLng({lat: ne.lat - latShift, lng: ne.lng - lngShift});
|
||||||
|
|
||||||
|
return new L.LatLngBounds(newSw, newNe);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -2305,7 +2330,7 @@ L.Map = L.Evented.extend({
|
|||||||
|
|
||||||
// @option maxBounds: LatLngBounds = null
|
// @option maxBounds: LatLngBounds = null
|
||||||
// When this option is set, the map restricts the view to the given
|
// When this option is set, the map restricts the view to the given
|
||||||
// geographical bounds, bouncing the user back when he tries to pan
|
// geographical bounds, bouncing the user back if the user tries to pan
|
||||||
// outside the view. To set the restriction dynamically, use
|
// outside the view. To set the restriction dynamically, use
|
||||||
// [`setMaxBounds`](#map-setmaxbounds) method.
|
// [`setMaxBounds`](#map-setmaxbounds) method.
|
||||||
maxBounds: undefined,
|
maxBounds: undefined,
|
||||||
@@ -2512,7 +2537,7 @@ L.Map = L.Evented.extend({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
// @method fitBounds(bounds: LatLngBounds, options: fitBounds options): this
|
// @method fitBounds(bounds: LatLngBounds, options?: fitBounds options): this
|
||||||
// Sets a map view that contains the given geographical bounds with the
|
// Sets a map view that contains the given geographical bounds with the
|
||||||
// maximum zoom level possible.
|
// maximum zoom level possible.
|
||||||
fitBounds: function (bounds, options) {
|
fitBounds: function (bounds, options) {
|
||||||
@@ -3041,7 +3066,7 @@ L.Map = L.Evented.extend({
|
|||||||
nw = bounds.getNorthWest(),
|
nw = bounds.getNorthWest(),
|
||||||
se = bounds.getSouthEast(),
|
se = bounds.getSouthEast(),
|
||||||
size = this.getSize().subtract(padding),
|
size = this.getSize().subtract(padding),
|
||||||
boundsSize = this.project(se, zoom).subtract(this.project(nw, zoom)),
|
boundsSize = L.bounds(this.project(se, zoom), this.project(nw, zoom)).getSize(),
|
||||||
snap = L.Browser.any3d ? this.options.zoomSnap : 1;
|
snap = L.Browser.any3d ? this.options.zoomSnap : 1;
|
||||||
|
|
||||||
var scale = Math.min(size.x / boundsSize.x, size.y / boundsSize.y);
|
var scale = Math.min(size.x / boundsSize.x, size.y / boundsSize.y);
|
||||||
@@ -3060,8 +3085,8 @@ L.Map = L.Evented.extend({
|
|||||||
getSize: function () {
|
getSize: function () {
|
||||||
if (!this._size || this._sizeChanged) {
|
if (!this._size || this._sizeChanged) {
|
||||||
this._size = new L.Point(
|
this._size = new L.Point(
|
||||||
this._container.clientWidth,
|
this._container.clientWidth || 0,
|
||||||
this._container.clientHeight);
|
this._container.clientHeight || 0);
|
||||||
|
|
||||||
this._sizeChanged = false;
|
this._sizeChanged = false;
|
||||||
}
|
}
|
||||||
@@ -3182,6 +3207,16 @@ L.Map = L.Evented.extend({
|
|||||||
return this.options.crs.wrapLatLng(L.latLng(latlng));
|
return this.options.crs.wrapLatLng(L.latLng(latlng));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// @method wrapLatLngBounds(bounds: LatLngBounds): 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.
|
||||||
|
wrapLatLngBounds: function (latlng) {
|
||||||
|
return this.options.crs.wrapLatLngBounds(L.latLngBounds(latlng));
|
||||||
|
},
|
||||||
|
|
||||||
// @method distance(latlng1: LatLng, latlng2: LatLng): Number
|
// @method distance(latlng1: LatLng, latlng2: LatLng): Number
|
||||||
// Returns the distance between two geographical coordinates according to
|
// Returns the distance between two geographical coordinates according to
|
||||||
// the map's CRS. By default this measures distance in meters.
|
// the map's CRS. By default this measures distance in meters.
|
||||||
@@ -3203,7 +3238,7 @@ L.Map = L.Evented.extend({
|
|||||||
return L.point(point).add(this._getMapPanePos());
|
return L.point(point).add(this._getMapPanePos());
|
||||||
},
|
},
|
||||||
|
|
||||||
// @method containerPointToLatLng(point: Point): Point
|
// @method containerPointToLatLng(point: Point): LatLng
|
||||||
// Given a pixel coordinate relative to the map container, returns
|
// Given a pixel coordinate relative to the map container, returns
|
||||||
// the corresponding geographical coordinate (for the current zoom level).
|
// the corresponding geographical coordinate (for the current zoom level).
|
||||||
containerPointToLatLng: function (point) {
|
containerPointToLatLng: function (point) {
|
||||||
@@ -3889,7 +3924,7 @@ L.Layer = L.Evented.extend({
|
|||||||
|
|
||||||
// @option attribution: String = null
|
// @option attribution: String = null
|
||||||
// String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
|
// String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
|
||||||
attribution: null,
|
attribution: null
|
||||||
},
|
},
|
||||||
|
|
||||||
/* @section
|
/* @section
|
||||||
@@ -3959,8 +3994,8 @@ L.Layer = L.Evented.extend({
|
|||||||
|
|
||||||
this.onAdd(map);
|
this.onAdd(map);
|
||||||
|
|
||||||
if (this.getAttribution && this._map.attributionControl) {
|
if (this.getAttribution && map.attributionControl) {
|
||||||
this._map.attributionControl.addAttribution(this.getAttribution());
|
map.attributionControl.addAttribution(this.getAttribution());
|
||||||
}
|
}
|
||||||
|
|
||||||
this.fire('add');
|
this.fire('add');
|
||||||
@@ -4205,7 +4240,10 @@ L.DomEvent = {
|
|||||||
if (L.Browser.pointer && type.indexOf('touch') === 0) {
|
if (L.Browser.pointer && type.indexOf('touch') === 0) {
|
||||||
this.addPointerListener(obj, type, handler, id);
|
this.addPointerListener(obj, type, handler, id);
|
||||||
|
|
||||||
} else if (L.Browser.touch && (type === 'dblclick') && this.addDoubleTapListener) {
|
} else if (L.Browser.touch && (type === 'dblclick') && this.addDoubleTapListener &&
|
||||||
|
!(L.Browser.pointer && L.Browser.chrome)) {
|
||||||
|
// Chrome >55 does not need the synthetic dblclicks from addDoubleTapListener
|
||||||
|
// See #5180
|
||||||
this.addDoubleTapListener(obj, handler, id);
|
this.addDoubleTapListener(obj, handler, id);
|
||||||
|
|
||||||
} else if ('addEventListener' in obj) {
|
} else if ('addEventListener' in obj) {
|
||||||
@@ -4712,7 +4750,9 @@ L.GridLayer = L.Layer.extend({
|
|||||||
// @option noWrap: Boolean = false
|
// @option noWrap: Boolean = false
|
||||||
// Whether the layer is wrapped around the antimeridian. If `true`, the
|
// Whether the layer is wrapped around the antimeridian. If `true`, the
|
||||||
// GridLayer will only be displayed once at low zoom levels. Has no
|
// GridLayer will only be displayed once at low zoom levels. Has no
|
||||||
// effect when the [map CRS](#map-crs) doesn't wrap around.
|
// effect when the [map CRS](#map-crs) doesn't wrap around. Can be used
|
||||||
|
// in combination with [`bounds`](#gridlayer-bounds) to prevent requesting
|
||||||
|
// tiles outside the CRS limits.
|
||||||
noWrap: false,
|
noWrap: false,
|
||||||
|
|
||||||
// @option pane: String = 'tilePane'
|
// @option pane: String = 'tilePane'
|
||||||
@@ -5283,14 +5323,14 @@ L.GridLayer = L.Layer.extend({
|
|||||||
sePoint = nwPoint.add(tileSize),
|
sePoint = nwPoint.add(tileSize),
|
||||||
|
|
||||||
nw = map.unproject(nwPoint, coords.z),
|
nw = map.unproject(nwPoint, coords.z),
|
||||||
se = map.unproject(sePoint, coords.z);
|
se = map.unproject(sePoint, coords.z),
|
||||||
|
bounds = new L.LatLngBounds(nw, se);
|
||||||
|
|
||||||
if (!this.options.noWrap) {
|
if (!this.options.noWrap) {
|
||||||
nw = map.wrapLatLng(nw);
|
map.wrapLatLngBounds(bounds);
|
||||||
se = map.wrapLatLng(se);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new L.LatLngBounds(nw, se);
|
return bounds;
|
||||||
},
|
},
|
||||||
|
|
||||||
// converts tile coordinates to key for the tile cache
|
// converts tile coordinates to key for the tile cache
|
||||||
@@ -5476,7 +5516,7 @@ L.gridLayer = function (options) {
|
|||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png?{foo}', {foo: 'bar'}).addTo(map);
|
* L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png?{foo}', {foo: 'bar'}).addTo(map);
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @section URL template
|
* @section URL template
|
||||||
@@ -5662,7 +5702,7 @@ L.TileLayer = L.GridLayer.extend({
|
|||||||
|
|
||||||
_tileOnError: function (done, tile, e) {
|
_tileOnError: function (done, tile, e) {
|
||||||
var errorUrl = this.options.errorTileUrl;
|
var errorUrl = this.options.errorTileUrl;
|
||||||
if (errorUrl) {
|
if (errorUrl && tile.src !== errorUrl) {
|
||||||
tile.src = errorUrl;
|
tile.src = errorUrl;
|
||||||
}
|
}
|
||||||
done(e, tile);
|
done(e, tile);
|
||||||
@@ -6000,6 +6040,8 @@ L.ImageOverlay = L.Layer.extend({
|
|||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// @method setBounds(bounds: LatLngBounds): this
|
||||||
|
// Update the bounds that this ImageOverlay covers
|
||||||
setBounds: function (bounds) {
|
setBounds: function (bounds) {
|
||||||
this._bounds = bounds;
|
this._bounds = bounds;
|
||||||
|
|
||||||
@@ -6022,10 +6064,14 @@ L.ImageOverlay = L.Layer.extend({
|
|||||||
return events;
|
return events;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// @method getBounds(): LatLngBounds
|
||||||
|
// Get the bounds that this ImageOverlay covers
|
||||||
getBounds: function () {
|
getBounds: function () {
|
||||||
return this._bounds;
|
return this._bounds;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// @method getElement(): HTMLElement
|
||||||
|
// Get the img element that represents the ImageOverlay on the map
|
||||||
getElement: function () {
|
getElement: function () {
|
||||||
return this._image;
|
return this._image;
|
||||||
},
|
},
|
||||||
@@ -6493,6 +6539,7 @@ L.Marker = L.Layer.extend({
|
|||||||
|
|
||||||
if (newShadow) {
|
if (newShadow) {
|
||||||
L.DomUtil.addClass(newShadow, classToAdd);
|
L.DomUtil.addClass(newShadow, classToAdd);
|
||||||
|
newShadow.alt = '';
|
||||||
}
|
}
|
||||||
this._shadow = newShadow;
|
this._shadow = newShadow;
|
||||||
|
|
||||||
@@ -7348,7 +7395,7 @@ L.Layer.include({
|
|||||||
// @method isPopupOpen(): boolean
|
// @method isPopupOpen(): boolean
|
||||||
// Returns `true` if the popup bound to this layer is currently open.
|
// Returns `true` if the popup bound to this layer is currently open.
|
||||||
isPopupOpen: function () {
|
isPopupOpen: function () {
|
||||||
return this._popup.isOpen();
|
return (this._popup ? this._popup.isOpen() : false);
|
||||||
},
|
},
|
||||||
|
|
||||||
// @method setPopupContent(content: String|HTMLElement|Popup): this
|
// @method setPopupContent(content: String|HTMLElement|Popup): this
|
||||||
@@ -8622,9 +8669,9 @@ L.LineUtil = {
|
|||||||
* ```js
|
* ```js
|
||||||
* // create a red polyline from an array of LatLng points
|
* // create a red polyline from an array of LatLng points
|
||||||
* var latlngs = [
|
* var latlngs = [
|
||||||
* [-122.68, 45.51],
|
* [45.51, -122.68],
|
||||||
* [-122.43, 37.77],
|
* [37.77, -122.43],
|
||||||
* [-118.2, 34.04]
|
* [34.04, -118.2]
|
||||||
* ];
|
* ];
|
||||||
*
|
*
|
||||||
* var polyline = L.polyline(latlngs, {color: 'red'}).addTo(map);
|
* var polyline = L.polyline(latlngs, {color: 'red'}).addTo(map);
|
||||||
@@ -8638,12 +8685,12 @@ L.LineUtil = {
|
|||||||
* ```js
|
* ```js
|
||||||
* // create a red polyline from an array of arrays of LatLng points
|
* // create a red polyline from an array of arrays of LatLng points
|
||||||
* var latlngs = [
|
* var latlngs = [
|
||||||
* [[-122.68, 45.51],
|
* [[45.51, -122.68],
|
||||||
* [-122.43, 37.77],
|
* [37.77, -122.43],
|
||||||
* [-118.2, 34.04]],
|
* [34.04, -118.2]],
|
||||||
* [[-73.91, 40.78],
|
* [[40.78, -73.91],
|
||||||
* [-87.62, 41.83],
|
* [41.83, -87.62],
|
||||||
* [-96.72, 32.76]]
|
* [32.76, -96.72]]
|
||||||
* ];
|
* ];
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
@@ -8983,7 +9030,7 @@ L.PolyUtil.clipPolygon = function (points, bounds, round) {
|
|||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* // create a red polygon from an array of LatLng points
|
* // create a red polygon from an array of LatLng points
|
||||||
* var latlngs = [[-111.03, 41],[-111.04, 45],[-104.05, 45],[-104.05, 41]];
|
* var latlngs = [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]];
|
||||||
*
|
*
|
||||||
* var polygon = L.polygon(latlngs, {color: 'red'}).addTo(map);
|
* var polygon = L.polygon(latlngs, {color: 'red'}).addTo(map);
|
||||||
*
|
*
|
||||||
@@ -8995,8 +9042,8 @@ L.PolyUtil.clipPolygon = function (points, bounds, round) {
|
|||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* var latlngs = [
|
* var latlngs = [
|
||||||
* [[-111.03, 41],[-111.04, 45],[-104.05, 45],[-104.05, 41]], // outer ring
|
* [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring
|
||||||
* [[-108.58,37.29],[-108.58,40.71],[-102.50,40.71],[-102.50,37.29]] // hole
|
* [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole
|
||||||
* ];
|
* ];
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
@@ -9005,11 +9052,11 @@ L.PolyUtil.clipPolygon = function (points, bounds, round) {
|
|||||||
* ```js
|
* ```js
|
||||||
* var latlngs = [
|
* var latlngs = [
|
||||||
* [ // first polygon
|
* [ // first polygon
|
||||||
* [[-111.03, 41],[-111.04, 45],[-104.05, 45],[-104.05, 41]], // outer ring
|
* [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring
|
||||||
* [[-108.58,37.29],[-108.58,40.71],[-102.50,40.71],[-102.50,37.29]] // hole
|
* [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole
|
||||||
* ],
|
* ],
|
||||||
* [ // second polygon
|
* [ // second polygon
|
||||||
* [[-109.05, 37],[-109.03, 41],[-102.05, 41],[-102.04, 37],[-109.05, 38]]
|
* [[41, -111.03],[45, -111.04],[45, -104.05],[41, -104.05]]
|
||||||
* ]
|
* ]
|
||||||
* ];
|
* ];
|
||||||
* ```
|
* ```
|
||||||
@@ -9679,6 +9726,7 @@ L.SVG.include(!L.Browser.vml ? {} : {
|
|||||||
container.appendChild(layer._path);
|
container.appendChild(layer._path);
|
||||||
|
|
||||||
this._updateStyle(layer);
|
this._updateStyle(layer);
|
||||||
|
this._layers[L.stamp(layer)] = layer;
|
||||||
},
|
},
|
||||||
|
|
||||||
_addPath: function (layer) {
|
_addPath: function (layer) {
|
||||||
@@ -9694,6 +9742,7 @@ L.SVG.include(!L.Browser.vml ? {} : {
|
|||||||
var container = layer._container;
|
var container = layer._container;
|
||||||
L.DomUtil.remove(container);
|
L.DomUtil.remove(container);
|
||||||
layer.removeInteractiveTarget(container);
|
layer.removeInteractiveTarget(container);
|
||||||
|
delete this._layers[L.stamp(layer)];
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateStyle: function (layer) {
|
_updateStyle: function (layer) {
|
||||||
@@ -9815,6 +9864,16 @@ if (L.Browser.vml) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
L.Canvas = L.Renderer.extend({
|
L.Canvas = L.Renderer.extend({
|
||||||
|
getEvents: function () {
|
||||||
|
var events = L.Renderer.prototype.getEvents.call(this);
|
||||||
|
events.viewprereset = this._onViewPreReset;
|
||||||
|
return events;
|
||||||
|
},
|
||||||
|
|
||||||
|
_onViewPreReset: function () {
|
||||||
|
// Set a flag so that a viewprereset+moveend+viewreset only updates&redraws once
|
||||||
|
this._postponeUpdatePaths = true;
|
||||||
|
},
|
||||||
|
|
||||||
onAdd: function () {
|
onAdd: function () {
|
||||||
L.Renderer.prototype.onAdd.call(this);
|
L.Renderer.prototype.onAdd.call(this);
|
||||||
@@ -9836,6 +9895,8 @@ L.Canvas = L.Renderer.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_updatePaths: function () {
|
_updatePaths: function () {
|
||||||
|
if (this._postponeUpdatePaths) { return; }
|
||||||
|
|
||||||
var layer;
|
var layer;
|
||||||
this._redrawBounds = null;
|
this._redrawBounds = null;
|
||||||
for (var id in this._layers) {
|
for (var id in this._layers) {
|
||||||
@@ -9876,6 +9937,15 @@ L.Canvas = L.Renderer.extend({
|
|||||||
this.fire('update');
|
this.fire('update');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_reset: function () {
|
||||||
|
L.Renderer.prototype._reset.call(this);
|
||||||
|
|
||||||
|
if (this._postponeUpdatePaths) {
|
||||||
|
this._postponeUpdatePaths = false;
|
||||||
|
this._updatePaths();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
_initPath: function (layer) {
|
_initPath: function (layer) {
|
||||||
this._updateDashArray(layer);
|
this._updateDashArray(layer);
|
||||||
this._layers[L.stamp(layer)] = layer;
|
this._layers[L.stamp(layer)] = layer;
|
||||||
@@ -9962,6 +10032,11 @@ L.Canvas = L.Renderer.extend({
|
|||||||
_redraw: function () {
|
_redraw: function () {
|
||||||
this._redrawRequest = null;
|
this._redrawRequest = null;
|
||||||
|
|
||||||
|
if (this._redrawBounds) {
|
||||||
|
this._redrawBounds.min._floor();
|
||||||
|
this._redrawBounds.max._ceil();
|
||||||
|
}
|
||||||
|
|
||||||
this._clear(); // clear layers in redraw bounds
|
this._clear(); // clear layers in redraw bounds
|
||||||
this._draw(); // draw layers
|
this._draw(); // draw layers
|
||||||
|
|
||||||
@@ -11325,6 +11400,7 @@ L.extend(L.DomEvent, {
|
|||||||
var count;
|
var count;
|
||||||
|
|
||||||
if (L.Browser.pointer) {
|
if (L.Browser.pointer) {
|
||||||
|
if ((!L.Browser.edge) || e.pointerType === 'mouse') { return; }
|
||||||
count = L.DomEvent._pointersCount;
|
count = L.DomEvent._pointersCount;
|
||||||
} else {
|
} else {
|
||||||
count = e.touches.length;
|
count = e.touches.length;
|
||||||
@@ -11340,9 +11416,11 @@ L.extend(L.DomEvent, {
|
|||||||
last = now;
|
last = now;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onTouchEnd() {
|
function onTouchEnd(e) {
|
||||||
if (doubleTap && !touch.cancelBubble) {
|
if (doubleTap && !touch.cancelBubble) {
|
||||||
if (L.Browser.pointer) {
|
if (L.Browser.pointer) {
|
||||||
|
if ((!L.Browser.edge) || e.pointerType === 'mouse') { return; }
|
||||||
|
|
||||||
// work around .type being readonly with MSPointer* events
|
// work around .type being readonly with MSPointer* events
|
||||||
var newTouch = {},
|
var newTouch = {},
|
||||||
prop, i;
|
prop, i;
|
||||||
@@ -11370,12 +11448,11 @@ L.extend(L.DomEvent, {
|
|||||||
obj.addEventListener(touchstart, onTouchStart, false);
|
obj.addEventListener(touchstart, onTouchStart, false);
|
||||||
obj.addEventListener(touchend, onTouchEnd, false);
|
obj.addEventListener(touchend, onTouchEnd, false);
|
||||||
|
|
||||||
// On some platforms (notably, chrome on win10 + touchscreen + mouse),
|
// On some platforms (notably, chrome<55 on win10 + touchscreen + mouse),
|
||||||
// the browser doesn't fire touchend/pointerup events but does fire
|
// the browser doesn't fire touchend/pointerup events but does fire
|
||||||
// native dblclicks. See #4127.
|
// native dblclicks. See #4127.
|
||||||
if (!L.Browser.edge) {
|
// Edge 14 also fires native dblclicks, but only for pointerType mouse, see #5180.
|
||||||
obj.addEventListener('dblclick', handler, false);
|
obj.addEventListener('dblclick', handler, false);
|
||||||
}
|
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
@@ -11450,7 +11527,7 @@ L.extend(L.DomEvent, {
|
|||||||
|
|
||||||
_addPointerStart: function (obj, handler, id) {
|
_addPointerStart: function (obj, handler, id) {
|
||||||
var onDown = L.bind(function (e) {
|
var onDown = L.bind(function (e) {
|
||||||
if (e.pointerType !== 'mouse' && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) {
|
if (e.pointerType !== 'mouse' && e.MSPOINTER_TYPE_MOUSE && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) {
|
||||||
// In IE11, some touch events needs to fire for form controls, or
|
// In IE11, some touch events needs to fire for form controls, or
|
||||||
// the controls will stop working. We keep a whitelist of tag names that
|
// the controls will stop working. We keep a whitelist of tag names that
|
||||||
// need these events. For other target tags, we prevent default on the event.
|
// need these events. For other target tags, we prevent default on the event.
|
||||||
@@ -12916,7 +12993,8 @@ L.Control.Layers = L.Control.extend({
|
|||||||
|
|
||||||
_initLayout: function () {
|
_initLayout: function () {
|
||||||
var className = 'leaflet-control-layers',
|
var className = 'leaflet-control-layers',
|
||||||
container = this._container = L.DomUtil.create('div', className);
|
container = this._container = L.DomUtil.create('div', className),
|
||||||
|
collapsed = this.options.collapsed;
|
||||||
|
|
||||||
// makes this work on IE touch devices by stopping it from firing a mouseout event when the touch is released
|
// makes this work on IE touch devices by stopping it from firing a mouseout event when the touch is released
|
||||||
container.setAttribute('aria-haspopup', true);
|
container.setAttribute('aria-haspopup', true);
|
||||||
@@ -12928,12 +13006,16 @@ L.Control.Layers = L.Control.extend({
|
|||||||
|
|
||||||
var form = this._form = L.DomUtil.create('form', className + '-list');
|
var form = this._form = L.DomUtil.create('form', className + '-list');
|
||||||
|
|
||||||
|
if (collapsed) {
|
||||||
|
this._map.on('click', this.collapse, this);
|
||||||
|
|
||||||
if (!L.Browser.android) {
|
if (!L.Browser.android) {
|
||||||
L.DomEvent.on(container, {
|
L.DomEvent.on(container, {
|
||||||
mouseenter: this.expand,
|
mouseenter: this.expand,
|
||||||
mouseleave: this.collapse
|
mouseleave: this.collapse
|
||||||
}, this);
|
}, this);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var link = this._layersLink = L.DomUtil.create('a', className + '-toggle', container);
|
var link = this._layersLink = L.DomUtil.create('a', className + '-toggle', container);
|
||||||
link.href = '#';
|
link.href = '#';
|
||||||
@@ -12952,10 +13034,9 @@ L.Control.Layers = L.Control.extend({
|
|||||||
setTimeout(L.bind(this._onInputClick, this), 0);
|
setTimeout(L.bind(this._onInputClick, this), 0);
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
this._map.on('click', this.collapse, this);
|
|
||||||
// TODO keyboard accessibility
|
// TODO keyboard accessibility
|
||||||
|
|
||||||
if (!this.options.collapsed) {
|
if (!collapsed) {
|
||||||
this.expand();
|
this.expand();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -56,7 +56,7 @@
|
|||||||
.leaflet-container.leaflet-touch-drag {
|
.leaflet-container.leaflet-touch-drag {
|
||||||
-ms-touch-action: pinch-zoom;
|
-ms-touch-action: pinch-zoom;
|
||||||
}
|
}
|
||||||
.leaflet-container.leaflet-touch-drag.leaflet-touch-drag {
|
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
|
||||||
-ms-touch-action: none;
|
-ms-touch-action: none;
|
||||||
touch-action: none;
|
touch-action: none;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
2
assets/leaflet/leaflet.min.css
vendored
2
assets/leaflet/leaflet.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -19,7 +19,8 @@
|
|||||||
},
|
},
|
||||||
"require":{
|
"require":{
|
||||||
"php":">=5.4",
|
"php":">=5.4",
|
||||||
"contao/core":"~3.5"
|
"contao-community-alliance/composer-plugin": "~2.4 | ~3.0",
|
||||||
|
"contao/core-bundle":"~3.5 | ~4.3"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"netzmacht/contao-leaflet-maps": "Leaflet maps integration into Contao CMS"
|
"netzmacht/contao-leaflet-maps": "Leaflet maps integration into Contao CMS"
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
$GLOBALS['LEAFLET_LIBRARIES']['leaflet'] = array
|
$GLOBALS['LEAFLET_LIBRARIES']['leaflet'] = array
|
||||||
(
|
(
|
||||||
'name' => 'Leaflet',
|
'name' => 'Leaflet',
|
||||||
'version' => '1.0.2',
|
'version' => '1.0.3',
|
||||||
'license' => '<a href="https://github.com/Leaflet/Leaflet/blob/master/LICENSE" target="_blank">BSD-2-Clause</a>',
|
'license' => '<a href="https://github.com/Leaflet/Leaflet/blob/master/LICENSE" target="_blank">BSD-2-Clause</a>',
|
||||||
'homepage' => 'http://leafletjs.com',
|
'homepage' => 'http://leafletjs.com',
|
||||||
'css' => 'assets/leaflet/libs/leaflet/leaflet.min.css',
|
'css' => 'assets/leaflet/libs/leaflet/leaflet.min.css',
|
||||||
@@ -36,7 +36,7 @@ $GLOBALS['LEAFLET_LIBRARIES']['leaflet-providers'] = array
|
|||||||
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-markercluster'] = array
|
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-markercluster'] = array
|
||||||
(
|
(
|
||||||
'name' => 'Leaflet.markercluster',
|
'name' => 'Leaflet.markercluster',
|
||||||
'version' => '1.0.0',
|
'version' => '1.0.2',
|
||||||
'license' => '<a href="https://github.com/Leaflet/Leaflet.markercluster/blob/master/MIT-LICENCE.txt" target="_blank">MIT</a>',
|
'license' => '<a href="https://github.com/Leaflet/Leaflet.markercluster/blob/master/MIT-LICENCE.txt" target="_blank">MIT</a>',
|
||||||
'homepage' => 'https://github.com/Leaflet/Leaflet.markercluster',
|
'homepage' => 'https://github.com/Leaflet/Leaflet.markercluster',
|
||||||
'css' => 'assets/leaflet/libs/leaflet-markercluster/MarkerCluster.css',
|
'css' => 'assets/leaflet/libs/leaflet-markercluster/MarkerCluster.css',
|
||||||
@@ -55,7 +55,7 @@ $GLOBALS['LEAFLET_LIBRARIES']['leaflet-omnivore'] = array
|
|||||||
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-loading'] = array
|
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-loading'] = array
|
||||||
(
|
(
|
||||||
'name' => 'Leaflet.loading',
|
'name' => 'Leaflet.loading',
|
||||||
'version' => '0.1.23',
|
'version' => '0.1.24',
|
||||||
'license' => '<a href="https://github.com/ebrelsford/Leaflet.loading/blob/master/LICENSE" target="_blank">MIT</a>',
|
'license' => '<a href="https://github.com/ebrelsford/Leaflet.loading/blob/master/LICENSE" target="_blank">MIT</a>',
|
||||||
'homepage' => 'https://github.com/ebrelsford/Leaflet.loading',
|
'homepage' => 'https://github.com/ebrelsford/Leaflet.loading',
|
||||||
'css' => 'assets/leaflet/libs/leaflet-loading/Control.Loading.min.css',
|
'css' => 'assets/leaflet/libs/leaflet-loading/Control.Loading.min.css',
|
||||||
|
|||||||
Reference in New Issue
Block a user