Comparing version 1.3.4 to 1.4.0
{ | ||
"name": "leaflet", | ||
"version": "1.3.4", | ||
"version": "1.4.0", | ||
"description": "JavaScript library for mobile-friendly interactive maps", | ||
@@ -5,0 +5,0 @@ "devDependencies": { |
@@ -155,9 +155,9 @@ | ||
DomUtil.addClass(this._container, 'leaflet-control-layers-expanded'); | ||
this._form.style.height = null; | ||
this._section.style.height = null; | ||
var acceptableHeight = this._map.getSize().y - (this._container.offsetTop + 50); | ||
if (acceptableHeight < this._form.clientHeight) { | ||
DomUtil.addClass(this._form, 'leaflet-control-layers-scrollbar'); | ||
this._form.style.height = acceptableHeight + 'px'; | ||
if (acceptableHeight < this._section.clientHeight) { | ||
DomUtil.addClass(this._section, 'leaflet-control-layers-scrollbar'); | ||
this._section.style.height = acceptableHeight + 'px'; | ||
} else { | ||
DomUtil.removeClass(this._form, 'leaflet-control-layers-scrollbar'); | ||
DomUtil.removeClass(this._section, 'leaflet-control-layers-scrollbar'); | ||
} | ||
@@ -186,3 +186,3 @@ this._checkDisabledLayers(); | ||
var form = this._form = DomUtil.create('form', className + '-list'); | ||
var section = this._section = DomUtil.create('section', className + '-list'); | ||
@@ -215,7 +215,7 @@ if (collapsed) { | ||
this._baseLayersList = DomUtil.create('div', className + '-base', form); | ||
this._separator = DomUtil.create('div', className + '-separator', form); | ||
this._overlaysList = DomUtil.create('div', className + '-overlays', form); | ||
this._baseLayersList = DomUtil.create('div', className + '-base', section); | ||
this._separator = DomUtil.create('div', className + '-separator', section); | ||
this._overlaysList = DomUtil.create('div', className + '-overlays', section); | ||
container.appendChild(form); | ||
container.appendChild(section); | ||
}, | ||
@@ -222,0 +222,0 @@ |
@@ -90,3 +90,3 @@ import * as DomEvent from './DomEvent'; | ||
var parent = el.parentNode; | ||
if (parent.lastChild !== el) { | ||
if (parent && parent.lastChild !== el) { | ||
parent.appendChild(el); | ||
@@ -100,3 +100,3 @@ } | ||
var parent = el.parentNode; | ||
if (parent.firstChild !== el) { | ||
if (parent && parent.firstChild !== el) { | ||
parent.insertBefore(el, parent.firstChild); | ||
@@ -154,2 +154,7 @@ } | ||
export function getClass(el) { | ||
// Check if the element is an SVGElementInstance and use the correspondingElement instead | ||
// (Required for linked SVG elements in IE11.) | ||
if (el.correspondingElement) { | ||
el = el.correspondingElement; | ||
} | ||
return el.className.baseVal === undefined ? el.className : el.className.baseVal; | ||
@@ -156,0 +161,0 @@ } |
@@ -39,3 +39,3 @@ import {Evented} from '../core/Events'; | ||
// @option attribution: String = null | ||
// String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox". | ||
// String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. | ||
attribution: null, | ||
@@ -42,0 +42,0 @@ |
@@ -238,3 +238,4 @@ import {DivOverlay} from './DivOverlay'; | ||
_adjustPan: function () { | ||
if (!this.options.autoPan || (this._map._panAnim && this._map._panAnim._inProgress)) { return; } | ||
if (!this.options.autoPan) { return; } | ||
if (this._map._panAnim) { this._map._panAnim.stop(); } | ||
@@ -241,0 +242,0 @@ var map = this._map, |
@@ -12,3 +12,3 @@ import {GridLayer} from './GridLayer'; | ||
* @aka L.TileLayer | ||
* Used to load and display tile layers on the map. Extends `GridLayer`. | ||
* Used to load and display tile layers on the map. Note that most tile servers require attribution, which you can set under `Layer`. Extends `GridLayer`. | ||
* | ||
@@ -18,3 +18,3 @@ * @example | ||
* ```js | ||
* L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png?{foo}', {foo: 'bar'}).addTo(map); | ||
* L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png?{foo}', {foo: 'bar', attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'}).addTo(map); | ||
* ``` | ||
@@ -119,3 +119,9 @@ * | ||
// Updates the layer's URL template and redraws it (unless `noRedraw` is set to `true`). | ||
// If the URL does not change, the layer will not be redrawn unless | ||
// the noRedraw parameter is set to false. | ||
setUrl: function (url, noRedraw) { | ||
if (this._url === url && noRedraw === undefined) { | ||
noRedraw = true; | ||
} | ||
this._url = url; | ||
@@ -122,0 +128,0 @@ |
@@ -93,4 +93,2 @@ import {Renderer} from './Renderer'; | ||
this._drawnLayers = {}; | ||
Renderer.prototype._update.call(this); | ||
@@ -165,4 +163,2 @@ | ||
delete this._drawnLayers[layer._leaflet_id]; | ||
delete layer._order; | ||
@@ -195,5 +191,9 @@ | ||
dashArray = [], | ||
dashValue, | ||
i; | ||
for (i = 0; i < parts.length; i++) { | ||
dashArray.push(Number(parts[i])); | ||
dashValue = Number(parts[i]); | ||
// Ignore dash array containing invalid lengths | ||
if (isNaN(dashValue)) { return; } | ||
dashArray.push(dashValue); | ||
} | ||
@@ -280,4 +280,2 @@ layer.options._dashArray = dashArray; | ||
this._drawnLayers[layer._leaflet_id] = layer; | ||
ctx.beginPath(); | ||
@@ -309,4 +307,2 @@ | ||
this._drawnLayers[layer._leaflet_id] = layer; | ||
if (s !== 1) { | ||
@@ -416,2 +412,5 @@ ctx.save(); | ||
var order = layer._order; | ||
if (!order) { return; } | ||
var next = order.next; | ||
@@ -445,2 +444,5 @@ var prev = order.prev; | ||
var order = layer._order; | ||
if (!order) { return; } | ||
var next = order.next; | ||
@@ -447,0 +449,0 @@ var prev = order.prev; |
@@ -27,3 +27,2 @@ import * as DomUtil from '../../dom/DomUtil'; | ||
* | ||
* Although SVG is not available on IE7 and IE8, these browsers support [VML](https://en.wikipedia.org/wiki/Vector_Markup_Language), and the SVG renderer will fall back to VML in this case. | ||
* | ||
@@ -30,0 +29,0 @@ * VML was deprecated in 2012, which means VML functionality exists only for backwards compatibility |
@@ -129,2 +129,9 @@ import * as Util from '../core/Util'; | ||
// Make sure to assign internal flags at the beginning, | ||
// to avoid inconsistent state in some edge cases. | ||
this._handlers = []; | ||
this._layers = {}; | ||
this._zoomBoundLayers = {}; | ||
this._sizeChanged = true; | ||
this._initContainer(id); | ||
@@ -150,7 +157,2 @@ this._initLayout(); | ||
this._handlers = []; | ||
this._layers = {}; | ||
this._zoomBoundLayers = {}; | ||
this._sizeChanged = true; | ||
this.callInitHooks(); | ||
@@ -514,2 +516,47 @@ | ||
// @method panInside(latlng: LatLng, options?: options): this | ||
// Pans the map the minimum amount to make the `latlng` visible. Use | ||
// `padding`, `paddingTopLeft` and `paddingTopRight` options to fit | ||
// the display to more restricted bounds, like [`fitBounds`](#map-fitbounds). | ||
// If `latlng` is already within the (optionally padded) display bounds, | ||
// the map will not be panned. | ||
panInside: function (latlng, options) { | ||
options = options || {}; | ||
var paddingTL = toPoint(options.paddingTopLeft || options.padding || [0, 0]), | ||
paddingBR = toPoint(options.paddingBottomRight || options.padding || [0, 0]), | ||
center = this.getCenter(), | ||
pixelCenter = this.project(center), | ||
pixelPoint = this.project(latlng), | ||
pixelBounds = this.getPixelBounds(), | ||
halfPixelBounds = pixelBounds.getSize().divideBy(2), | ||
paddedBounds = toBounds([pixelBounds.min.add(paddingTL), pixelBounds.max.subtract(paddingBR)]); | ||
if (!paddedBounds.contains(pixelPoint)) { | ||
this._enforcingBounds = true; | ||
var diff = pixelCenter.subtract(pixelPoint), | ||
newCenter = toPoint(pixelPoint.x + diff.x, pixelPoint.y + diff.y); | ||
if (pixelPoint.x < paddedBounds.min.x || pixelPoint.x > paddedBounds.max.x) { | ||
newCenter.x = pixelCenter.x - diff.x; | ||
if (diff.x > 0) { | ||
newCenter.x += halfPixelBounds.x - paddingTL.x; | ||
} else { | ||
newCenter.x -= halfPixelBounds.x - paddingBR.x; | ||
} | ||
} | ||
if (pixelPoint.y < paddedBounds.min.y || pixelPoint.y > paddedBounds.max.y) { | ||
newCenter.y = pixelCenter.y - diff.y; | ||
if (diff.y > 0) { | ||
newCenter.y += halfPixelBounds.y - paddingTL.y; | ||
} else { | ||
newCenter.y -= halfPixelBounds.y - paddingBR.y; | ||
} | ||
} | ||
this.panTo(this.unproject(newCenter), options); | ||
this._enforcingBounds = false; | ||
} | ||
return this; | ||
}, | ||
// @method invalidateSize(options: Zoom/pan options): this | ||
@@ -1633,3 +1680,3 @@ // Checks if the map container size changed and updates the map if so — | ||
// @event zoomanim: ZoomAnimEvent | ||
// Fired on every frame of a zoom animation | ||
// Fired at least once per zoom animation. For continous zoom, like pinch zooming, fired once per frame during zoom. | ||
this.fire('zoomanim', { | ||
@@ -1636,0 +1683,0 @@ center: center, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3351942
34729