Compare commits

..

15 Commits

Author SHA1 Message Date
David Molineus
bf88bbca8c Update leaflet geocoder. 2018-02-06 16:59:33 +01:00
David Molineus
232d223eee Fix branch aliases and apply spdx license format changes. 2018-01-27 13:38:31 +01:00
David Molineus
79fdad5ca3 Include leaflet.pm as new library. 2018-01-26 19:55:36 +01:00
David Molineus
c5b72d2c15 Update leaflet-markercluster to v1.3.0. 2018-01-26 19:44:04 +01:00
David Molineus
69b500a5fc Update leaflet to v1.3.1. 2018-01-26 15:01:39 +01:00
David Molineus
cbce9420ec Update Leaflet.markercluster to 1.1.0. 2017-10-17 09:59:20 +02:00
David Molineus
193c920e1b Update minified style. 2017-10-17 09:56:35 +02:00
David Molineus
ed594cfdd1 Update control geocoder to v1.5.5. 2017-10-17 09:56:11 +02:00
David Molineus
a2cdfddcc6 Use leaflet 1.2.0. 2017-10-17 09:51:56 +02:00
David Molineus
1f5add1d27 Update gitignore and gitattributes. 2017-10-09 15:13:24 +02:00
David Molineus
ad4b61f696 Update leaflet providers to 1.1.17 2017-07-06 16:51:37 +02:00
David Molineus
170c7e8d8e Update to marker cluster version 1.0.6. 2017-07-06 16:42:34 +02:00
David Molineus
eee8019f9d Update leaflet fullscreen. 2017-07-06 16:38:23 +02:00
David Molineus
442ecc7166 Update leaflet 1.1.0. 2017-07-06 16:31:05 +02:00
David Molineus
8c4b151b1d Use double pipes. 2017-01-27 12:15:15 +01:00
39 changed files with 8773 additions and 7920 deletions

10
.gitattributes vendored Normal file
View File

@@ -0,0 +1,10 @@
.check-author.yml export-ignore
.gitattributes export-ignore
.github export-ignore
.gitignore export-ignore
.travis.yml export-ignore
build.default.properties export-ignore
build.xml export-ignore
phpunit.xml.dist export-ignore
/tests export-ignore
/specs export-ignore

26
.gitignore vendored
View File

@@ -1,8 +1,24 @@
/vendor/ # OS
/bin/ .DS_Store
/.tx/ Thumbs.db
/node_modules/ .directory
coverage.xml # IDEs
.buildpath
.project
.settings/
.build/
.external*/
.idea/
nbproject/
# composer related
vendor/
composer.lock composer.lock
# build
build/
build.properties
# Translations
.tx

View File

