Use leaflet 1.2.0.

This commit is contained in:
David Molineus
2017-10-17 09:51:56 +02:00
parent 1f5add1d27
commit a2cdfddcc6
7 changed files with 87 additions and 61 deletions

View File

@@ -12,7 +12,7 @@ Contao CMS.
This package contains following packages: 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-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.0.6](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)

View File

@@ -1,14 +1,14 @@
/* /* @preserve
* Leaflet 1.1.0+Detached: a3a7e045229898137bb9a3af0a1407e409e06c4f.a3a7e04, a JS library for interactive maps. http://leafletjs.com * 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 * (c) 2010-2017 Vladimir Agafonkin, (c) 2010-2011 CloudMade
*/ */
(function (global, factory) { (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) : typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.L = global.L || {}))); (factory((global.L = {})));
}(this, (function (exports) { 'use strict'; }(this, (function (exports) { 'use strict';
var version = "1.1.0+HEAD.a3a7e04"; var version = "1.2.0+HEAD.1ac320b";
/* /*
* @namespace Util * @namespace Util
@@ -16,6 +16,9 @@ var version = "1.1.0+HEAD.a3a7e04";
* Various utility functions, used by Leaflet internally. * Various utility functions, used by Leaflet internally.
*/ */
var freeze = Object.freeze;
Object.freeze = function (obj) { return obj; };
// @function extend(dest: Object, src?: Object): Object // @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. // 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) { function extend(dest) {
@@ -251,6 +254,7 @@ function cancelAnimFrame(id) {
var Util = (Object.freeze || Object)({ var Util = (Object.freeze || Object)({
freeze: freeze,
extend: extend, extend: extend,
create: create, create: create,
bind: bind, bind: bind,
@@ -2214,6 +2218,8 @@ function off(obj, types, fn, context) {
} }
delete obj[eventsKey]; delete obj[eventsKey];
} }
return this;
} }
function addOne(obj, type, fn, context) { function addOne(obj, type, fn, context) {
@@ -2323,7 +2329,8 @@ function stopPropagation(e) {
// @function disableScrollPropagation(el: HTMLElement): this // @function disableScrollPropagation(el: HTMLElement): this
// Adds `stopPropagation` to the element's `'mousewheel'` events (plus browser variants). // Adds `stopPropagation` to the element's `'mousewheel'` events (plus browser variants).
function disableScrollPropagation(el) { function disableScrollPropagation(el) {
return addOne(el, 'mousewheel', stopPropagation); addOne(el, 'mousewheel', stopPropagation);
return this;
} }
// @function disableClickPropagation(el: HTMLElement): this // @function disableClickPropagation(el: HTMLElement): this
@@ -4912,13 +4919,6 @@ var Layers = Control.extend({
on(link, 'focus', this.expand, this); 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) { if (!collapsed) {
this.expand(); this.expand();
} }
@@ -4951,7 +4951,7 @@ var Layers = Control.extend({
}); });
if (this.options.sortLayers) { 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); return this.options.sortFunction(a.layer, b.layer, a.name, b.name);
}, this)); }, this));
} }
@@ -5068,7 +5068,7 @@ var Layers = Control.extend({
_onInputClick: function () { _onInputClick: function () {
var inputs = this._layerControlInputs, var inputs = this._layerControlInputs,
input, layer, hasLayer; input, layer;
var addedLayers = [], var addedLayers = [],
removedLayers = []; removedLayers = [];
@@ -5077,23 +5077,25 @@ var Layers = Control.extend({
for (var i = inputs.length - 1; i >= 0; i--) { for (var i = inputs.length - 1; i >= 0; i--) {
input = inputs[i]; input = inputs[i];
layer = this._getLayer(input.layerId).layer; layer = this._getLayer(input.layerId).layer;
hasLayer = this._map.hasLayer(layer);
if (input.checked && !hasLayer) { if (input.checked) {
addedLayers.push(layer); addedLayers.push(layer);
} else if (!input.checked) {
} else if (!input.checked && hasLayer) {
removedLayers.push(layer); removedLayers.push(layer);
} }
} }
// Bugfix issue 2318: Should remove all old layers before readding new ones // Bugfix issue 2318: Should remove all old layers before readding new ones
for (i = 0; i < removedLayers.length; i++) { for (i = 0; i < removedLayers.length; i++) {
if (this._map.hasLayer(removedLayers[i])) {
this._map.removeLayer(removedLayers[i]); this._map.removeLayer(removedLayers[i]);
} }
}
for (i = 0; i < addedLayers.length; i++) { for (i = 0; i < addedLayers.length; i++) {
if (!this._map.hasLayer(addedLayers[i])) {
this._map.addLayer(addedLayers[i]); this._map.addLayer(addedLayers[i]);
} }
}
this._handlingClick = false; this._handlingClick = false;
@@ -5602,7 +5604,6 @@ var Mixin = {Events: Events};
* ``` * ```
*/ */
var _dragging = false;
var START = touch ? 'touchstart mousedown' : 'mousedown'; var START = touch ? 'touchstart mousedown' : 'mousedown';
var END = { var END = {
mousedown: 'mouseup', mousedown: 'mouseup',
@@ -5656,7 +5657,7 @@ var Draggable = Evented.extend({
// If we're currently dragging this draggable, // If we're currently dragging this draggable,
// disabling it counts as first ending the drag. // disabling it counts as first ending the drag.
if (L.Draggable._dragging === this) { if (Draggable._dragging === this) {
this.finishDrag(); this.finishDrag();
} }
@@ -5678,8 +5679,8 @@ var Draggable = Evented.extend({
if (hasClass(this._element, 'leaflet-zoom-anim')) { return; } if (hasClass(this._element, 'leaflet-zoom-anim')) { return; }
if (_dragging || e.shiftKey || ((e.which !== 1) && (e.button !== 1) && !e.touches)) { return; } if (Draggable._dragging || e.shiftKey || ((e.which !== 1) && (e.button !== 1) && !e.touches)) { return; }
_dragging = this; // Prevent dragging multiple objects at once. Draggable._dragging = this; // Prevent dragging multiple objects at once.
if (this._preventOutline) { if (this._preventOutline) {
preventOutline(this._element); preventOutline(this._element);
@@ -5803,7 +5804,7 @@ var Draggable = Evented.extend({
} }
this._moving = false; this._moving = false;
_dragging = false; Draggable._dragging = false;
} }
}); });
@@ -6036,11 +6037,17 @@ function _sqClosestPointOnSegment(p, p1, p2, sqDist) {
} }
function _flat(latlngs) { // @function isFlat(latlngs: LatLng[]): Boolean
// true if it's a flat array of latlngs; false if nested // 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'); 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)({ var LineUtil = (Object.freeze || Object)({
simplify: simplify, simplify: simplify,
@@ -6050,6 +6057,7 @@ var LineUtil = (Object.freeze || Object)({
_getEdgeIntersection: _getEdgeIntersection, _getEdgeIntersection: _getEdgeIntersection,
_getBitCode: _getBitCode, _getBitCode: _getBitCode,
_sqClosestPointOnSegment: _sqClosestPointOnSegment, _sqClosestPointOnSegment: _sqClosestPointOnSegment,
isFlat: isFlat,
_flat: _flat _flat: _flat
}); });
@@ -6328,8 +6336,8 @@ var Layer = Evented.extend({
/* @section /* @section
* Classes extending `L.Layer` will inherit the following methods: * Classes extending `L.Layer` will inherit the following methods:
* *
* @method addTo(map: Map): this * @method addTo(map: Map|LayerGroup): this
* Adds the layer to the given map * Adds the layer to the given map or layer group.
*/ */
addTo: function (map) { addTo: function (map) {
map.addLayer(this); map.addLayer(this);
@@ -6438,6 +6446,10 @@ Map.include({
// @method addLayer(layer: Layer): this // @method addLayer(layer: Layer): this
// Adds the given layer to the map // Adds the given layer to the map
addLayer: function (layer) { addLayer: function (layer) {
if (!layer._layerAdd) {
throw new Error('The provided object is not a Layer.');
}
var id = stamp(layer); var id = stamp(layer);
if (this._layers[id]) { return this; } if (this._layers[id]) { return this; }
this._layers[id] = layer; 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. // Create a layer group, optionally given an initial set of layers.
var layerGroup = function (layers) { var layerGroup = function (layers) {
return new LayerGroup(layers); return new LayerGroup(layers);
@@ -7984,13 +7996,13 @@ var Polyline = Path.extend({
}, },
_defaultShape: function () { _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 // recursively convert latlngs input into actual LatLng instances; calculate bounds along the way
_convertLatLngs: function (latlngs) { _convertLatLngs: function (latlngs) {
var result = [], var result = [],
flat = _flat(latlngs); flat = isFlat(latlngs);
for (var i = 0, len = latlngs.length; i < len; i++) { for (var i = 0, len = latlngs.length; i < len; i++) {
if (flat) { if (flat) {
@@ -8130,6 +8142,9 @@ function polyline(latlngs, options) {
return new 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 * @class Polygon
* @aka L.Polygon * @aka L.Polygon
@@ -8234,13 +8249,13 @@ var Polygon = Polyline.extend({
_setLatLngs: function (latlngs) { _setLatLngs: function (latlngs) {
Polyline.prototype._setLatLngs.call(this, latlngs); Polyline.prototype._setLatLngs.call(this, latlngs);
if (_flat(this._latlngs)) { if (isFlat(this._latlngs)) {
this._latlngs = [this._latlngs]; this._latlngs = [this._latlngs];
} }
}, },
_defaultShape: function () { _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 () { _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). // Returns a [`GeoJSON`](http://en.wikipedia.org/wiki/GeoJSON) representation of the polyline (as a GeoJSON `LineString` or `MultiLineString` Feature).
Polyline.include({ Polyline.include({
toGeoJSON: function (precision) { toGeoJSON: function (precision) {
var multi = !_flat(this._latlngs); var multi = !isFlat(this._latlngs);
var coords = latLngsToCoords(this._latlngs, multi ? 1 : 0, false, precision); 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). // Returns a [`GeoJSON`](http://en.wikipedia.org/wiki/GeoJSON) representation of the polygon (as a GeoJSON `Polygon` or `MultiPolygon` Feature).
Polygon.include({ Polygon.include({
toGeoJSON: function (precision) { toGeoJSON: function (precision) {
var holes = !_flat(this._latlngs), var holes = !isFlat(this._latlngs),
multi = holes && !_flat(this._latlngs[0]); multi = holes && !isFlat(this._latlngs[0]);
var coords = latLngsToCoords(this._latlngs, multi ? 2 : holes ? 1 : 0, true, precision); 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 // @method setBounds(bounds: LatLngBounds): this
// Update the bounds that this ImageOverlay covers // Update the bounds that this ImageOverlay covers
setBounds: function (bounds) { setBounds: function (bounds) {
this._bounds = bounds; this._bounds = toLatLngBounds(bounds);
if (this._map) { if (this._map) {
this._reset(); this._reset();
@@ -8979,8 +8994,8 @@ var imageOverlay = function (url, bounds, options) {
* *
* ```js * ```js
* var videoUrl = 'https://www.mapbox.com/bites/00188/patricia_nasa.webm', * var videoUrl = 'https://www.mapbox.com/bites/00188/patricia_nasa.webm',
* imageBounds = [[ 32, -130], [ 13, -100]]; * videoBounds = [[ 32, -130], [ 13, -100]];
* L.imageOverlay(imageUrl, imageBounds).addTo(map); * L.VideoOverlay(videoUrl, videoBounds ).addTo(map);
* ``` * ```
*/ */
@@ -8999,8 +9014,11 @@ var VideoOverlay = ImageOverlay.extend({
}, },
_initImage: function () { _initImage: function () {
var vid = this._image = create$1('video', var wasElementSupplied = this._url.tagName === 'VIDEO';
'leaflet-image-layer ' + (this._zoomAnimated ? 'leaflet-zoom-animated' : '')); 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.onselectstart = falseFn;
vid.onmousemove = falseFn; vid.onmousemove = falseFn;
@@ -9009,6 +9027,8 @@ var VideoOverlay = ImageOverlay.extend({
// Fired when the video has finished loading the first frame // Fired when the video has finished loading the first frame
vid.onloadeddata = bind(this.fire, this, 'load'); vid.onloadeddata = bind(this.fire, this, 'load');
if (wasElementSupplied) { return; }
if (!isArray(this._url)) { this._url = [this._url]; } if (!isArray(this._url)) { this._url = [this._url]; }
vid.autoplay = !!this.options.autoplay; vid.autoplay = !!this.options.autoplay;
@@ -9026,11 +9046,12 @@ var VideoOverlay = ImageOverlay.extend({
}); });
// @factory L.videoOverlay(videoUrl: String|Array, bounds: LatLngBounds, options?: VideoOverlay options) // @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) and the // 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. // 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 // @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 // 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`. // the layer as the first argument and should return a `String` or `HTMLElement`.
bindPopup: function (content, options) { bindPopup: function (content, options) {
@@ -9991,7 +10012,7 @@ Layer.include({
// @method bindTooltip(content: String|HTMLElement|Function|Tooltip, options?: Tooltip options): this // @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 // 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`. // the layer as the first argument and should return a `String` or `HTMLElement`.
bindTooltip: function (content, options) { bindTooltip: function (content, options) {
@@ -10304,8 +10325,11 @@ var GridLayer = Layer.extend({
// Opacity of the tiles. Can be used in the `createTile()` function. // Opacity of the tiles. Can be used in the `createTile()` function.
opacity: 1, opacity: 1,
// @option updateWhenIdle: Boolean = depends // @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`. // 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, updateWhenIdle: mobile,
// @option updateWhenZooming: Boolean = true // @option updateWhenZooming: Boolean = true
@@ -11157,7 +11181,7 @@ function gridLayer(options) {
* 'http://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png' * '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: * 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) // Always export us to window global (see #2364)
window.L = exports; window.L = exports;
Object.freeze = freeze;
exports.version = version; exports.version = version;
exports.noConflict = noConflict; exports.noConflict = noConflict;
exports.Control = Control; exports.Control = Control;

File diff suppressed because one or more lines are too long

View File

@@ -366,6 +366,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

View File

@@ -17,7 +17,7 @@
$GLOBALS['LEAFLET_LIBRARIES']['leaflet'] = array $GLOBALS['LEAFLET_LIBRARIES']['leaflet'] = array
( (
'name' => 'Leaflet', '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>', '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',