X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/5d30594a7b9856951ddf87367bab153fbe9471b6..10294f4849b5d97185c618687a710a2dfc19f148:/vendor/assets/leaflet/leaflet.js diff --git a/vendor/assets/leaflet/leaflet.js b/vendor/assets/leaflet/leaflet.js index f977f27d8..12bf1f0cd 100644 --- a/vendor/assets/leaflet/leaflet.js +++ b/vendor/assets/leaflet/leaflet.js @@ -1,5 +1,5 @@ /* @preserve - * Leaflet 1.3.3, a JS library for interactive maps. http://leafletjs.com + * Leaflet 1.3.4, a JS library for interactive maps. http://leafletjs.com * (c) 2010-2018 Vladimir Agafonkin, (c) 2010-2011 CloudMade */ @@ -9,7 +9,7 @@ (factory((global.L = {}))); }(this, (function (exports) { 'use strict'; -var version = "1.3.3"; +var version = "1.3.4"; /* * @namespace Util @@ -2221,7 +2221,7 @@ function removeDoubleTapListener(obj, id) { // @property TRANSFORM: String // Vendor-prefixed transform style name (e.g. `'webkitTransform'` for WebKit). var TRANSFORM = testProp( - ['transform', 'WebkitTransform', 'OTransform', 'MozTransform', 'msTransform']); + ['transform', 'webkitTransform', 'OTransform', 'MozTransform', 'msTransform']); // webkitTransition comes first because some browser versions that drop vendor prefix don't do // the same for the transitionend event, in particular the Android 4.1 stock browser @@ -5369,6 +5369,10 @@ Map.mergeOptions({ Map.addInitHook(function () { if (this.options.zoomControl) { + // @section Controls + // @property zoomControl: Control.Zoom + // The default zoom control (only available if the + // [`zoomControl` option](#map-zoomcontrol) was `true` when creating the map). this.zoomControl = new Zoom(); this.addControl(this.zoomControl); } @@ -7014,7 +7018,7 @@ var Icon = Class.extend({ options: { popupAnchor: [0, 0], - tooltipAnchor: [0, 0], + tooltipAnchor: [0, 0] }, initialize: function (options) { @@ -7330,22 +7334,6 @@ var Marker = Layer.extend({ // Option inherited from "Interactive layer" abstract class interactive: true, - // @option draggable: Boolean = false - // Whether the marker is draggable with mouse/touch or not. - draggable: false, - - // @option autoPan: Boolean = false - // Set it to `true` if you want the map to do panning animation when marker hits the edges. - autoPan: false, - - // @option autoPanPadding: Point = Point(50, 50) - // Equivalent of setting both top left and bottom right autopan padding to the same value. - autoPanPadding: [50, 50], - - // @option autoPanSpeed: Number = 10 - // Number of pixels the map should move by. - autoPanSpeed: 10, - // @option keyboard: Boolean = true // Whether the marker can be tabbed to with a keyboard and clicked by pressing enter. keyboard: true, @@ -7381,7 +7369,25 @@ var Marker = Layer.extend({ // @option bubblingMouseEvents: Boolean = false // When `true`, a mouse event on this marker will trigger the same event on the map // (unless [`L.DomEvent.stopPropagation`](#domevent-stoppropagation) is used). - bubblingMouseEvents: false + bubblingMouseEvents: false, + + // @section Draggable marker options + // @option draggable: Boolean = false + // Whether the marker is draggable with mouse/touch or not. + draggable: false, + + // @option autoPan: Boolean = false + // Whether to pan the map when dragging this marker near its edge or not. + autoPan: false, + + // @option autoPanPadding: Point = Point(50, 50) + // Distance (in pixels to the left/right and to the top/bottom) of the + // map edge to start panning the map. + autoPanPadding: [50, 50], + + // @option autoPanSpeed: Number = 10 + // Number of pixels the map should pan by. + autoPanSpeed: 10 }, /* @section @@ -8963,12 +8969,12 @@ var ImageOverlay = Layer.extend({ errorOverlayUrl: '', // @option zIndex: Number = 1 - // The explicit [zIndex](https://developer.mozilla.org/docs/Web/CSS/CSS_Positioning/Understanding_z_index) of the tile layer. + // The explicit [zIndex](https://developer.mozilla.org/docs/Web/CSS/CSS_Positioning/Understanding_z_index) of the overlay layer. zIndex: 1, // @option className: String = '' // A custom class name to assign to the image. Empty by default. - className: '', + className: '' }, initialize: function (url, bounds, options) { // (String, LatLngBounds, Object) @@ -9074,7 +9080,7 @@ var ImageOverlay = Layer.extend({ return events; }, - // @method: setZIndex(value: Number) : this + // @method setZIndex(value: Number): this // Changes the [zIndex](#imageoverlay-zindex) of the image overlay. setZIndex: function (value) { this.options.zIndex = value; @@ -9160,7 +9166,7 @@ var ImageOverlay = Layer.extend({ _overlayOnError: function () { // @event error: Event - // Fired when the ImageOverlay layer has loaded its image + // Fired when the ImageOverlay layer fails to load its image this.fire('error'); var errorUrl = this.options.errorOverlayUrl; @@ -11220,12 +11226,6 @@ var GridLayer = Layer.extend({ var tile = this._tiles[key]; if (!tile) { return; } - // Cancels any pending http requests associated with the tile - // unless we're on Android's stock browser, - // see https://github.com/Leaflet/Leaflet/issues/137 - if (!androidStock) { - tile.el.setAttribute('src', emptyImageUrl); - } remove(tile.el); delete this._tiles[key]; @@ -11294,8 +11294,6 @@ var GridLayer = Layer.extend({ }, _tileReady: function (coords, err, tile) { - if (!this._map || tile.getAttribute('src') === emptyImageUrl) { return; } - if (err) { // @event tileerror: TileErrorEvent // Fired when there is an error loading a tile. @@ -11611,6 +11609,28 @@ var TileLayer = GridLayer.extend({ } } } + }, + + _removeTile: function (key) { + var tile = this._tiles[key]; + if (!tile) { return; } + + // Cancels any pending http requests associated with the tile + // unless we're on Android's stock browser, + // see https://github.com/Leaflet/Leaflet/issues/137 + if (!androidStock) { + tile.el.setAttribute('src', emptyImageUrl); + } + + return GridLayer.prototype._removeTile.call(this, key); + }, + + _tileReady: function (coords, err, tile) { + if (!this._map || (tile && tile.getAttribute('src') === emptyImageUrl)) { + return; + } + + return GridLayer.prototype._tileReady.call(this, coords, err, tile); } }); @@ -12073,7 +12093,7 @@ var Canvas = Renderer.extend({ _updateDashArray: function (layer) { if (typeof layer.options.dashArray === 'string') { - var parts = layer.options.dashArray.split(','), + var parts = layer.options.dashArray.split(/[, ]+/), dashArray = [], i; for (i = 0; i < parts.length; i++) {