@@ -12,14 +12,15 @@ Contao CMS.
This package contains following packages: This package contains following packages:
- [leaflet 1.0.3](http://leafletjs.com) - [leaflet 1.3.1](http://leafletjs.com)
- [Leaflet-providers 1.1.15](http://leaflet-extras.github.io/leaflet-providers) - [Leaflet-providers 1.1.17](http://leaflet-extras.github.io/leaflet-providers)
- [Leaflet.markercluster 1.0.2](https://github.com/Leaflet/Leaflet.markercluster) - [Leaflet.markercluster 1.3.0](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.24](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.3](https://github.com/brunob/leaflet.fullscreen)
- [Leaflet Control Geocoder 1.5.4](https://github.com/perliedman/leaflet-control-geocoder) - [Leaflet Control Geocoder 1.5.8](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)
- [leaflet.pm 0.23.1](https://github.com/codeofsumit/leaflet.pm)
- [osmtogeojson 2.2.12](https://github.com/tyrasd/osmtogeojson) - [osmtogeojson 2.2.12](https://github.com/tyrasd/osmtogeojson)
- [spin.js 2.3.2](http://fgnass.github.io/spin.js) - [spin.js 2.3.2](http://fgnass.github.io/spin.js)
@@ -52,4 +53,4 @@ License
------- -------
As this package is just a meta package to provide the libraries, the licenses of each library have to be accepted. They As this package is just a meta package to provide the libraries, the licenses of each library have to be accepted. They
are unter the MIT or BSD license. are under the MIT or BSD license.

View File

@@ -49,6 +49,7 @@
background-image: url(images/geocoder.png); background-image: url(images/geocoder.png);
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
cursor: pointer;
} }
.leaflet-touch .leaflet-control-geocoder-icon { .leaflet-touch .leaflet-control-geocoder-icon {

View File

@@ -8,7 +8,7 @@ module.exports = {
options: { options: {
showResultIcons: false, showResultIcons: false,
collapsed: true, collapsed: true,
expand: 'click', expand: 'touch', // options: touch, click, anythingelse
position: 'topright', position: 'topright',
placeholder: 'Search...', placeholder: 'Search...',
errorMessage: 'Nothing found.', errorMessage: 'Nothing found.',
@@ -17,7 +17,7 @@ module.exports = {
defaultMarkGeocode: true defaultMarkGeocode: true
}, },
includes: L.Mixin.Events, includes: L.Evented.prototype || L.Mixin.Events,
initialize: function (options) { initialize: function (options) {
L.Util.setOptions(this, options); L.Util.setOptions(this, options);
@@ -54,6 +54,9 @@ module.exports = {
L.DomEvent.disableClickPropagation(this._alts); L.DomEvent.disableClickPropagation(this._alts);
L.DomEvent.addListener(input, 'keydown', this._keydown, this); L.DomEvent.addListener(input, 'keydown', this._keydown, this);
if (this.options.geocoder.suggest) {
L.DomEvent.addListener(input, 'input', this._change, this);
}
L.DomEvent.addListener(input, 'blur', function() { L.DomEvent.addListener(input, 'blur', function() {
if (this.options.collapsed && !this._preventBlurCollapse) { if (this.options.collapsed && !this._preventBlurCollapse) {
this._collapse(); this._collapse();
@@ -64,22 +67,36 @@ module.exports = {
if (this.options.collapsed) { if (this.options.collapsed) {
if (this.options.expand === 'click') { if (this.options.expand === 'click') {
L.DomEvent.addListener(icon, 'click', function(e) { L.DomEvent.addListener(container, 'click', function(e) {
// TODO: touch
if (e.button === 0 && e.detail !== 2) { if (e.button === 0 && e.detail !== 2) {
this._toggle(); this._toggle();
} }
}, this); }, this);
} else { }
L.DomEvent.addListener(icon, 'mouseover', this._expand, this); else if (L.Browser.touch && this.options.expand === 'touch') {
L.DomEvent.addListener(icon, 'mouseout', this._collapse, this); L.DomEvent.addListener(container, 'touchstart mousedown', function(e) {
this._toggle();
e.preventDefault(); // mobile: clicking focuses the icon, so UI expands and immediately collapses
e.stopPropagation();
}, this);
}
else {
L.DomEvent.addListener(container, 'mouseover', this._expand, this);
L.DomEvent.addListener(container, 'mouseout', this._collapse, this);
this._map.on('movestart', this._collapse, this); this._map.on('movestart', this._collapse, this);
} }
} else { } else {
L.DomEvent.addListener(icon, 'click', function(e) {
this._geocode(e);
}, this);
this._expand(); this._expand();
if (L.Browser.touch) {
L.DomEvent.addListener(container, 'touchstart', function(e) {
this._geocode(e);
}, this);
}
else {
L.DomEvent.addListener(container, 'click', function(e) {
this._geocode(e);
}, this);
}
} }
if (this.options.defaultMarkGeocode) { if (this.options.defaultMarkGeocode) {
@@ -132,32 +149,30 @@ module.exports = {
_geocode: function(suggest) { _geocode: function(suggest) {
var requestCount = ++this._requestCount, var requestCount = ++this._requestCount,
mode = suggest ? 'suggest' : 'geocode'; mode = suggest ? 'suggest' : 'geocode',
eventData = {input: this._input.value};
this._lastGeocode = this._input.value; this._lastGeocode = this._input.value;
if (!suggest) { if (!suggest) {
this._clearResults(); this._clearResults();
} }
this.fire('start' + mode); this.fire('start' + mode, eventData);
this.options.geocoder[mode](this._input.value, function(results) { this.options.geocoder[mode](this._input.value, function(results) {
if (requestCount === this._requestCount) { if (requestCount === this._requestCount) {
this.fire('finish' + mode); eventData.results = results;
this.fire('finish' + mode, eventData);
this._geocodeResult(results, suggest); this._geocodeResult(results, suggest);
} }
}, this); }, this);
}, },
_geocodeResultSelected: function(result) { _geocodeResultSelected: function(result) {
if (!this.options.collapsed) {
this._clearResults();
}
this.fire('markgeocode', {geocode: result}); this.fire('markgeocode', {geocode: result});
}, },
_toggle: function() { _toggle: function() {
if (this._container.className.indexOf('leaflet-control-geocoder-expanded') >= 0) { if (L.DomUtil.hasClass(this._container, 'leaflet-control-geocoder-expanded')) {
this._collapse(); this._collapse();
} else { } else {
this._expand(); this._expand();
@@ -171,9 +186,10 @@ module.exports = {
}, },
_collapse: function () { _collapse: function () {
this._container.className = this._container.className.replace(' leaflet-control-geocoder-expanded', ''); L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-expanded');
L.DomUtil.addClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized'); L.DomUtil.addClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized');
L.DomUtil.removeClass(this._errorElement, 'leaflet-control-geocoder-error'); L.DomUtil.removeClass(this._errorElement, 'leaflet-control-geocoder-error');
this._input.blur(); // mobile: keyboard shouldn't stay expanded
this.fire('collapse'); this.fire('collapse');
}, },
@@ -186,21 +202,23 @@ module.exports = {
_createAlt: function(result, index) { _createAlt: function(result, index) {
var li = L.DomUtil.create('li', ''), var li = L.DomUtil.create('li', ''),
a = L.DomUtil.create('a', '', li), a = L.DomUtil.create('a', '', li),
icon = this.options.showResultIcons && result.icon ? L.DomUtil.create('img', '', a) : null, icon = this.options.showResultIcons && result.icon ? L.DomUtil.create('img', '', a) : null,
text = result.html ? undefined : document.createTextNode(result.name), text = result.html ? undefined : document.createTextNode(result.name),
mouseDownHandler = function mouseDownHandler(e) { mouseDownHandler = function mouseDownHandler(e) {
// In some browsers, a click will fire on the map if the control is // In some browsers, a click will fire on the map if the control is
// collapsed directly after mousedown. To work around this, we // collapsed directly after mousedown. To work around this, we
// wait until the click is completed, and _then_ collapse the // wait until the click is completed, and _then_ collapse the
// control. Messy, but this is the workaround I could come up with // control. Messy, but this is the workaround I could come up with
// for #142. // for #142.
this._preventBlurCollapse = true; this._preventBlurCollapse = true;
L.DomEvent.stop(e); L.DomEvent.stop(e);
this._geocodeResultSelected(result); this._geocodeResultSelected(result);
L.DomEvent.on(li, 'click', function() { L.DomEvent.on(li, 'click', function() {
if (this.options.collapsed) { if (this.options.collapsed) {
this._collapse(); this._collapse();
} } else {
this._clearResults();
}
}, this); }, this);
}; };
@@ -219,7 +237,7 @@ module.exports = {
// Use mousedown and not click, since click will fire _after_ blur, // Use mousedown and not click, since click will fire _after_ blur,
// causing the control to have collapsed and removed the items // causing the control to have collapsed and removed the items
// before the click can fire. // before the click can fire.
L.DomEvent.addListener(li, 'mousedown', mouseDownHandler, this); L.DomEvent.addListener(li, 'mousedown touchstart', mouseDownHandler, this);
return li; return li;
}, },
@@ -250,12 +268,10 @@ module.exports = {
// Up // Up
case 38: case 38:
select(-1); select(-1);
L.DomEvent.preventDefault(e);
break; break;
// Up // Up
case 40: case 40:
select(1); select(1);
L.DomEvent.preventDefault(e);
break; break;
// Enter // Enter
case 13: case 13:
@@ -266,19 +282,19 @@ module.exports = {
} else { } else {
this._geocode(); this._geocode();
} }
L.DomEvent.preventDefault(e);
break; break;
default: }
var v = this._input.value; },
if (this.options.geocoder.suggest && v !== this._lastGeocode) { _change: function(e) {
clearTimeout(this._suggestTimeout); var v = this._input.value;
if (v.length >= this.options.suggestMinLength) { if (v !== this._lastGeocode) {
this._suggestTimeout = setTimeout(L.bind(function() { clearTimeout(this._suggestTimeout);
this._geocode(true); if (v.length >= this.options.suggestMinLength) {
}, this), this.options.suggestTimeout); this._suggestTimeout = setTimeout(L.bind(function() {
} else { this._geocode(true);
this._clearResults(); }, this), this.options.suggestTimeout);
} } else {
this._clearResults();
} }
} }
} }
@@ -608,18 +624,26 @@ var L = (typeof window !== "undefined" ? window['L'] : typeof global !== "undefi
module.exports = { module.exports = {
"class": L.Class.extend({ "class": L.Class.extend({
options: { options: {
serviceUrl: 'https://api.tiles.mapbox.com/v4/geocode/mapbox.places-v1/' serviceUrl: 'https://api.tiles.mapbox.com/v4/geocode/mapbox.places-v1/',
geocodingQueryParams: {},
reverseQueryParams: {}
}, },
initialize: function(accessToken, options) { initialize: function(accessToken, options) {
L.setOptions(this, options); L.setOptions(this, options);
this._accessToken = accessToken; this.options.geocodingQueryParams.access_token = accessToken;
this.options.reverseQueryParams.access_token = accessToken;
}, },
geocode: function(query, cb, context) { geocode: function(query, cb, context) {
Util.getJSON(this.options.serviceUrl + encodeURIComponent(query) + '.json', { var params = this.options.geocodingQueryParams;
access_token: this._accessToken if (typeof params.proximity !== 'undefined'
}, function(data) { && params.proximity.hasOwnProperty('lat')
&& params.proximity.hasOwnProperty('lng'))
{
params.proximity = params.proximity.lng + ',' + params.proximity.lat;
}
Util.getJSON(this.options.serviceUrl + encodeURIComponent(query) + '.json', params, function(data) {
var results = [], var results = [],
loc, loc,
latLng, latLng,
@@ -628,7 +652,7 @@ module.exports = {
for (var i = 0; i <= data.features.length - 1; i++) { for (var i = 0; i <= data.features.length - 1; i++) {
loc = data.features[i]; loc = data.features[i];
latLng = L.latLng(loc.center.reverse()); latLng = L.latLng(loc.center.reverse());
if(loc.hasOwnProperty('bbox')) if (loc.hasOwnProperty('bbox'))
{ {
latLngBounds = L.latLngBounds(L.latLng(loc.bbox.slice(0, 2).reverse()), L.latLng(loc.bbox.slice(2, 4).reverse())); latLngBounds = L.latLngBounds(L.latLng(loc.bbox.slice(0, 2).reverse()), L.latLng(loc.bbox.slice(2, 4).reverse()));
} }
@@ -653,9 +677,7 @@ module.exports = {
}, },
reverse: function(location, scale, cb, context) { reverse: function(location, scale, cb, context) {
Util.getJSON(this.options.serviceUrl + encodeURIComponent(location.lng) + ',' + encodeURIComponent(location.lat) + '.json', { Util.getJSON(this.options.serviceUrl + encodeURIComponent(location.lng) + ',' + encodeURIComponent(location.lat) + '.json', this.options.reverseQueryParams, function(data) {
access_token: this._accessToken
}, function(data) {
var results = [], var results = [],
loc, loc,
latLng, latLng,
@@ -664,7 +686,7 @@ module.exports = {
for (var i = 0; i <= data.features.length - 1; i++) { for (var i = 0; i <= data.features.length - 1; i++) {
loc = data.features[i]; loc = data.features[i];
latLng = L.latLng(loc.center.reverse()); latLng = L.latLng(loc.center.reverse());
if(loc.hasOwnProperty('bbox')) if (loc.hasOwnProperty('bbox'))
{ {
latLngBounds = L.latLngBounds(L.latLng(loc.bbox.slice(0, 2).reverse()), L.latLng(loc.bbox.slice(2, 4).reverse())); latLngBounds = L.latLngBounds(L.latLng(loc.bbox.slice(0, 2).reverse()), L.latLng(loc.bbox.slice(2, 4).reverse()));
} }
@@ -1043,6 +1065,9 @@ module.exports = {
results.push({ results.push({
name: this._deocodeFeatureName(f), name: this._deocodeFeatureName(f),
html: this.options.htmlTemplate ?
this.options.htmlTemplate(f)
: undefined,
center: latLng, center: latLng,
bbox: bbox, bbox: bbox,
properties: f.properties properties: f.properties

File diff suppressed because one or more lines are too long

View File

@@ -21,7 +21,7 @@ The plugin supports many different data providers:
* [What3Words](http://what3words.com/) * [What3Words](http://what3words.com/)
* [Photon](http://photon.komoot.de/) * [Photon](http://photon.komoot.de/)
* [Mapzen Search](https://mapzen.com/projects/search) * [Mapzen Search](https://mapzen.com/projects/search)
* [HERE Geocoder API] (https://developer.here.com/rest-apis/documentation/geocoder/topics/overview.html) * [HERE Geocoder API](https://developer.here.com/documentation/geocoder/topics/introduction.html)
The plugin can easily be extended to support other providers. Current extensions: The plugin can easily be extended to support other providers. Current extensions:
@@ -94,6 +94,7 @@ L.Control.Geocoder(options)
| Option | Type | Default | Description | | Option | Type | Default | Description |
| --------------- | ---------------- | ----------------- | ----------- | | --------------- | ---------------- | ----------------- | ----------- |
| collapsed | Boolean | true | Collapse control unless hovered/clicked | | collapsed | Boolean | true | Collapse control unless hovered/clicked |
| expand | String | "touch" | How to expand a collapsed control: `touch` `click` `hover` |
| position | String | "topright" | Control [position](http://leafletjs.com/reference.html#control-positions) | | position | String | "topright" | Control [position](http://leafletjs.com/reference.html#control-positions) |
| placeholder | String | "Search..." | Placeholder text for text input | placeholder | String | "Search..." | Placeholder text for text input
| errorMessage | String | "Nothing found." | Message when no result found / geocoding error occurs | | errorMessage | String | "Nothing found." | Message when no result found / geocoding error occurs |
@@ -160,7 +161,7 @@ An object that represents a result from a geocoding query.
| Property | Type | Description | | Property | Type | Description |
| ---------- | ---------------- | ------------------------------------- | | ---------- | ---------------- | ------------------------------------- |
| name | String | Name of found location | | name | String | Name of found location |
| bounds | L.LatLngBounds | The bounds of the location | | bbox | L.LatLngBounds | The bounds of the location |
| center | L.LatLng | The center coordinate of the location | | center | L.LatLng | The center coordinate of the location |
| icon | String | URL for icon representing result; optional | | icon | String | URL for icon representing result; optional |
| html | String | (optional) HTML formatted representation of the name | | html | String | (optional) HTML formatted representation of the name |

View File

@@ -1,14 +1,14 @@
{ {
"name": "leaflet-control-geocoder", "name": "leaflet-control-geocoder",
"version": "1.5.4", "version": "1.5.5",
"homepage": "https://github.com/perliedman/leaflet-control-geocoder", "homepage": "https://github.com/perliedman/leaflet-control-geocoder",
"authors": [ "authors": [
"Per Liedman <per@liedman.net>" "Per Liedman <per@liedman.net>"
], ],
"description": "Extendable geocoder with builtin OSM/Nominatim support", "description": "Extendable geocoder with builtin OSM/Nominatim support",
"main": [ "main": [
"Control.Geocoder.js", "dist/Control.Geocoder.js",
"Control.Geocoder.css", "dist/Control.Geocoder.css",
"images/geocoder.png", "images/geocoder.png",
"images/throbber.gif" "images/throbber.gif"
], ],

View File

@@ -1,10 +1,10 @@
{ {
"name": "leaflet-control-geocoder", "name": "leaflet-control-geocoder",
"version": "1.5.4", "version": "1.5.8",
"description": "Extendable geocoder with builtin support for Nominatim, Bing, Google, Mapbox, Photon, What3Words, MapQuest, Mapzen, HERE", "description": "Extendable geocoder with builtin support for Nominatim, Bing, Google, Mapbox, Photon, What3Words, MapQuest, Mapzen, HERE",
"main": "dist/Control.Geocoder.js", "main": "dist/Control.Geocoder.js",
"scripts": { "scripts": {
"prepublish": "sh ./scripts/build.sh", "prepare": "sh ./scripts/build.sh",
"publish": "sh ./scripts/publish.sh", "publish": "sh ./scripts/publish.sh",
"postpublish": "sh ./scripts/postpublish.sh" "postpublish": "sh ./scripts/postpublish.sh"
}, },

View File

@@ -155,7 +155,7 @@ source : http://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugi
fullScreenApi.isFullScreen = function () { fullScreenApi.isFullScreen = function () {
switch (this.prefix) { switch (this.prefix) {
case '': case '':
return document.fullScreen; return document.fullscreen;
case 'webkit': case 'webkit':
return document.webkitIsFullScreen; return document.webkitIsFullScreen;
case 'ms': case 'ms':

View File

@@ -1 +1 @@
!function(){L.Control.FullScreen=L.Control.extend({options:{position:"topleft",title:"Full Screen",titleCancel:"Exit Full Screen",forceSeparateButton:!1,forcePseudoFullscreen:!1,fullscreenElement:!1},onAdd:function(e){var n,t="leaflet-control-zoom-fullscreen",l="";return n=e.zoomControl&&!this.options.forceSeparateButton?e.zoomControl._container:L.DomUtil.create("div","leaflet-bar"),this.options.content?l=this.options.content:t+=" fullscreen-icon",this._createButton(this.options.title,t,l,n,this.toggleFullScreen,this),this._map.on("enterFullscreen exitFullscreen",this._toggleTitle,this),n},_createButton:function(n,t,l,r,i,s){return this.link=L.DomUtil.create("a",t,r),this.link.href="#",this.link.title=n,this.link.innerHTML=l,L.DomEvent.addListener(this.link,"click",L.DomEvent.stopPropagation).addListener(this.link,"click",L.DomEvent.preventDefault).addListener(this.link,"click",i,s),L.DomEvent.addListener(r,e.fullScreenEventName,L.DomEvent.stopPropagation).addListener(r,e.fullScreenEventName,L.DomEvent.preventDefault).addListener(r,e.fullScreenEventName,this._handleEscKey,s),L.DomEvent.addListener(document,e.fullScreenEventName,L.DomEvent.stopPropagation).addListener(document,e.fullScreenEventName,L.DomEvent.preventDefault).addListener(document,e.fullScreenEventName,this._handleEscKey,s),this.link},toggleFullScreen:function(){var n=this._map;n._exitFired=!1,n._isFullscreen?(e.supportsFullScreen&&!this.options.forcePseudoFullscreen?e.cancelFullScreen(this.options.fullscreenElement?this.options.fullscreenElement:n._container):L.DomUtil.removeClass(n._container,"leaflet-pseudo-fullscreen"),n.invalidateSize(),n.fire("exitFullscreen"),n._exitFired=!0,n._isFullscreen=!1):(e.supportsFullScreen&&!this.options.forcePseudoFullscreen?e.requestFullScreen(this.options.fullscreenElement?this.options.fullscreenElement:n._container):L.DomUtil.addClass(n._container,"leaflet-pseudo-fullscreen"),n.invalidateSize(),n.fire("enterFullscreen"),n._isFullscreen=!0)},_toggleTitle:function(){this.link.title=this._map._isFullscreen?this.options.title:this.options.titleCancel},_handleEscKey:function(){var n=this._map;e.isFullScreen(n)||n._exitFired||(n.fire("exitFullscreen"),n._exitFired=!0,n._isFullscreen=!1)}}),L.Map.addInitHook(function(){this.options.fullscreenControl&&(this.fullscreenControl=L.control.fullscreen(this.options.fullscreenControlOptions),this.addControl(this.fullscreenControl))}),L.control.fullscreen=function(e){return new L.Control.FullScreen(e)};var e={supportsFullScreen:!1,isFullScreen:function(){return!1},requestFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",prefix:""},n="webkit moz o ms khtml".split(" ");if("undefined"!=typeof document.exitFullscreen)e.supportsFullScreen=!0;else{for(var t=0,l=n.length;t<l;t++)if(e.prefix=n[t],"undefined"!=typeof document[e.prefix+"CancelFullScreen"]){e.supportsFullScreen=!0;break}"undefined"!=typeof document.msExitFullscreen&&(e.prefix="ms",e.supportsFullScreen=!0)}e.supportsFullScreen&&("ms"===e.prefix?e.fullScreenEventName="MSFullscreenChange":e.fullScreenEventName=e.prefix+"fullscreenchange",e.isFullScreen=function(){switch(this.prefix){case"":return document.fullScreen;case"webkit":return document.webkitIsFullScreen;case"ms":return document.msFullscreenElement;default:return document[this.prefix+"FullScreen"]}},e.requestFullScreen=function(e){switch(this.prefix){case"":return e.requestFullscreen();case"ms":return e.msRequestFullscreen();default:return e[this.prefix+"RequestFullScreen"]()}},e.cancelFullScreen=function(){switch(this.prefix){case"":return document.exitFullscreen();case"ms":return document.msExitFullscreen();default:return document[this.prefix+"CancelFullScreen"]()}}),"undefined"!=typeof jQuery&&(jQuery.fn.requestFullScreen=function(){return this.each(function(){var n=jQuery(this);e.supportsFullScreen&&e.requestFullScreen(n)})}),window.fullScreenApi=e}(); !function(){L.Control.FullScreen=L.Control.extend({options:{position:"topleft",title:"Full Screen",titleCancel:"Exit Full Screen",forceSeparateButton:!1,forcePseudoFullscreen:!1,fullscreenElement:!1},onAdd:function(e){var t,n="leaflet-control-zoom-fullscreen",l="";return t=e.zoomControl&&!this.options.forceSeparateButton?e.zoomControl._container:L.DomUtil.create("div","leaflet-bar"),this.options.content?l=this.options.content:n+=" fullscreen-icon",this._createButton(this.options.title,n,l,t,this.toggleFullScreen,this),this._map.on("enterFullscreen exitFullscreen",this._toggleTitle,this),t},_createButton:function(t,n,l,r,i,s){return this.link=L.DomUtil.create("a",n,r),this.link.href="#",this.link.title=t,this.link.innerHTML=l,L.DomEvent.addListener(this.link,"click",L.DomEvent.stopPropagation).addListener(this.link,"click",L.DomEvent.preventDefault).addListener(this.link,"click",i,s),L.DomEvent.addListener(r,e.fullScreenEventName,L.DomEvent.stopPropagation).addListener(r,e.fullScreenEventName,L.DomEvent.preventDefault).addListener(r,e.fullScreenEventName,this._handleEscKey,s),L.DomEvent.addListener(document,e.fullScreenEventName,L.DomEvent.stopPropagation).addListener(document,e.fullScreenEventName,L.DomEvent.preventDefault).addListener(document,e.fullScreenEventName,this._handleEscKey,s),this.link},toggleFullScreen:function(){var t=this._map;t._exitFired=!1,t._isFullscreen?(e.supportsFullScreen&&!this.options.forcePseudoFullscreen?e.cancelFullScreen(this.options.fullscreenElement?this.options.fullscreenElement:t._container):L.DomUtil.removeClass(t._container,"leaflet-pseudo-fullscreen"),t.invalidateSize(),t.fire("exitFullscreen"),t._exitFired=!0,t._isFullscreen=!1):(e.supportsFullScreen&&!this.options.forcePseudoFullscreen?e.requestFullScreen(this.options.fullscreenElement?this.options.fullscreenElement:t._container):L.DomUtil.addClass(t._container,"leaflet-pseudo-fullscreen"),t.invalidateSize(),t.fire("enterFullscreen"),t._isFullscreen=!0)},_toggleTitle:function(){this.link.title=this._map._isFullscreen?this.options.title:this.options.titleCancel},_handleEscKey:function(){var t=this._map;e.isFullScreen(t)||t._exitFired||(t.fire("exitFullscreen"),t._exitFired=!0,t._isFullscreen=!1)}}),L.Map.addInitHook(function(){this.options.fullscreenControl&&(this.fullscreenControl=L.control.fullscreen(this.options.fullscreenControlOptions),this.addControl(this.fullscreenControl))}),L.control.fullscreen=function(e){return new L.Control.FullScreen(e)};var e={supportsFullScreen:!1,isFullScreen:function(){return!1},requestFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",prefix:""},t="webkit moz o ms khtml".split(" ");if(void 0!==document.exitFullscreen)e.supportsFullScreen=!0;else{for(var n=0,l=t.length;n<l;n++)if(e.prefix=t[n],void 0!==document[e.prefix+"CancelFullScreen"]){e.supportsFullScreen=!0;break}void 0!==document.msExitFullscreen&&(e.prefix="ms",e.supportsFullScreen=!0)}e.supportsFullScreen&&("ms"===e.prefix?e.fullScreenEventName="MSFullscreenChange":e.fullScreenEventName=e.prefix+"fullscreenchange",e.isFullScreen=function(){switch(this.prefix){case"":return document.fullscreen;case"webkit":return document.webkitIsFullScreen;case"ms":return document.msFullscreenElement;default:return document[this.prefix+"FullScreen"]}},e.requestFullScreen=function(e){switch(this.prefix){case"":return e.requestFullscreen();case"ms":return e.msRequestFullscreen();default:return e[this.prefix+"RequestFullScreen"]()}},e.cancelFullScreen=function(){switch(this.prefix){case"":return document.exitFullscreen();case"ms":return document.msExitFullscreen();default:return document[this.prefix+"CancelFullScreen"]()}}),"undefined"!=typeof jQuery&&(jQuery.fn.requestFullScreen=function(){return this.each(function(){var t=jQuery(this);e.supportsFullScreen&&e.requestFullScreen(t)})}),window.fullScreenApi=e}();

View File

@@ -44,8 +44,8 @@ __Events and options__:
L.control.fullscreen({ L.control.fullscreen({
position: 'topleft', // change the position of the button can be topleft, topright, bottomright or bottomleft, defaut topleft position: 'topleft', // change the position of the button can be topleft, topright, bottomright or bottomleft, defaut topleft
title: 'Show me the fullscreen !', // change the title of the button, default Full Screen title: 'Show me the fullscreen !', // change the title of the button, default Full Screen
titleCancel: 'Exit fullscreen mode' // change the title of the button when fullscreen is on, default Exit Full Screen titleCancel: 'Exit fullscreen mode', // change the title of the button when fullscreen is on, default Exit Full Screen
content: null // change the content of the button, can be HTML, default null content: null, // change the content of the button, can be HTML, default null
forceSeparateButton: true, // force seperate button to detach from zoom buttons, default false forceSeparateButton: true, // force seperate button to detach from zoom buttons, default false
forcePseudoFullscreen: true, // force use of pseudo full screen even if full screen API is available, default false forcePseudoFullscreen: true, // force use of pseudo full screen even if full screen API is available, default false
fullscreenElement: false // Dom element to render in full screen, false by default, fallback to map._container fullscreenElement: false // Dom element to render in full screen, false by default, fallback to map._container

View File

@@ -1,6 +1,6 @@
{ {
"name": "leaflet.fullscreen", "name": "leaflet.fullscreen",
"version": "1.4.2", "version": "1.4.3",
"homepage": "https://github.com/brunob/leaflet.fullscreen", "homepage": "https://github.com/brunob/leaflet.fullscreen",
"license": "MIT", "license": "MIT",
"authors": [ "authors": [

View File

@@ -1,6 +1,6 @@
{ {
"name": "leaflet.fullscreen", "name": "leaflet.fullscreen",
"version": "1.4.2", "version": "1.4.3",
"description": "Simple plugin for Leaflet that adds fullscreen button to your maps.", "description": "Simple plugin for Leaflet that adds fullscreen button to your maps.",
"main": "Control.FullScreen.js", "main": "Control.FullScreen.js",
"scripts": { "scripts": {

View File

@@ -3,11 +3,40 @@ 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))
## 1.0.2 (2016-01-27) ## 1.0.6 (2017-06-19)
### Bugfixes
* Fix some issues when used with non-integer zoom [#789](https://github.com/Leaflet/Leaflet.markercluster/issues/789)
* Change examples to use https (by [@ghybs](https://github.com/ghybs)) [#794](https://github.com/Leaflet/Leaflet.markercluster/pull/794)
## 1.0.5 (2017-04-26)
### Improvements ### Improvements
* Support `layeradd` and `layerremove` events [#647](https://github.com/Leaflet/Leaflet.markercluster/issues/647) * Allow passing fitBounds options to zoomToBounds (by [@timkelty](https://github.com/timkelty)) [#779](https://github.com/Leaflet/Leaflet.markercluster/pull/779)
### Bugfixes
* Fixed bug where disableClusteringAtZoom being 0 is treated the same as null (by [@MrCheeze](https://github.com/MrCheeze)) [#773](https://github.com/Leaflet/Leaflet.markercluster/pull/773)
## 1.0.4 (2017-03-14)
### Bugfixes
* Fix errors removing a MarkerClusterGroup from the map during an animation [#758](https://github.com/Leaflet/Leaflet.markercluster/issues/758)
## 1.0.3 (2017-02-02)
### Bugfixes
* Fix moving markers while the MarkerClusterGroup is not on the map [#753](https://github.com/Leaflet/Leaflet.markercluster/issues/753)
## 1.0.2 (2017-01-27)
### Improvements
* Support `layeradd` and `layerremove` events [#647](https://github.com/Leaflet/Leaflet.markercluster/issues/647)
### Bugfixes ### Bugfixes
@@ -17,7 +46,7 @@ Leaflet.markercluster
* 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) * 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) ## 1.0.1 (2017-01-25)
### Improvements ### Improvements
@@ -78,7 +107,7 @@ Leaflet.markercluster
* 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) * 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)
### Improvements ### Improvements
@@ -90,7 +119,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

View File

@@ -48,8 +48,8 @@ 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: 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) * [Download the `v1.1.0` release](https://github.com/Leaflet/Leaflet.markercluster/archive/v1.1.0.zip)
* Use unpkg CDN: `https://unpkg.com/leaflet.markercluster@1.0.0/dist/` * Use unpkg CDN: `https://unpkg.com/leaflet.markercluster@1.1.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: In each case, use files in the `dist` folder:
@@ -61,13 +61,12 @@ In each case, use files in the `dist` folder:
Install jake `npm install -g jake` then run `npm install` Install jake `npm install -g jake` then run `npm install`
* To check the code for errors and build Leaflet from source, run `jake`. * To check the code for errors and build Leaflet from source, run `jake`.
* To run the tests, run `jake test`. * To run the tests, run `jake test`.
* For a custom build, open `build/build.html` in the browser and follow the instructions
### Examples ### 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](https://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.
Or check out the [custom example](http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-custom.html) for how to customise the behaviour and appearance of the clusterer Or check out the [custom example](https://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-custom.html) for how to customise the behaviour and appearance of the clusterer
### Usage ### Usage
Create a new MarkerClusterGroup, add your markers to it, then add it to the map Create a new MarkerClusterGroup, add your markers to it, then add it to the map
@@ -110,7 +109,7 @@ var markers = L.markerClusterGroup({
} }
}); });
``` ```
Check out the [custom example](http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-custom.html) for an example of this. Check out the [custom example](https://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-custom.html) for an example of this.
If you need to update the clusters icon (e.g. they are based on markers real-time data), use the method [refreshClusters()](#refreshing-the-clusters-icon). If you need to update the clusters icon (e.g. they are based on markers real-time data), use the method [refreshClusters()](#refreshing-the-clusters-icon).
@@ -124,13 +123,14 @@ If you need to update the clusters icon (e.g. they are based on markers real-tim
#### Other options #### Other options
* **animateAddingMarkers**: If set to true (and `animate` option is also true) then adding individual markers to the MarkerClusterGroup after it has been added to the map will add the marker and animate it into the cluster. Defaults to false as this gives better performance when bulk adding markers. addLayers does not support this, only addLayer with individual Markers. * **animateAddingMarkers**: If set to true (and `animate` option is also true) then adding individual markers to the MarkerClusterGroup after it has been added to the map will add the marker and animate it into the cluster. Defaults to false as this gives better performance when bulk adding markers. addLayers does not support this, only addLayer with individual Markers.
* **disableClusteringAtZoom**: If set, at this zoom level and below, markers will not be clustered. This defaults to disabled. [See Example](http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld-maxzoom.388.html). Note: you may be interested in disabling `spiderfyOnMaxZoom` option when using `disableClusteringAtZoom`. * **disableClusteringAtZoom**: If set, at this zoom level and below, markers will not be clustered. This defaults to disabled. [See Example](https://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld-maxzoom.388.html). Note: you may be interested in disabling `spiderfyOnMaxZoom` option when using `disableClusteringAtZoom`.
* **maxClusterRadius**: The maximum radius that a cluster will cover from the central marker (in pixels). Default 80. Decreasing will make more, smaller clusters. You can also use a function that accepts the current map zoom and returns the maximum cluster radius in pixels. * **maxClusterRadius**: The maximum radius that a cluster will cover from the central marker (in pixels). Default 80. Decreasing will make more, smaller clusters. You can also use a function that accepts the current map zoom and returns the maximum cluster radius in pixels.
* **polygonOptions**: Options to pass when creating the L.Polygon(points, options) to show the bounds of a cluster. Defaults to empty, which lets Leaflet use the [default Path options](http://leafletjs.com/reference.html#path-options). * **polygonOptions**: Options to pass when creating the L.Polygon(points, options) to show the bounds of a cluster. Defaults to empty, which lets Leaflet use the [default Path options](http://leafletjs.com/reference.html#path-options).
* **singleMarkerMode**: If set to true, overrides the icon for all added markers to make them appear as a 1 size cluster. Note: the markers are not replaced by cluster objects, only their icon is replaced. Hence they still react to normal events, and option `disableClusteringAtZoom` does not restore their previous icon (see [#391](https://github.com/Leaflet/Leaflet.markercluster/issues/391)). * **singleMarkerMode**: If set to true, overrides the icon for all added markers to make them appear as a 1 size cluster. Note: the markers are not replaced by cluster objects, only their icon is replaced. Hence they still react to normal events, and option `disableClusteringAtZoom` does not restore their previous icon (see [#391](https://github.com/Leaflet/Leaflet.markercluster/issues/391)).
* **spiderLegPolylineOptions**: Allows you to specify [PolylineOptions](http://leafletjs.com/reference.html#polyline-options) to style spider legs. By default, they are `{ weight: 1.5, color: '#222', opacity: 0.5 }`. * **spiderLegPolylineOptions**: Allows you to specify [PolylineOptions](http://leafletjs.com/reference.html#polyline-options) to style spider legs. By default, they are `{ weight: 1.5, color: '#222', opacity: 0.5 }`.
* **spiderfyDistanceMultiplier**: Increase from 1 to increase the distance away from the center that spiderfied markers are placed. Use if you are using big marker icons (Default: 1). * **spiderfyDistanceMultiplier**: Increase from 1 to increase the distance away from the center that spiderfied markers are placed. Use if you are using big marker icons (Default: 1).
* **iconCreateFunction**: Function used to create the cluster icon [See default as example](https://github.com/Leaflet/Leaflet.markercluster/blob/15ed12654acdc54a4521789c498e4603fe4bf781/src/MarkerClusterGroup.js#L542). * **iconCreateFunction**: Function used to create the cluster icon. See [the default implementation](https://github.com/Leaflet/Leaflet.markercluster/blob/15ed12654acdc54a4521789c498e4603fe4bf781/src/MarkerClusterGroup.js#L542) or the [custom example](https://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-custom.html).
* **clusterPane**: Map pane where the cluster icons will be added. Defaults to L.Marker's default (currently 'markerPane'). [See the pane example](https://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-pane.html).
#### Chunked addLayers options #### Chunked addLayers options
Options for the [addLayers](#bulk-adding-and-removing-markers) method. See [#357](https://github.com/Leaflet/Leaflet.markercluster/issues/357) for explanation on how the chunking works. Options for the [addLayers](#bulk-adding-and-removing-markers) method. See [#357](https://github.com/Leaflet/Leaflet.markercluster/issues/357) for explanation on how the chunking works.
@@ -235,7 +235,7 @@ markers.on('clusterclick', function (a) {
``` ```
You can also query for the bounding convex polygon. You can also query for the bounding convex polygon.
See [example/marker-clustering-convexhull.html](http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-convexhull.html) for a working example. See [example/marker-clustering-convexhull.html](https://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-convexhull.html) for a working example.
```javascript ```javascript
markers.on('clusterclick', function (a) { markers.on('clusterclick', function (a) {
map.addLayer(L.polygon(a.layer.getConvexHull())); map.addLayer(L.polygon(a.layer.getConvexHull()));
@@ -245,10 +245,12 @@ markers.on('clusterclick', function (a) {
#### Zooming to the bounds of a cluster #### Zooming to the bounds of a cluster
When you receive an event from a cluster you can zoom to its bounds in one easy step. When you receive an event from a cluster you can zoom to its bounds in one easy step.
If all of the markers will appear at a higher zoom level, that zoom level is zoomed to instead. If all of the markers will appear at a higher zoom level, that zoom level is zoomed to instead.
See [marker-clustering-zoomtobounds.html](http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-zoomtobounds.html) for a working example. `zoomToBounds` takes an optional argument to pass [options to the resulting `fitBounds` call](http://leafletjs.com/reference.html#map-fitboundsoptions).
See [marker-clustering-zoomtobounds.html](https://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-zoomtobounds.html) for a working example.
```javascript ```javascript
markers.on('clusterclick', function (a) { markers.on('clusterclick', function (a) {
a.layer.zoomToBounds(); a.layer.zoomToBounds({padding: [20, 20]});
}); });
``` ```
@@ -260,8 +262,8 @@ markers.on('clusterclick', function (a) {
## Handling LOTS of markers ## Handling LOTS of markers
The Clusterer can handle 10,000 or even 50,000 markers (in chrome). IE9 has some issues with 50,000. The Clusterer can handle 10,000 or even 50,000 markers (in chrome). IE9 has some issues with 50,000.
- [realworld 10,000 example](http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.10000.html) - [realworld 10,000 example](https://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.10000.html)
- [realworld 50,000 example](http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.50000.html) - [realworld 50,000 example](https://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.50000.html)
Note: these two examples use the `chunkedLoading` option set to true in order to avoid locking the browser for a long time. Note: these two examples use the `chunkedLoading` option set to true in order to avoid locking the browser for a long time.
@@ -286,3 +288,4 @@ Check also the below sub-plugins:
| [Leaflet.FeatureGroup.SubGroup](https://github.com/ghybs/Leaflet.FeatureGroup.SubGroup) | Creates a Feature Group that adds its child layers into a parent group when added to a map (e.g. through L.Control.Layers). Typical usage is to dynamically add/remove groups of markers from Marker Cluster. | [ghybs](https://github.com/ghybs) | | [Leaflet.FeatureGroup.SubGroup](https://github.com/ghybs/Leaflet.FeatureGroup.SubGroup) | Creates a Feature Group that adds its child layers into a parent group when added to a map (e.g. through L.Control.Layers). Typical usage is to dynamically add/remove groups of markers from Marker Cluster. | [ghybs](https://github.com/ghybs) |
| [Leaflet.MarkerCluster.LayerSupport](https://github.com/ghybs/Leaflet.MarkerCluster.LayerSupport) | Brings compatibility with L.Control.Layers and other Leaflet plugins. I.e. everything that uses direct calls to map.addLayer and map.removeLayer. | [ghybs](https://github.com/ghybs) | | [Leaflet.MarkerCluster.LayerSupport](https://github.com/ghybs/Leaflet.MarkerCluster.LayerSupport) | Brings compatibility with L.Control.Layers and other Leaflet plugins. I.e. everything that uses direct calls to map.addLayer and map.removeLayer. | [ghybs](https://github.com/ghybs) |
| [Leaflet.MarkerCluster.Freezable](https://github.com/ghybs/Leaflet.MarkerCluster.Freezable) | Adds the ability to freeze clusters at a specified zoom. E.g. freezing at maxZoom + 1 makes as if clustering was programmatically disabled. | [ghybs](https://github.com/ghybs) | | [Leaflet.MarkerCluster.Freezable](https://github.com/ghybs/Leaflet.MarkerCluster.Freezable) | Adds the ability to freeze clusters at a specified zoom. E.g. freezing at maxZoom + 1 makes as if clustering was programmatically disabled. | [ghybs](https://github.com/ghybs) |
| [Leaflet.MarkerCluster.PlacementStrategies](https://github.com/adammertel/Leaflet.MarkerCluster.PlacementStrategies) | Implements new strategies to position clustered markers (eg: clock, concentric circles, ...). Recommended to use with circleMarkers. [Demo](https://adammertel.github.io/Leaflet.MarkerCluster.PlacementStrategies/demo/demo1.html) | [adammertel](https://github.com/adammertel) / [UNIVIE](http://carto.univie.ac.at/) |

View File

@@ -1,6 +1,6 @@
{ {
"name": "leaflet.markercluster", "name": "leaflet.markercluster",
"version": "1.0.2", "version": "1.0.6",
"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>"

View File

@@ -1,17 +1,25 @@
/* /*
Leaflet.markercluster, Provides Beautiful Animated Marker Clustering functionality for Leaflet, a JS library for interactive maps. * Leaflet.markercluster 1.3.0+master.5b36e91,
https://github.com/Leaflet/Leaflet.markercluster * Provides Beautiful Animated Marker Clustering functionality for Leaflet, a JS library for interactive maps.
(c) 2012-2013, Dave Leaver, smartrak * https://github.com/Leaflet/Leaflet.markercluster
*/ * (c) 2012-2017, Dave Leaver, smartrak
(function (window, document, undefined) {/* */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.Leaflet = global.Leaflet || {}, global.Leaflet.markercluster = global.Leaflet.markercluster || {})));
}(this, (function (exports) { 'use strict';
/*
* L.MarkerClusterGroup extends L.FeatureGroup by clustering the markers contained within * L.MarkerClusterGroup extends L.FeatureGroup by clustering the markers contained within
*/ */
L.MarkerClusterGroup = L.FeatureGroup.extend({ var MarkerClusterGroup = L.MarkerClusterGroup = L.FeatureGroup.extend({
options: { options: {
maxClusterRadius: 80, //A cluster will cover at most this many pixels from its center maxClusterRadius: 80, //A cluster will cover at most this many pixels from its center
iconCreateFunction: null, iconCreateFunction: null,
clusterPane: L.Marker.prototype.options.pane,
spiderfyOnMaxZoom: true, spiderfyOnMaxZoom: true,
showCoverageOnHover: true, showCoverageOnHover: true,
@@ -154,7 +162,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
if (!this._map) { if (!this._map) {
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: layer, latlng: layer._latlng });
} }
this.fire('layerremove', { layer: layer }); this.fire('layerremove', { layer: layer });
return this; return this;
@@ -344,7 +352,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
this._arraySplice(this._needsClustering, m); this._arraySplice(this._needsClustering, m);
npg.removeLayer(m); npg.removeLayer(m);
if (this.hasLayer(m)) { if (this.hasLayer(m)) {
this._needsRemoving.push(m); this._needsRemoving.push({ layer: m, latlng: m._latlng });
} }
this.fire('layerremove', { layer: m }); this.fire('layerremove', { layer: m });
} }
@@ -466,14 +474,23 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
eachLayer: function (method, context) { eachLayer: function (method, context) {
var markers = this._needsClustering.slice(), var markers = this._needsClustering.slice(),
needsRemoving = this._needsRemoving, needsRemoving = this._needsRemoving,
i; thisNeedsRemoving, i, j;
if (this._topClusterLevel) { if (this._topClusterLevel) {
this._topClusterLevel.getAllChildMarkers(markers); this._topClusterLevel.getAllChildMarkers(markers);
} }
for (i = markers.length - 1; i >= 0; i--) { for (i = markers.length - 1; i >= 0; i--) {
if (needsRemoving.indexOf(markers[i]) === -1) { thisNeedsRemoving = true;
for (j = needsRemoving.length - 1; j >= 0; j--) {
if (needsRemoving[j].layer === markers[i]) {
thisNeedsRemoving = false;
break;
}
}
if (thisNeedsRemoving) {
method.call(context, markers[i]); method.call(context, markers[i]);
} }
} }
@@ -493,7 +510,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
//Overrides LayerGroup.getLayer, WARNING: Really bad performance //Overrides LayerGroup.getLayer, WARNING: Really bad performance
getLayer: function (id) { getLayer: function (id) {
var result = null; var result = null;
id = parseInt(id, 10); id = parseInt(id, 10);
this.eachLayer(function (l) { this.eachLayer(function (l) {
@@ -521,7 +538,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
anArray = this._needsRemoving; anArray = this._needsRemoving;
for (i = anArray.length - 1; i >= 0; i--) { for (i = anArray.length - 1; i >= 0; i--) {
if (anArray[i] === layer) { if (anArray[i].layer === layer) {
return false; return false;
} }
} }
@@ -582,9 +599,17 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
this._maxLat = map.options.crs.projection.MAX_LATITUDE; this._maxLat = map.options.crs.projection.MAX_LATITUDE;
//Restore all the positions as they are in the MCG before removing them
for (i = 0, l = this._needsRemoving.length; i < l; i++) { for (i = 0, l = this._needsRemoving.length; i < l; i++) {
layer = this._needsRemoving[i]; layer = this._needsRemoving[i];
this._removeLayer(layer, true); layer.newlatlng = layer.layer._latlng;
layer.layer._latlng = layer.latlng;
}
//Remove them, then restore their new positions
for (i = 0, l = this._needsRemoving.length; i < l; i++) {
layer = this._needsRemoving[i];
this._removeLayer(layer.layer, true);
layer.layer._latlng = layer.newlatlng;
} }
this._needsRemoving = []; this._needsRemoving = [];
@@ -660,7 +685,7 @@ 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(); minZoom = Math.floor(this._map.getMinZoom());
for (; z >= minZoom; 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))) {
@@ -699,7 +724,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
} }
delete e.target.__dragStart; 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)
@@ -708,7 +733,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
gridUnclustered = this._gridUnclustered, gridUnclustered = this._gridUnclustered,
fg = this._featureGroup, fg = this._featureGroup,
map = this._map, map = this._map,
minZoom = this._map.getMinZoom(); minZoom = Math.floor(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) {
@@ -901,7 +926,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
var newBounds = this._getExpandedVisibleBounds(); var newBounds = this._getExpandedVisibleBounds();
this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, this._zoom, newBounds); this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), this._zoom, newBounds);
this._topClusterLevel._recursivelyAddChildrenToMap(null, Math.round(this._map._zoom), newBounds); this._topClusterLevel._recursivelyAddChildrenToMap(null, Math.round(this._map._zoom), newBounds);
this._currentShownBounds = newBounds; this._currentShownBounds = newBounds;
@@ -909,11 +934,11 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
}, },
_generateInitialClusters: function () { _generateInitialClusters: function () {
var maxZoom = this._map.getMaxZoom(), var maxZoom = Math.ceil(this._map.getMaxZoom()),
minZoom = this._map.getMinZoom(), minZoom = Math.floor(this._map.getMinZoom()),
radius = this.options.maxClusterRadius, radius = this.options.maxClusterRadius,
radiusFn = radius; radiusFn = radius;
//If we just set maxClusterRadius to a single number, we need to create //If we just set maxClusterRadius to a single number, we need to create
//a simple function to return that number. Otherwise, we just have to //a simple function to return that number. Otherwise, we just have to
//use the function we've passed in. //use the function we've passed in.
@@ -921,13 +946,13 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
radiusFn = function () { return radius; }; radiusFn = function () { return radius; };
} }
if (this.options.disableClusteringAtZoom) { if (this.options.disableClusteringAtZoom !== null) {
maxZoom = this.options.disableClusteringAtZoom - 1; maxZoom = this.options.disableClusteringAtZoom - 1;
} }
this._maxZoom = maxZoom; this._maxZoom = maxZoom;
this._gridClusters = {}; this._gridClusters = {};
this._gridUnclustered = {}; this._gridUnclustered = {};
//Set up DistanceGrids for each zoom //Set up DistanceGrids for each zoom
for (var zoom = maxZoom; zoom >= minZoom; zoom--) { for (var zoom = maxZoom; zoom >= minZoom; zoom--) {
this._gridClusters[zoom] = new L.DistanceGrid(radiusFn(zoom)); this._gridClusters[zoom] = new L.DistanceGrid(radiusFn(zoom));
@@ -942,7 +967,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
_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(), minZoom = Math.floor(this._map.getMinZoom()),
markerPoint, z; markerPoint, z;
if (this.options.singleMarkerMode) { if (this.options.singleMarkerMode) {
@@ -1041,7 +1066,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
if (this._zoom < mapZoom && this._currentShownBounds.intersects(this._getExpandedVisibleBounds())) { //Zoom in, split if (this._zoom < mapZoom && this._currentShownBounds.intersects(this._getExpandedVisibleBounds())) { //Zoom in, split
this._animationStart(); this._animationStart();
//Remove clusters now off screen //Remove clusters now off screen
this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, this._zoom, this._getExpandedVisibleBounds()); this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), this._zoom, this._getExpandedVisibleBounds());
this._animationZoomIn(this._zoom, mapZoom); this._animationZoomIn(this._zoom, mapZoom);
@@ -1165,14 +1190,14 @@ L.MarkerClusterGroup.include({
//Do nothing... //Do nothing...
}, },
_animationZoomIn: function (previousZoomLevel, newZoomLevel) { _animationZoomIn: function (previousZoomLevel, newZoomLevel) {
this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, previousZoomLevel); this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), previousZoomLevel);
this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds()); this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());
//We didn't actually animate, but we use this event to mean "clustering animations have finished" //We didn't actually animate, but we use this event to mean "clustering animations have finished"
this.fire('animationend'); this.fire('animationend');
}, },
_animationZoomOut: function (previousZoomLevel, newZoomLevel) { _animationZoomOut: function (previousZoomLevel, newZoomLevel) {
this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, previousZoomLevel); this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), previousZoomLevel);
this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds()); this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());
//We didn't actually animate, but we use this event to mean "clustering animations have finished" //We didn't actually animate, but we use this event to mean "clustering animations have finished"
@@ -1193,7 +1218,7 @@ 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(), minZoom = Math.floor(this._map.getMinZoom()),
i; i;
this._ignoreMove = true; this._ignoreMove = true;
@@ -1264,7 +1289,7 @@ L.MarkerClusterGroup.include({
//Need to add markers for those that weren't on the map before but are now //Need to add markers for those that weren't on the map before but are now
this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds()); this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());
//Remove markers that were on the map before but won't be now //Remove markers that were on the map before but won't be now
this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, previousZoomLevel, this._getExpandedVisibleBounds()); this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), previousZoomLevel, this._getExpandedVisibleBounds());
}, },
_animationAddLayer: function (layer, newCluster) { _animationAddLayer: function (layer, newCluster) {
@@ -1302,10 +1327,10 @@ 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(); minZoom = Math.floor(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, minZoom, previousZoomLevel + 1, newZoomLevel);
var me = this; var me = this;
@@ -1329,7 +1354,7 @@ L.MarkerClusterGroup.include({
} }
} else { } else {
cluster._recursively(bounds, newZoomLevel, minZoom, function (c) { cluster._recursively(bounds, newZoomLevel, minZoom, function (c) {
c._recursivelyRemoveChildrenFromMap(bounds, previousZoomLevel + 1); c._recursivelyRemoveChildrenFromMap(bounds, minZoom, previousZoomLevel + 1);
}); });
} }
me._animationEnd(); me._animationEnd();
@@ -1358,12 +1383,13 @@ L.markerClusterGroup = function (options) {
return new L.MarkerClusterGroup(options); return new L.MarkerClusterGroup(options);
}; };
var MarkerCluster = L.MarkerCluster = L.Marker.extend({
options: L.Icon.prototype.options,
L.MarkerCluster = L.Marker.extend({
initialize: function (group, zoom, a, b) { initialize: function (group, zoom, a, b) {
L.Marker.prototype.initialize.call(this, a ? (a._cLatLng || a.getLatLng()) : new L.LatLng(0, 0), { icon: this }); L.Marker.prototype.initialize.call(this, a ? (a._cLatLng || a.getLatLng()) : new L.LatLng(0, 0),
{ icon: this, pane: group.options.clusterPane });
this._group = group; this._group = group;
this._zoom = zoom; this._zoom = zoom;
@@ -1405,7 +1431,7 @@ L.MarkerCluster = L.Marker.extend({
}, },
//Zoom to the minimum of showing all of the child markers, or the extents of this cluster //Zoom to the minimum of showing all of the child markers, or the extents of this cluster
zoomToBounds: function () { zoomToBounds: function (fitBoundsOptions) {
var childClusters = this._childClusters.slice(), var childClusters = this._childClusters.slice(),
map = this._group._map, map = this._group._map,
boundsZoom = map.getBoundsZoom(this._bounds), boundsZoom = map.getBoundsZoom(this._bounds),
@@ -1428,7 +1454,7 @@ L.MarkerCluster = L.Marker.extend({
} else if (boundsZoom <= mapZoom) { //If fitBounds wouldn't zoom us down, zoom us down instead } else if (boundsZoom <= mapZoom) { //If fitBounds wouldn't zoom us down, zoom us down instead
this._group._map.setView(this._latlng, mapZoom + 1); this._group._map.setView(this._latlng, mapZoom + 1);
} else { } else {
this._group._map.fitBounds(this._bounds); this._group._map.fitBounds(this._bounds, fitBoundsOptions);
} }
}, },
@@ -1602,8 +1628,8 @@ L.MarkerCluster = L.Marker.extend({
); );
}, },
_recursivelyAnimateChildrenInAndAddSelfToMap: function (bounds, previousZoomLevel, newZoomLevel) { _recursivelyAnimateChildrenInAndAddSelfToMap: function (bounds, mapMinZoom, previousZoomLevel, newZoomLevel) {
this._recursively(bounds, newZoomLevel, this._group._map.getMinZoom(), this._recursively(bounds, newZoomLevel, mapMinZoom,
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);
@@ -1611,7 +1637,7 @@ L.MarkerCluster = L.Marker.extend({
//As a hack we only do a animation free zoom on a single level zoom, if someone does multiple levels then we always animate //As a hack we only do a animation free zoom on a single level zoom, if someone does multiple levels then we always animate
if (c._isSingleParent() && previousZoomLevel - 1 === newZoomLevel) { if (c._isSingleParent() && previousZoomLevel - 1 === newZoomLevel) {
c.clusterShow(); c.clusterShow();
c._recursivelyRemoveChildrenFromMap(bounds, previousZoomLevel); //Immediately remove our children as we are replacing them. TODO previousBounds not bounds c._recursivelyRemoveChildrenFromMap(bounds, mapMinZoom, previousZoomLevel); //Immediately remove our children as we are replacing them. TODO previousBounds not bounds
} else { } else {
c.clusterHide(); c.clusterHide();
} }
@@ -1690,9 +1716,9 @@ 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, mapMinZoom, zoomLevel, exceptBounds) {
var m, i; var m, i;
this._recursively(previousBounds, this._group._map.getMinZoom() - 1, zoomLevel - 1, this._recursively(previousBounds, mapMinZoom - 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--) {
@@ -1757,8 +1783,6 @@ L.MarkerCluster = L.Marker.extend({
} }
}); });
/* /*
* Extends L.Marker to include two extra methods: clusterHide and clusterShow. * Extends L.Marker to include two extra methods: clusterHide and clusterShow.
* *
@@ -1783,10 +1807,6 @@ L.Marker.include({
}); });
L.DistanceGrid = function (cellSize) { L.DistanceGrid = function (cellSize) {
this._cellSize = cellSize; this._cellSize = cellSize;
this._sqCellSize = cellSize * cellSize; this._sqCellSize = cellSize * cellSize;
@@ -1880,7 +1900,8 @@ L.DistanceGrid.prototype = {
for (k = 0, len = cell.length; k < len; k++) { for (k = 0, len = cell.length; k < len; k++) {
obj = cell[k]; obj = cell[k];
dist = this._sqDist(objectPoint[L.Util.stamp(obj)], point); dist = this._sqDist(objectPoint[L.Util.stamp(obj)], point);
if (dist < closestDistSq) { if (dist < closestDistSq ||
dist <= closestDistSq && closest === null) {
closestDistSq = dist; closestDistSq = dist;
closest = obj; closest = obj;
} }
@@ -1893,7 +1914,8 @@ L.DistanceGrid.prototype = {
}, },
_getCoord: function (x) { _getCoord: function (x) {
return Math.floor(x / this._cellSize); var coord = Math.floor(x / this._cellSize);
return isFinite(coord) ? coord : x;
}, },
_sqDist: function (p, p2) { _sqDist: function (p, p2) {
@@ -1903,7 +1925,6 @@ L.DistanceGrid.prototype = {
} }
}; };
/* Copyright (c) 2012 the authors listed at the following URL, and/or /* Copyright (c) 2012 the authors listed at the following URL, and/or
the authors of referenced articles or incorporated external code: the authors of referenced articles or incorporated external code:
http://en.literateprograms.org/Quickhull_(Javascript)?action=history&offset=20120410175256 http://en.literateprograms.org/Quickhull_(Javascript)?action=history&offset=20120410175256
@@ -2070,7 +2091,6 @@ L.MarkerCluster.include({
} }
}); });
//This code is 100% based on https://github.com/jawj/OverlappingMarkerSpiderfier-Leaflet //This code is 100% based on https://github.com/jawj/OverlappingMarkerSpiderfier-Leaflet
//Huge thanks to jawj for implementing it first to make my job easy :-) //Huge thanks to jawj for implementing it first to make my job easy :-)
@@ -2078,7 +2098,7 @@ L.MarkerCluster.include({
_2PI: Math.PI * 2, _2PI: Math.PI * 2,
_circleFootSeparation: 25, //related to circumference of circle _circleFootSeparation: 25, //related to circumference of circle
_circleStartAngle: Math.PI / 6, _circleStartAngle: 0,
_spiralFootSeparation: 28, //related to size of spiral (experiment!) _spiralFootSeparation: 28, //related to size of spiral (experiment!)
_spiralLengthStart: 11, _spiralLengthStart: 11,
@@ -2130,9 +2150,11 @@ L.MarkerCluster.include({
res = [], res = [],
i, angle; i, angle;
legLength = Math.max(legLength, 35); // Minimum distance to get outside the cluster icon.
res.length = count; res.length = count;
for (i = count - 1; i >= 0; i--) { for (i = 0; i < count; i++) { // Clockwise, like spiral.
angle = this._circleStartAngle + i * angleStep; angle = this._circleStartAngle + i * angleStep;
res[i] = new L.Point(centerPt.x + legLength * Math.cos(angle), centerPt.y + legLength * Math.sin(angle))._round(); res[i] = new L.Point(centerPt.x + legLength * Math.cos(angle), centerPt.y + legLength * Math.sin(angle))._round();
} }
@@ -2152,9 +2174,13 @@ L.MarkerCluster.include({
res.length = count; res.length = count;
// Higher index, closer position to cluster center. // Higher index, closer position to cluster center.
for (i = count - 1; i >= 0; i--) { for (i = count; i >= 0; i--) {
// Skip the first position, so that we are already farther from center and we avoid
// being under the default cluster icon (especially important for Circle Markers).
if (i < count) {
res[i] = new L.Point(centerPt.x + legLength * Math.cos(angle), centerPt.y + legLength * Math.sin(angle))._round();
}
angle += separation / legLength + i * 0.0005; angle += separation / legLength + i * 0.0005;
res[i] = new L.Point(centerPt.x + legLength * Math.cos(angle), centerPt.y + legLength * Math.sin(angle))._round();
legLength += lengthFactor / angle; legLength += lengthFactor / angle;
} }
return res; return res;
@@ -2541,7 +2567,6 @@ L.MarkerClusterGroup.include({
} }
}); });
/** /**
* Adds 1 public method to MCG and 1 to L.Marker to facilitate changing * Adds 1 public method to MCG and 1 to L.Marker to facilitate changing
* markers' icon options and refreshing their icon and their parent clusters * markers' icon options and refreshing their icon and their parent clusters
@@ -2653,5 +2678,8 @@ L.Marker.include({
} }
}); });
exports.MarkerClusterGroup = MarkerClusterGroup;
exports.MarkerCluster = MarkerCluster;
}(window, document)); })));
//# sourceMappingURL=leaflet.markercluster-src.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -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.2", "version": "1.1.0",
"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",

View File

@@ -0,0 +1,122 @@
.marker-icon,
.marker-icon:focus {
background-color: #ffffff;
border: 1px solid #3388ff;
border-radius: 50%;
margin: -8px 0 0 -8px !important;
width: 14px !important;
height: 14px !important;
outline: 0;
transition: opacity ease 0.3s;
}
.marker-icon-middle,
.marker-icon-middle:focus {
opacity: 0.7;
margin: -6px 0 0 -6px !important;
width: 10px !important;
height: 10px !important;
}
.leaflet-pm-draggable {
cursor: move !important;
}
.cursor-marker {
cursor: crosshair;
pointer-events: none;
display: none;
}
.cursor-marker.visible {
display: block !important;
}
.leaflet-pm-invalid {
stroke: red;
transition: fill ease 0s, stroke ease 0s;
}
.rect-style-marker,
.rect-start-marker {
opacity: 0;
}
.rect-style-marker.visible,
.rect-start-marker.visible {
opacity: 1 !important;
}
.hidden {
display: none;
}
.leaflet-pm-toolbar {
}
.leaflet-pm-toolbar .leaflet-buttons-control-button {
padding: 3px;
box-sizing: border-box;
}
.leaflet-pm-toolbar .control-icon {
width: 100%;
height: 100%;
box-sizing: border-box;
opacity: .8;
background-size: contain;
background-repeat: no-repeat;
background-position: center center;
}
.leaflet-pm-toolbar .leaflet-pm-icon-marker {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAZCAYAAADTyxWqAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABAhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG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Eb2N1bWVudElEPSJ4bXAuZGlkOkM4QUVDQzQ2ODUzNDExRTU4RTQwRkQwODFEOUZEMEE3IiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkM4QUVDQzQ1ODUzNDExRTU4RTQwRkQwODFEOUZEMEE3IiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE1IChNYWNpbnRvc2gpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MTk5NzA1OGEtZDI3OC00NDZkLWE4ODgtNGM4MGQ4YWI1NzNmIiBzdFJlZjpkb2N1bWVudElEPSJhZG9iZTpkb2NpZDpwaG90b3Nob3A6YzRkZmQxMGMtY2NlNS0xMTc4LWE5OGQtY2NkZmM5ODk5YWYwIi8+IDxkYzp0aXRsZT4gPHJkZjpBbHQ+IDxyZGY6bGkgeG1sOmxhbmc9IngtZGVmYXVsdCI+Z2x5cGhpY29uczwvcmRmOmxpPiA8L3JkZjpBbHQ+IDwvZGM6dGl0bGU+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+J3lsvQAAAFpJREFUeNrsljsOACAIQ1sPyGG9IJq4IKOfQdNuhuQ90gUJwBHi7sRGSE48DuaA5uFqIq/gcpgr6rFNZo2Pkjq3A0tbrOp6RRJIIIEEEjxxcD68yae/LU2AAQC7fSa9H1rL6AAAAABJRU5ErkJggg==);
background-size: 90%;
}
.leaflet-pm-toolbar .leaflet-pm-icon-drag {
/*background-image: url('../assets/icons/drag.png');*/
}
.leaflet-pm-toolbar .leaflet-pm-icon-delete {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAaCAYAAAC3g3x9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABAhpVFh0WE1MOmNvbS5hZG9iZS54b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CKLqBG9RWi+F6aqBwTd4PaPkeIbY6RHQ9RRFIkTTs6z/AUbSySU/4tAMPcDKJKTmS5ixRIga95TzIHiiTkOBogA8KjsokSP68ORieBW4uMGU1x2ZHOKi6eoNSuMmgBl5tUAuvMrDAiw1Uh/7A0ydrMpA+0R36Bedci8F60aGg8mgykPly2aFZDbYYRDUePhc1NgMeZOdEzFq/1sBLAS+8U+G952k5u4egmtvzHC/SIoWgkwXwdGZ5qrOMa63x9gkbfjgoZ8anJt0EGAAZUK4sZc82dAAAAABJRU5ErkJggg==);
background-size: 80%;
background-position: 4px center;
}
.leaflet-pm-toolbar .leaflet-pm-icon-cut {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAXCAYAAAD+4+QTAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABAhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDY3IDc5LjE1Nzc0NywgMjAxNS8wMy8zMC0yMzo0MDo0MiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRw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kedBOJMlaBN4GsRZWViL6IwnknoJfG0kmSAZFmqxPRKvJgYpGbYAB0kC6urE9wJy51O7F5HaUHv3Ptl6QB7e8WtImGCUpaeo/zmFL84faJeiv1KR7fyb8Rd3vObquzqUZ/2tvAQYANwXksvfGBuLAAAAAElFTkSuQmCC);
background-size: 80%;
background-position: 4px center;
}
.leaflet-buttons-control-button:hover {
cursor: pointer;
background-color: #f4f4f4;
}
.leaflet-buttons-control-button.active {
background-color: #f4f4f4;
}
.leaflet-buttons-control-button.active > .control-icon {
opacity: .5;
}
.leaflet-buttons-control-text-hide {
display: none;
}

1
assets/leaflet-pm/leaflet.pm.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1,9 +1,25 @@
# Leaflet-providers changelog # Leaflet-providers changelog
## 1.1.17 (2017-06-29)
- Added `maxZoom` for `Hydda` provider [242](https://github.com/leaflet-extras/leaflet-providers/pull/242)
- Fixed `maxZoom` for all layers from the `thunderforest` provider
- Added protocol relativity to the url for `OpenStreetMap.DE` variant.
- Added `OpenStreetMap.BZH` [#255](https://github.com/leaflet-extras/leaflet-providers/pull/255)
- Added `nlmaps` provider [#254](https://github.com/leaflet-extras/leaflet-providers/pull/254)
## 1.1.16 (2016-11-04)
- Updates to reflect changes in [BasemapAT](http://leaflet-extras.github.io/leaflet-providers/preview/#filter=BasemapAT) by [@ximex](https://github.com/ximex), [#232]((https://github.com/leaflet-extras/leaflet-providers/pull/232), [#233]((https://github.com/leaflet-extras/leaflet-providers/pull/233)
- Bump leaflet version in tests and preview to 1.0.1.
- Added some layers from http://justicemap.org [#224](https://github.com/leaflet-extras/leaflet-providers/pull/224).
## 1.1.15 (2016-08-09)
- [Stamen terrain](http://leaflet-extras.github.io/leaflet-providers/preview/#filter=Stamen.Terrain) now has world coverage [#223](https://github.com/leaflet-extras/leaflet-providers/pull/223)
- OSM France `maxZoom`: 20 ([#222](https://github.com/leaflet-extras/leaflet-providers/pull/222), fixes [#221](https://github.com/leaflet-extras/leaflet-providers/issues/221))
## 1.1.14 (2016-07-15) ## 1.1.14 (2016-07-15)
- Remove MapQuest, fixes #219 - Remove MapQuest, fixes #219
- Accidently skipped v1.1.12 and v1.1.13 - Accidently skipped v1.1.12 and v1.1.13
## 1.1.11 (2016-06-04) ## 1.1.11 (2016-06-04)
- Added protocol relativity to OSM FR, OSM HOT and Hydda providers (#214, #215). - Added protocol relativity to OSM FR, OSM HOT and Hydda providers (#214, #215).

View File

@@ -1,6 +1,6 @@
{ {
"name": "leaflet-providers", "name": "leaflet-providers",
"version": "1.1.15", "version": "1.1.17",
"homepage": "https://github.com/leaflet-extras/leaflet-providers", "homepage": "https://github.com/leaflet-extras/leaflet-providers",
"description": "An extension to Leaflet that contains configurations for various free tile providers.", "description": "An extension to Leaflet that contains configurations for various free tile providers.",
"dependencies": { "dependencies": {

View File

@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- Leaflet style. REQUIRED! --> <!-- Leaflet style. REQUIRED! -->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.0-rc.1/leaflet.css" /> <link rel="stylesheet" href="http://unpkg.com/leaflet@1.0.3/dist/leaflet.css" />
<style> <style>
html { height: 100% } html { height: 100% }
body { height: 100%; margin: 0; padding: 0;} body { height: 100%; margin: 0; padding: 0;}
@@ -26,7 +26,7 @@
</div> </div>
<div id="map" class="map"></div> <div id="map" class="map"></div>
<script src="//cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.0-rc.1/leaflet.js"></script> <script src="http://unpkg.com/leaflet@1.0.3/dist/leaflet.js"></script>
<script src="leaflet-providers.js"></script> <script src="leaflet-providers.js"></script>
<script> <script>
var map = L.map('map', { var map = L.map('map', {
@@ -46,7 +46,6 @@
'Thunderforest Transport': L.tileLayer.provider('Thunderforest.Transport'), 'Thunderforest Transport': L.tileLayer.provider('Thunderforest.Transport'),
'Thunderforest Landscape': L.tileLayer.provider('Thunderforest.Landscape'), 'Thunderforest Landscape': L.tileLayer.provider('Thunderforest.Landscape'),
'Hydda Full': L.tileLayer.provider('Hydda.Full'), 'Hydda Full': L.tileLayer.provider('Hydda.Full'),
'MapBox Example': L.tileLayer.provider('MapBox', {id: 'mapbox.streets', accessToken: 'pk.eyJ1IjoiZ3V0ZW55ZSIsImEiOiJmNjJlMDNmYTUyMzNjMzQxZmY4Mzc1ZmFiYmExNjMxOSJ9.xgl1PBwQV9CtwW-usedrcQ'}),
'Stamen Toner': L.tileLayer.provider('Stamen.Toner'), 'Stamen Toner': L.tileLayer.provider('Stamen.Toner'),
'Stamen Terrain': L.tileLayer.provider('Stamen.Terrain'), 'Stamen Terrain': L.tileLayer.provider('Stamen.Terrain'),
'Stamen Watercolor': L.tileLayer.provider('Stamen.Watercolor'), 'Stamen Watercolor': L.tileLayer.provider('Stamen.Watercolor'),

View File

@@ -110,7 +110,7 @@
} }
}, },
DE: { DE: {
url: 'http://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png', url: '//{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png',
options: { options: {
maxZoom: 18 maxZoom: 18
} }
@@ -144,30 +144,29 @@
} }
}, },
Thunderforest: { Thunderforest: {
url: '//{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png', url: '//{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png?apikey={apikey}',
options: { options: {
attribution: attribution:
'&copy; <a href="http://www.thunderforest.com/">Thunderforest</a>, {attribution.OpenStreetMap}', '&copy; <a href="http://www.thunderforest.com/">Thunderforest</a>, {attribution.OpenStreetMap}',
variant: 'cycle' variant: 'cycle',
apikey: '<insert your api key here>',
maxZoom: 22
}, },
variants: { variants: {
OpenCycleMap: 'cycle', OpenCycleMap: 'cycle',
Transport: { Transport: {
options: { options: {
variant: 'transport', variant: 'transport'
maxZoom: 19
} }
}, },
TransportDark: { TransportDark: {
options: { options: {
variant: 'transport-dark', variant: 'transport-dark'
maxZoom: 19
} }
}, },
SpinalMap: { SpinalMap: {
options: { options: {
variant: 'spinal-map', variant: 'spinal-map'
maxZoom: 11
} }
}, },
Landscape: 'landscape', Landscape: 'landscape',
@@ -201,6 +200,7 @@
Hydda: { Hydda: {
url: '//{s}.tile.openstreetmap.se/hydda/{variant}/{z}/{x}/{y}.png', url: '//{s}.tile.openstreetmap.se/hydda/{variant}/{z}/{x}/{y}.png',
options: { options: {
maxZoom: 18,
variant: 'full', variant: 'full',
attribution: 'Tiles courtesy of <a href="http://openstreetmap.se/" target="_blank">OpenStreetMap Sweden</a> &mdash; Map data {attribution.OpenStreetMap}' attribution: 'Tiles courtesy of <a href="http://openstreetmap.se/" target="_blank">OpenStreetMap Sweden</a> &mdash; Map data {attribution.OpenStreetMap}'
}, },
@@ -216,7 +216,9 @@
attribution: attribution:
'Imagery from <a href="http://mapbox.com/about/maps/">MapBox</a> &mdash; ' + 'Imagery from <a href="http://mapbox.com/about/maps/">MapBox</a> &mdash; ' +
'Map data {attribution.OpenStreetMap}', 'Map data {attribution.OpenStreetMap}',
subdomains: 'abcd' subdomains: 'abcd',
id: 'streets',
accessToken: '<insert your access token here>',
} }
}, },
Stamen: { Stamen: {
@@ -528,7 +530,7 @@
} }
}, },
BasemapAT: { BasemapAT: {
url: '//maps{s}.wien.gv.at/basemap/{variant}/normal/google3857/{z}/{y}/{x}.{format}', url: 'https://maps{s}.wien.gv.at/basemap/{variant}/normal/google3857/{z}/{y}/{x}.{format}',
options: { options: {
maxZoom: 19, maxZoom: 19,
attribution: 'Datenquelle: <a href="www.basemap.at">basemap.at</a>', attribution: 'Datenquelle: <a href="www.basemap.at">basemap.at</a>',
@@ -538,7 +540,12 @@
variant: 'geolandbasemap' variant: 'geolandbasemap'
}, },
variants: { variants: {
basemap: 'geolandbasemap', basemap: {
options: {
maxZoom: 20, // currently only in Vienna
variant: 'geolandbasemap'
}
},
grau: 'bmapgrau', grau: 'bmapgrau',
overlay: 'bmapoverlay', overlay: 'bmapoverlay',
highdpi: { highdpi: {
@@ -549,6 +556,7 @@
}, },
orthofoto: { orthofoto: {
options: { options: {
maxZoom: 20, // currently only in Vienna
variant: 'bmaporthofoto30cm', variant: 'bmaporthofoto30cm',
format: 'jpeg' format: 'jpeg'
} }
@@ -628,6 +636,30 @@
maxZoom: 18, maxZoom: 18,
subdomains: '0123', subdomains: '0123',
} }
},
JusticeMap: {
// Justice Map (http://www.justicemap.org/)
// Visualize race and income data for your community, county and country.
// Includes tools for data journalists, bloggers and community activists.
url: 'http://www.justicemap.org/tile/{size}/{variant}/{z}/{x}/{y}.png',
options: {
attribution: '<a href="http://www.justicemap.org/terms.php">Justice Map</a>',
// one of 'county', 'tract', 'block'
size: 'county',
// Bounds for USA, including Alaska and Hawaii
bounds: [[14, -180], [72, -56]]
},
variants: {
income: 'income',
americanIndian: 'indian',
asian: 'asian',
black: 'black',
hispanic: 'hispanic',
multi: 'multi',
nonWhite: 'nonwhite',
white: 'white',
plurality: 'plural'
}
} }
}; };

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{ {
"name": "leaflet-providers", "name": "leaflet-providers",
"version": "1.1.15", "version": "1.1.17",
"description": "An extension to Leaflet that contains configurations for various free tile providers.", "description": "An extension to Leaflet that contains configurations for various free tile providers.",
"main": "leaflet-providers.js", "main": "leaflet-providers.js",
"repository": { "repository": {
@@ -9,7 +9,7 @@
}, },
"scripts": { "scripts": {
"test": "npm run lint && npm run testsuite", "test": "npm run lint && npm run testsuite",
"testsuite": "mocha-phantomjs tests/index.html", "testsuite": "phantomjs ./node_modules/mocha-phantomjs-core/mocha-phantomjs-core.js tests/index.html",
"lint": "eslint --config .eslintrc leaflet-providers.js index.html preview/*.js preview/*.html tests/*", "lint": "eslint --config .eslintrc leaflet-providers.js index.html preview/*.js preview/*.html tests/*",
"min": "uglifyjs leaflet-providers.js -mc -o leaflet-providers.min.js", "min": "uglifyjs leaflet-providers.js -mc -o leaflet-providers.min.js",
"release": "mversion patch -m" "release": "mversion patch -m"
@@ -26,12 +26,12 @@
], ],
"devDependencies": { "devDependencies": {
"chai": "^2.3.0", "chai": "^2.3.0",
"eslint": "^2.7.0", "eslint": "^3.16.1",
"eslint-plugin-html": "^1.4.0", "eslint-plugin-html": "^2.0.1",
"mocha": "^2.2.4", "mocha": "^2.2.4",
"mocha-phantomjs": "^3.5.3", "mocha-phantomjs-core": "^2.0.1",
"mversion": "^1.3.0", "mversion": "^1.3.0",
"phantomjs": "1.9.7-15", "phantomjs-prebuilt": "^2.1.4",
"uglify-js": "^2.4.15" "uglify-js": "^2.4.15"
}, },
"autoupdate": { "autoupdate": {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -47,6 +47,7 @@
.leaflet-container .leaflet-tile-pane img, .leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer { .leaflet-container img.leaflet-image-layer {
max-width: none !important; max-width: none !important;
max-height: none !important;
} }
.leaflet-container.leaflet-touch-zoom { .leaflet-container.leaflet-touch-zoom {
@@ -55,11 +56,20 @@
} }
.leaflet-container.leaflet-touch-drag { .leaflet-container.leaflet-touch-drag {
-ms-touch-action: pinch-zoom; -ms-touch-action: pinch-zoom;
} /* Fallback for FF which doesn't support pinch-zoom */
touch-action: none;
touch-action: pinch-zoom;
}
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom { .leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
-ms-touch-action: none; -ms-touch-action: none;
touch-action: none; touch-action: none;
} }
.leaflet-container {
-webkit-tap-highlight-color: transparent;
}
.leaflet-container a {
-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
}
.leaflet-tile { .leaflet-tile {
filter: inherit; filter: inherit;
visibility: hidden; visibility: hidden;
@@ -303,7 +313,14 @@
height: 30px; height: 30px;
line-height: 30px; line-height: 30px;
} }
.leaflet-touch .leaflet-bar a:first-child {
border-top-left-radius: 2px;
border-top-right-radius: 2px;
}
.leaflet-touch .leaflet-bar a:last-child {
border-bottom-left-radius: 2px;
border-bottom-right-radius: 2px;
}
/* zoom control */ /* zoom control */
@@ -312,16 +329,10 @@
font: bold 18px 'Lucida Console', Monaco, monospace; font: bold 18px 'Lucida Console', Monaco, monospace;
text-indent: 1px; text-indent: 1px;
} }
.leaflet-control-zoom-out {
font-size: 20px;
}
.leaflet-touch .leaflet-control-zoom-in { .leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {
font-size: 22px; font-size: 22px;
} }
.leaflet-touch .leaflet-control-zoom-out {
font-size: 24px;
}
/* layers control */ /* layers control */
@@ -359,6 +370,7 @@
} }
.leaflet-control-layers-scrollbar { .leaflet-control-layers-scrollbar {
overflow-y: scroll; overflow-y: scroll;
overflow-x: hidden;
padding-right: 5px; padding-right: 5px;
} }
.leaflet-control-layers-selector { .leaflet-control-layers-selector {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -3,7 +3,7 @@
"description":"Javascript libraries for the Leaflet maps integration for Contao", "description":"Javascript libraries for the Leaflet maps integration for Contao",
"keywords":["contao", "maps", "leaflet"], "keywords":["contao", "maps", "leaflet"],
"type":"contao-module", "type":"contao-module",
"license":"LGPL-3.0+", "license":"LGPL-3.0-or-later",
"authors":[ "authors":[
{ {
"name":"David Molineus", "name":"David Molineus",
@@ -19,16 +19,16 @@
}, },
"require":{ "require":{
"php":">=5.4", "php":">=5.4",
"contao-community-alliance/composer-plugin": "~2.4 | ~3.0", "contao-community-alliance/composer-plugin": "~2.4 || ~3.0",
"contao/core-bundle":"~3.5 | ~4.3" "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"
}, },
"extra":{ "extra":{
"branch-alias": { "branch-alias": {
"dev-master": "1.0.x-dev", "dev-master": "1.3.x-dev",
"dev-develop": "1.1.x-dev", "dev-develop": "1.4.x-dev",
"dev-support/0.7.x": "0.7.x-dev" "dev-support/0.7.x": "0.7.x-dev"
}, },
"contao": { "contao": {

View File

@@ -17,7 +17,7 @@
$GLOBALS['LEAFLET_LIBRARIES']['leaflet'] = array $GLOBALS['LEAFLET_LIBRARIES']['leaflet'] = array
( (
'name' => 'Leaflet', 'name' => 'Leaflet',
'version' => '1.0.3', 'version' => '1.3.1',
'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',
@@ -27,7 +27,7 @@ $GLOBALS['LEAFLET_LIBRARIES']['leaflet'] = array
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-providers'] = array $GLOBALS['LEAFLET_LIBRARIES']['leaflet-providers'] = array
( (
'name' => 'Leaflet-providers', 'name' => 'Leaflet-providers',
'version' => '1.1.15', 'version' => '1.1.17',
'license' => '<a href="https://github.com/leaflet-extras/leaflet-providers/blob/master/license.md" target="_blank">BSD-2-Clause</a>', 'license' => '<a href="https://github.com/leaflet-extras/leaflet-providers/blob/master/license.md" target="_blank">BSD-2-Clause</a>',
'homepage' => 'http://leaflet-extras.github.io/leaflet-providers', 'homepage' => 'http://leaflet-extras.github.io/leaflet-providers',
'javascript' => 'assets/leaflet/libs/leaflet-providers/leaflet-providers.min.js' 'javascript' => 'assets/leaflet/libs/leaflet-providers/leaflet-providers.min.js'
@@ -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.2', 'version' => '1.3.0',
'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',
@@ -65,7 +65,7 @@ $GLOBALS['LEAFLET_LIBRARIES']['leaflet-loading'] = array
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-fullscreen'] = array $GLOBALS['LEAFLET_LIBRARIES']['leaflet-fullscreen'] = array
( (
'name' => 'Leaflet.Control.FullScreen', 'name' => 'Leaflet.Control.FullScreen',
'version' => '1.4.2', 'version' => '1.4.3',
'license' => '<a href="https://github.com/brunob/leaflet.fullscreen/blob/master/LICENSE" target="_blank">MIT</a>', 'license' => '<a href="https://github.com/brunob/leaflet.fullscreen/blob/master/LICENSE" target="_blank">MIT</a>',
'homepage' => 'https://github.com/brunob/leaflet.fullscreen', 'homepage' => 'https://github.com/brunob/leaflet.fullscreen',
'css' => 'assets/leaflet/libs/leaflet-fullscreen/Control.FullScreen.min.css', 'css' => 'assets/leaflet/libs/leaflet-fullscreen/Control.FullScreen.min.css',
@@ -75,7 +75,7 @@ $GLOBALS['LEAFLET_LIBRARIES']['leaflet-fullscreen'] = array
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-control-geocoder'] = array $GLOBALS['LEAFLET_LIBRARIES']['leaflet-control-geocoder'] = array
( (
'name' => 'Leaflet Control Geocoder', 'name' => 'Leaflet Control Geocoder',
'version' => '1.5.4', 'version' => '1.5.8',
'license' => '<a href="https://github.com/perliedman/leaflet-control-geocoder/blob/master/LICENSE" target="_blank">BSD-2-Clause</a>', 'license' => '<a href="https://github.com/perliedman/leaflet-control-geocoder/blob/master/LICENSE" target="_blank">BSD-2-Clause</a>',
'homepage' => 'https://github.com/perliedman/leaflet-control-geocoder', 'homepage' => 'https://github.com/perliedman/leaflet-control-geocoder',
'css' => 'assets/leaflet/libs/control-geocoder/Control.Geocoder.min.css', 'css' => 'assets/leaflet/libs/control-geocoder/Control.Geocoder.min.css',
@@ -92,6 +92,16 @@ $GLOBALS['LEAFLET_LIBRARIES']['leaflet-extra-markers'] = array
'javascript' => 'assets/leaflet/libs/leaflet-extra-markers/js/leaflet.extra-markers.min.js' 'javascript' => 'assets/leaflet/libs/leaflet-extra-markers/js/leaflet.extra-markers.min.js'
); );
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-pm'] = array
(
'name' => 'leaflet.pm',
'version' => '0.23.1',
'license' => '<a href="https://github.com/codeofsumit/leaflet.pm/blob/develop/LICENSE" target="_blank">MIT</a>',
'homepage' => 'https://github.com/codeofsumit/leaflet.pm',
'css' => 'assets/leaflet/libs/leaflet-pm/leaflet.pm.css',
'javascript' => 'assets/leaflet/libs/leaflet-pm/leaflet.pm.min.js'
);
$GLOBALS['LEAFLET_LIBRARIES']['osmtogeojson'] = array $GLOBALS['LEAFLET_LIBRARIES']['osmtogeojson'] = array
( (
'name' => 'osmtogeojson', 'name' => 'osmtogeojson',