From: Tom Hughes Date: Mon, 10 Sep 2018 21:30:01 +0000 (+0100) Subject: Update leaflet to 1.3.4 X-Git-Tag: live~3401 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/983f7325ae08ded5bb0d5ed1f9ec25ae57f4a1c0 Update leaflet to 1.3.4 --- diff --git a/Vendorfile b/Vendorfile index 5303d738f..aeba4bf8b 100644 --- a/Vendorfile +++ b/Vendorfile @@ -11,13 +11,13 @@ folder 'vendor/assets' do end folder 'leaflet' do - file 'leaflet.js', 'https://unpkg.com/leaflet@1.3.3/dist/leaflet-src.js' - file 'leaflet.css', 'https://unpkg.com/leaflet@1.3.3/dist/leaflet.css' + file 'leaflet.js', 'https://unpkg.com/leaflet@1.3.4/dist/leaflet-src.js' + file 'leaflet.css', 'https://unpkg.com/leaflet@1.3.4/dist/leaflet.css' [ 'layers.png', 'layers-2x.png', 'marker-icon.png', 'marker-icon-2x.png', 'marker-shadow.png' ].each do |image| - file "images/#{image}", "https://unpkg.com/leaflet@1.3.3/dist/images/#{image}" + file "images/#{image}", "https://unpkg.com/leaflet@1.3.4/dist/images/#{image}" end from 'git://github.com/aratcliffe/Leaflet.contextmenu.git', :tag => 'v1.5.0' do diff --git a/vendor/assets/leaflet/leaflet.css b/vendor/assets/leaflet/leaflet.css index d1b47a125..70802f368 100644 --- a/vendor/assets/leaflet/leaflet.css +++ b/vendor/assets/leaflet/leaflet.css @@ -45,7 +45,8 @@ .leaflet-container .leaflet-marker-pane img, .leaflet-container .leaflet-shadow-pane img, .leaflet-container .leaflet-tile-pane img, -.leaflet-container img.leaflet-image-layer { +.leaflet-container img.leaflet-image-layer, +.leaflet-container .leaflet-tile { max-width: none !important; max-height: none !important; } @@ -168,7 +169,6 @@ opacity: 0; -webkit-transition: opacity 0.2s linear; -moz-transition: opacity 0.2s linear; - -o-transition: opacity 0.2s linear; transition: opacity 0.2s linear; } .leaflet-fade-anim .leaflet-map-pane .leaflet-popup { @@ -185,14 +185,12 @@ .leaflet-zoom-anim .leaflet-zoom-animated { -webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1); -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1); - -o-transition: -o-transform 0.25s cubic-bezier(0,0,0.25,1); transition: transform 0.25s cubic-bezier(0,0,0.25,1); } .leaflet-zoom-anim .leaflet-tile, .leaflet-pan-anim .leaflet-tile { -webkit-transition: none; -moz-transition: none; - -o-transition: none; transition: none; } @@ -209,6 +207,7 @@ .leaflet-grab { cursor: -webkit-grab; cursor: -moz-grab; + cursor: grab; } .leaflet-crosshair, .leaflet-crosshair .leaflet-interactive { @@ -224,6 +223,7 @@ cursor: move; cursor: -webkit-grabbing; cursor: -moz-grabbing; + cursor: grabbing; } /* marker & overlays interactivity */ @@ -494,7 +494,6 @@ -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); -ms-transform: rotate(45deg); - -o-transform: rotate(45deg); transform: rotate(45deg); } .leaflet-popup-content-wrapper, 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++) {