Compare commits

..

5 Commits

Author SHA1 Message Date
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
21 changed files with 167 additions and 100 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/
/bin/
/.tx/
/node_modules/
# OS
.DS_Store
Thumbs.db
.directory
coverage.xml
# IDEs
.buildpath
.project
.settings/
.build/
.external*/
.idea/
nbproject/
# composer related
vendor/
composer.lock
# build
build/
build.properties
# Translations
.tx

View File

@@ -12,13 +12,13 @@ Contao CMS.
This package contains following packages:
- [leaflet 1.1.0](http://leafletjs.com)
- [leaflet 1.2.0](http://leafletjs.com)
- [Leaflet-providers 1.1.17](http://leaflet-extras.github.io/leaflet-providers)
- [Leaflet.markercluster 1.0.6](https://github.com/Leaflet/Leaflet.markercluster)
- [Leaflet.markercluster 1.1.0](https://github.com/Leaflet/Leaflet.markercluster)
- [Leaflet-omnivore 0.3.4](https://github.com/mapbox/leaflet-omnivore)
- [Leaflet.loading 0.1.24](https://github.com/ebrelsford/Leaflet.loading)
- [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.5](https://github.com/perliedman/leaflet-control-geocoder)
- [Leaflet.ExtraMarkers 1.0.6](https://github.com/coryasilva/Leaflet.ExtraMarkers)
- [osmtogeojson 2.2.12](https://github.com/tyrasd/osmtogeojson)
- [spin.js 2.3.2](http://fgnass.github.io/spin.js)

View File

@@ -132,17 +132,19 @@ module.exports = {
_geocode: function(suggest) {
var requestCount = ++this._requestCount,
mode = suggest ? 'suggest' : 'geocode';
mode = suggest ? 'suggest' : 'geocode',
eventData = {input: this._input.value};
this._lastGeocode = this._input.value;
if (!suggest) {
this._clearResults();
}
this.fire('start' + mode);
this.fire('start' + mode, eventData);
this.options.geocoder[mode](this._input.value, function(results) {
if (requestCount === this._requestCount) {
this.fire('finish' + mode);
eventData.results = results;
this.fire('finish' + mode, eventData);
this._geocodeResult(results, suggest);
}
}, this);
@@ -608,18 +610,26 @@ var L = (typeof window !== "undefined" ? window['L'] : typeof global !== "undefi
module.exports = {
"class": L.Class.extend({
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) {
L.setOptions(this, options);
this._accessToken = accessToken;
this.options.geocodingQueryParams.access_token = accessToken;
this.options.reverseQueryParams.access_token = accessToken;
},
geocode: function(query, cb, context) {
Util.getJSON(this.options.serviceUrl + encodeURIComponent(query) + '.json', {
access_token: this._accessToken
}, function(data) {
var params = this.options.geocodingQueryParams;
if (typeof params.proximity !== 'undefined'
&& 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 = [],
loc,
latLng,
@@ -628,7 +638,7 @@ module.exports = {
for (var i = 0; i <= data.features.length - 1; i++) {
loc = data.features[i];
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()));
}
@@ -653,9 +663,7 @@ module.exports = {
},
reverse: function(location, scale, cb, context) {
Util.getJSON(this.options.serviceUrl + encodeURIComponent(location.lng) + ',' + encodeURIComponent(location.lat) + '.json', {
access_token: this._accessToken
}, function(data) {
Util.getJSON(this.options.serviceUrl + encodeURIComponent(location.lng) + ',' + encodeURIComponent(location.lat) + '.json', this.options.reverseQueryParams, function(data) {
var results = [],
loc,
latLng,
@@ -664,7 +672,7 @@ module.exports = {
for (var i = 0; i <= data.features.length - 1; i++) {
loc = data.features[i];
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()));
}
@@ -1043,6 +1051,9 @@ module.exports = {
results.push({
name: this._deocodeFeatureName(f),
html: this.options.htmlTemplate ?
this.options.htmlTemplate(f)
: undefined,
center: latLng,
bbox: bbox,
properties: f.properties

File diff suppressed because one or more lines are too long

View File

@@ -160,7 +160,7 @@ An object that represents a result from a geocoding query.
| Property | Type | Description |
| ---------- | ---------------- | ------------------------------------- |
| 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 |
| icon | String | URL for icon representing result; optional |
| html | String | (optional) HTML formatted representation of the name |

View File

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

View File

@@ -1,6 +1,6 @@
{
"name": "leaflet-control-geocoder",
"version": "1.5.4",
"version": "1.5.5",
"description": "Extendable geocoder with builtin support for Nominatim, Bing, Google, Mapbox, Photon, What3Words, MapQuest, Mapzen, HERE",
"main": "dist/Control.Geocoder.js",
"scripts": {

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

@@ -48,8 +48,8 @@ removed link to h1 and indented back 2 spaces all links.
## Using the plugin
Include the plugin CSS and JS files on your page after Leaflet files, using your method of choice:
* [Download the `v1.0.6` release](https://github.com/Leaflet/Leaflet.markercluster/archive/v1.0.6.zip)
* Use unpkg CDN: `https://unpkg.com/leaflet.markercluster@1.0.6/dist/`
* [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.1.0/dist/`
* Install with npm: `npm install leaflet.markercluster`
In each case, use files in the `dist` folder:
@@ -129,7 +129,8 @@ If you need to update the clusters icon (e.g. they are based on markers real-tim
* **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 }`.
* **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
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.

View File

@@ -54,6 +54,9 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
if (!this.options.iconCreateFunction) {
this.options.iconCreateFunction = this._defaultIconCreateFunction;
}
if (!this.options.clusterPane) {
this.options.clusterPane = L.Marker.prototype.options.pane;
}
this._featureGroup = L.featureGroup();
this._featureGroup.addEventParent(this);
@@ -1379,8 +1382,8 @@ L.markerClusterGroup = function (options) {
L.MarkerCluster = L.Marker.extend({
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._zoom = zoom;

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1,7 @@
{
"name": "leaflet.markercluster",
"repository": "https://github.com/Leaflet/Leaflet.markercluster",
"version": "1.0.6",
"version": "1.1.0",
"description": "Provides Beautiful Animated Marker Clustering functionality for Leaflet",
"devDependencies": {
"jshint": "~2.1.3",

File diff suppressed because one or more lines are too long

View File

@@ -1,14 +1,14 @@
/*
* Leaflet 1.1.0+Detached: a3a7e045229898137bb9a3af0a1407e409e06c4f.a3a7e04, a JS library for interactive maps. http://leafletjs.com
/* @preserve
* Leaflet 1.2.0+Detached: 1ac320ba232cb85b73ac81f3d82780c9d07f0d4e.1ac320b, a JS library for interactive maps. http://leafletjs.com
* (c) 2010-2017 Vladimir Agafonkin, (c) 2010-2011 CloudMade
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.L = global.L || {})));
(factory((global.L = {})));
}(this, (function (exports) { 'use strict';
var version = "1.1.0+HEAD.a3a7e04";
var version = "1.2.0+HEAD.1ac320b";
/*
* @namespace Util
@@ -16,6 +16,9 @@ var version = "1.1.0+HEAD.a3a7e04";
* Various utility functions, used by Leaflet internally.
*/
var freeze = Object.freeze;
Object.freeze = function (obj) { return obj; };
// @function extend(dest: Object, src?: Object): Object
// Merges the properties of the `src` object (or multiple objects) into `dest` object and returns the latter. Has an `L.extend` shortcut.
function extend(dest) {
@@ -251,6 +254,7 @@ function cancelAnimFrame(id) {
var Util = (Object.freeze || Object)({
freeze: freeze,
extend: extend,
create: create,
bind: bind,
@@ -2214,6 +2218,8 @@ function off(obj, types, fn, context) {
}
delete obj[eventsKey];
}
return this;
}
function addOne(obj, type, fn, context) {
@@ -2323,7 +2329,8 @@ function stopPropagation(e) {
// @function disableScrollPropagation(el: HTMLElement): this
// Adds `stopPropagation` to the element's `'mousewheel'` events (plus browser variants).
function disableScrollPropagation(el) {
return addOne(el, 'mousewheel', stopPropagation);
addOne(el, 'mousewheel', stopPropagation);
return this;
}
// @function disableClickPropagation(el: HTMLElement): this
@@ -4912,13 +4919,6 @@ var Layers = Control.extend({
on(link, 'focus', this.expand, this);
}
// work around for Firefox Android issue https://github.com/Leaflet/Leaflet/issues/2033
on(form, 'click', function () {
setTimeout(bind(this._onInputClick, this), 0);
}, this);
// TODO keyboard accessibility
if (!collapsed) {
this.expand();
}
@@ -4951,7 +4951,7 @@ var Layers = Control.extend({
});
if (this.options.sortLayers) {
this._layers.sort(L.bind(function (a, b) {
this._layers.sort(bind(function (a, b) {
return this.options.sortFunction(a.layer, b.layer, a.name, b.name);
}, this));
}
@@ -5068,7 +5068,7 @@ var Layers = Control.extend({
_onInputClick: function () {
var inputs = this._layerControlInputs,
input, layer, hasLayer;
input, layer;
var addedLayers = [],
removedLayers = [];
@@ -5077,22 +5077,24 @@ var Layers = Control.extend({
for (var i = inputs.length - 1; i >= 0; i--) {
input = inputs[i];
layer = this._getLayer(input.layerId).layer;
hasLayer = this._map.hasLayer(layer);
if (input.checked && !hasLayer) {
if (input.checked) {
addedLayers.push(layer);
} else if (!input.checked && hasLayer) {
} else if (!input.checked) {
removedLayers.push(layer);
}
}
// Bugfix issue 2318: Should remove all old layers before readding new ones
for (i = 0; i < removedLayers.length; i++) {
this._map.removeLayer(removedLayers[i]);
if (this._map.hasLayer(removedLayers[i])) {
this._map.removeLayer(removedLayers[i]);
}
}
for (i = 0; i < addedLayers.length; i++) {
this._map.addLayer(addedLayers[i]);
if (!this._map.hasLayer(addedLayers[i])) {
this._map.addLayer(addedLayers[i]);
}
}
this._handlingClick = false;
@@ -5602,7 +5604,6 @@ var Mixin = {Events: Events};
* ```
*/
var _dragging = false;
var START = touch ? 'touchstart mousedown' : 'mousedown';
var END = {
mousedown: 'mouseup',
@@ -5656,7 +5657,7 @@ var Draggable = Evented.extend({
// If we're currently dragging this draggable,
// disabling it counts as first ending the drag.
if (L.Draggable._dragging === this) {
if (Draggable._dragging === this) {
this.finishDrag();
}
@@ -5678,8 +5679,8 @@ var Draggable = Evented.extend({
if (hasClass(this._element, 'leaflet-zoom-anim')) { return; }
if (_dragging || e.shiftKey || ((e.which !== 1) && (e.button !== 1) && !e.touches)) { return; }
_dragging = this; // Prevent dragging multiple objects at once.
if (Draggable._dragging || e.shiftKey || ((e.which !== 1) && (e.button !== 1) && !e.touches)) { return; }
Draggable._dragging = this; // Prevent dragging multiple objects at once.
if (this._preventOutline) {
preventOutline(this._element);
@@ -5803,7 +5804,7 @@ var Draggable = Evented.extend({
}
this._moving = false;
_dragging = false;
Draggable._dragging = false;
}
});
@@ -6036,11 +6037,17 @@ function _sqClosestPointOnSegment(p, p1, p2, sqDist) {
}
function _flat(latlngs) {
// true if it's a flat array of latlngs; false if nested
// @function isFlat(latlngs: LatLng[]): Boolean
// Returns true if `latlngs` is a flat array, false is nested.
function isFlat(latlngs) {
return !isArray(latlngs[0]) || (typeof latlngs[0][0] !== 'object' && typeof latlngs[0][0] !== 'undefined');
}
function _flat(latlngs) {
console.warn('Deprecated use of _flat, please use L.LineUtil.isFlat instead.');
return isFlat(latlngs);
}
var LineUtil = (Object.freeze || Object)({
simplify: simplify,
@@ -6050,6 +6057,7 @@ var LineUtil = (Object.freeze || Object)({
_getEdgeIntersection: _getEdgeIntersection,
_getBitCode: _getBitCode,
_sqClosestPointOnSegment: _sqClosestPointOnSegment,
isFlat: isFlat,
_flat: _flat
});
@@ -6328,8 +6336,8 @@ var Layer = Evented.extend({
/* @section
* Classes extending `L.Layer` will inherit the following methods:
*
* @method addTo(map: Map): this
* Adds the layer to the given map
* @method addTo(map: Map|LayerGroup): this
* Adds the layer to the given map or layer group.
*/
addTo: function (map) {
map.addLayer(this);
@@ -6438,6 +6446,10 @@ Map.include({
// @method addLayer(layer: Layer): this
// Adds the given layer to the map
addLayer: function (layer) {
if (!layer._layerAdd) {
throw new Error('The provided object is not a Layer.');
}
var id = stamp(layer);
if (this._layers[id]) { return this; }
this._layers[id] = layer;
@@ -6714,7 +6726,7 @@ var LayerGroup = Layer.extend({
});
// @factory L.layerGroup(layers: Layer[])
// @factory L.layerGroup(layers?: Layer[])
// Create a layer group, optionally given an initial set of layers.
var layerGroup = function (layers) {
return new LayerGroup(layers);
@@ -7984,13 +7996,13 @@ var Polyline = Path.extend({
},
_defaultShape: function () {
return _flat(this._latlngs) ? this._latlngs : this._latlngs[0];
return isFlat(this._latlngs) ? this._latlngs : this._latlngs[0];
},
// recursively convert latlngs input into actual LatLng instances; calculate bounds along the way
_convertLatLngs: function (latlngs) {
var result = [],
flat = _flat(latlngs);
flat = isFlat(latlngs);
for (var i = 0, len = latlngs.length; i < len; i++) {
if (flat) {
@@ -8130,6 +8142,9 @@ function polyline(latlngs, options) {
return new Polyline(latlngs, options);
}
// Retrocompat. Allow plugins to support Leaflet versions before and after 1.1.
Polyline._flat = _flat;
/*
* @class Polygon
* @aka L.Polygon
@@ -8234,13 +8249,13 @@ var Polygon = Polyline.extend({
_setLatLngs: function (latlngs) {
Polyline.prototype._setLatLngs.call(this, latlngs);
if (_flat(this._latlngs)) {
if (isFlat(this._latlngs)) {
this._latlngs = [this._latlngs];
}
},
_defaultShape: function () {
return _flat(this._latlngs[0]) ? this._latlngs[0] : this._latlngs[0][0];
return isFlat(this._latlngs[0]) ? this._latlngs[0] : this._latlngs[0][0];
},
_clipPoints: function () {
@@ -8612,7 +8627,7 @@ CircleMarker.include(PointToGeoJSON);
// Returns a [`GeoJSON`](http://en.wikipedia.org/wiki/GeoJSON) representation of the polyline (as a GeoJSON `LineString` or `MultiLineString` Feature).
Polyline.include({
toGeoJSON: function (precision) {
var multi = !_flat(this._latlngs);
var multi = !isFlat(this._latlngs);
var coords = latLngsToCoords(this._latlngs, multi ? 1 : 0, false, precision);
@@ -8628,8 +8643,8 @@ Polyline.include({
// Returns a [`GeoJSON`](http://en.wikipedia.org/wiki/GeoJSON) representation of the polygon (as a GeoJSON `Polygon` or `MultiPolygon` Feature).
Polygon.include({
toGeoJSON: function (precision) {
var holes = !_flat(this._latlngs),
multi = holes && !_flat(this._latlngs[0]);
var holes = !isFlat(this._latlngs),
multi = holes && !isFlat(this._latlngs[0]);
var coords = latLngsToCoords(this._latlngs, multi ? 2 : holes ? 1 : 0, true, precision);
@@ -8848,7 +8863,7 @@ var ImageOverlay = Layer.extend({
// @method setBounds(bounds: LatLngBounds): this
// Update the bounds that this ImageOverlay covers
setBounds: function (bounds) {
this._bounds = bounds;
this._bounds = toLatLngBounds(bounds);
if (this._map) {
this._reset();
@@ -8979,8 +8994,8 @@ var imageOverlay = function (url, bounds, options) {
*
* ```js
* var videoUrl = 'https://www.mapbox.com/bites/00188/patricia_nasa.webm',
* imageBounds = [[ 32, -130], [ 13, -100]];
* L.imageOverlay(imageUrl, imageBounds).addTo(map);
* videoBounds = [[ 32, -130], [ 13, -100]];
* L.VideoOverlay(videoUrl, videoBounds ).addTo(map);
* ```
*/
@@ -8999,8 +9014,11 @@ var VideoOverlay = ImageOverlay.extend({
},
_initImage: function () {
var vid = this._image = create$1('video',
'leaflet-image-layer ' + (this._zoomAnimated ? 'leaflet-zoom-animated' : ''));
var wasElementSupplied = this._url.tagName === 'VIDEO';
var vid = this._image = wasElementSupplied ? this._url : create$1('video');
vid.class = vid.class || '';
vid.class += 'leaflet-image-layer ' + (this._zoomAnimated ? 'leaflet-zoom-animated' : '');
vid.onselectstart = falseFn;
vid.onmousemove = falseFn;
@@ -9009,6 +9027,8 @@ var VideoOverlay = ImageOverlay.extend({
// Fired when the video has finished loading the first frame
vid.onloadeddata = bind(this.fire, this, 'load');
if (wasElementSupplied) { return; }
if (!isArray(this._url)) { this._url = [this._url]; }
vid.autoplay = !!this.options.autoplay;
@@ -9026,11 +9046,12 @@ var VideoOverlay = ImageOverlay.extend({
});
// @factory L.videoOverlay(videoUrl: String|Array, bounds: LatLngBounds, options?: VideoOverlay options)
// Instantiates an image overlay object given the URL of the video (or array of URLs) and the
// @factory L.videoOverlay(video: String|Array|HTMLVideoElement, bounds: LatLngBounds, options?: VideoOverlay options)
// Instantiates an image overlay object given the URL of the video (or array of URLs, or even a video element) and the
// geographical bounds it is tied to.
function videoOverlay(url, bounds, options) {
return new VideoOverlay(url, bounds, options);
function videoOverlay(video, bounds, options) {
return new VideoOverlay(video, bounds, options);
}
/*
@@ -9588,7 +9609,7 @@ Layer.include({
// @method bindPopup(content: String|HTMLElement|Function|Popup, options?: Popup options): this
// Binds a popup to the layer with the passed `content` and sets up the
// neccessary event listeners. If a `Function` is passed it will receive
// necessary event listeners. If a `Function` is passed it will receive
// the layer as the first argument and should return a `String` or `HTMLElement`.
bindPopup: function (content, options) {
@@ -9991,7 +10012,7 @@ Layer.include({
// @method bindTooltip(content: String|HTMLElement|Function|Tooltip, options?: Tooltip options): this
// Binds a tooltip to the layer with the passed `content` and sets up the
// neccessary event listeners. If a `Function` is passed it will receive
// necessary event listeners. If a `Function` is passed it will receive
// the layer as the first argument and should return a `String` or `HTMLElement`.
bindTooltip: function (content, options) {
@@ -10304,8 +10325,11 @@ var GridLayer = Layer.extend({
// Opacity of the tiles. Can be used in the `createTile()` function.
opacity: 1,
// @option updateWhenIdle: Boolean = depends
// If `false`, new tiles are loaded during panning, otherwise only after it (for better performance). `true` by default on mobile browsers, otherwise `false`.
// @option updateWhenIdle: Boolean = (depends)
// Load new tiles only when panning ends.
// `true` by default on mobile browsers, in order to avoid too many requests and keep smooth navigation.
// `false` otherwise in order to display new tiles _during_ panning, since it is easy to pan outside the
// [`keepBuffer`](#gridlayer-keepbuffer) option in desktop browsers.
updateWhenIdle: mobile,
// @option updateWhenZooming: Boolean = true
@@ -11157,7 +11181,7 @@ function gridLayer(options) {
* 'http://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png'
* ```
*
* `{s}` means one of the available subdomains (used sequentially to help with browser parallel requests per domain limitation; subdomain values are specified in options; `a`, `b` or `c` by default, can be omitted), `{z}` — zoom level, `{x}` and `{y}` — tile coordinates. `{r}` can be used to add @2x to the URL to load retina tiles.
* `{s}` means one of the available subdomains (used sequentially to help with browser parallel requests per domain limitation; subdomain values are specified in options; `a`, `b` or `c` by default, can be omitted), `{z}` — zoom level, `{x}` and `{y}` — tile coordinates. `{r}` can be used to add "&commat;2x" to the URL to load retina tiles.
*
* You can use custom keys in the template, which will be [evaluated](#util-template) from TileLayer options, like this:
*
@@ -13501,6 +13525,8 @@ function noConflict() {
// Always export us to window global (see #2364)
window.L = exports;
Object.freeze = freeze;
exports.version = version;
exports.noConflict = noConflict;
exports.Control = Control;

File diff suppressed because one or more lines are too long

View File

@@ -366,6 +366,7 @@
}
.leaflet-control-layers-scrollbar {
overflow-y: scroll;
overflow-x: hidden;
padding-right: 5px;
}
.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

@@ -17,7 +17,7 @@
$GLOBALS['LEAFLET_LIBRARIES']['leaflet'] = array
(
'name' => 'Leaflet',
'version' => '1.1.0',
'version' => '1.2.0',
'license' => '<a href="https://github.com/Leaflet/Leaflet/blob/master/LICENSE" target="_blank">BSD-2-Clause</a>',
'homepage' => 'http://leafletjs.com',
'css' => 'assets/leaflet/libs/leaflet/leaflet.min.css',
@@ -36,7 +36,7 @@ $GLOBALS['LEAFLET_LIBRARIES']['leaflet-providers'] = array
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-markercluster'] = array
(
'name' => 'Leaflet.markercluster',
'version' => '1.0.6',
'version' => '1.1.0',
'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',
'css' => 'assets/leaflet/libs/leaflet-markercluster/MarkerCluster.css',
@@ -75,7 +75,7 @@ $GLOBALS['LEAFLET_LIBRARIES']['leaflet-fullscreen'] = array
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-control-geocoder'] = array
(
'name' => 'Leaflet Control Geocoder',
'version' => '1.5.4',
'version' => '1.5.5',
'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',
'css' => 'assets/leaflet/libs/control-geocoder/Control.Geocoder.min.css',