Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

leaflet

Package Overview
Dependencies
Maintainers
5
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leaflet - npm Package Compare versions

Comparing version 1.7.1 to 1.8.0-alpha.0

src/map/handler/Map.TapHold.js

87

package.json
{
"name": "leaflet",
"version": "1.7.1",
"version": "1.8.0-alpha.0",
"homepage": "https://leafletjs.com/",
"description": "JavaScript library for mobile-friendly interactive maps",
"devDependencies": {
"eslint": "^6.8.0",
"eslint-config-mourner": "^2.0.1",
"git-rev-sync": "^2.1.0",
"@rollup/plugin-json": "^4.1.0",
"bundlemon": "^1.3.0",
"eslint": "^8.10.0",
"eslint-config-mourner": "^2.0.3",
"eslint-plugin-script-tags": "^0.5.0",
"git-rev-sync": "^3.0.2",
"happen": "~0.3.2",
"karma": "^5.2.1",
"karma": "^6.3.17",
"karma-chrome-launcher": "^3.1.0",
"karma-edge-launcher": "^0.4.2",
"karma-expect": "^1.1.3",
"karma-firefox-launcher": "^1.3.0",
"karma-firefox-launcher": "^2.1.2",
"karma-ie-launcher": "^1.0.0",
"karma-mocha": "^2.0.1",
"karma-phantomjs-launcher": "^1.0.4",
"karma-rollup-preprocessor": "^6.1.2",
"karma-rollup-preprocessor": "^7.0.8",
"karma-safari-launcher": "~1.0.0",
"karma-sinon": "^1.0.5",
"leafdoc": "^1.4.1",
"mocha": "^7.1.2",
"phantomjs-prebuilt": "^2.1.16",
"prosthetic-hand": "^1.3.1",
"rollup": "^0.59.4",
"leafdoc": "^2.3.0",
"mocha": "^9.2.1",
"prosthetic-hand": "^1.4.0",
"rollup": "^2.70.0",
"rollup-plugin-git-version": "^0.3.1",
"rollup-plugin-json": "^4.0.0",
"sinon": "^7.5.0",
"ssri": "^8.0.0",
"uglify-js": "^3.10.3"
"ssri": "^8.0.1",
"uglify-js": "^3.15.2"
},

@@ -38,19 +38,31 @@ "main": "dist/leaflet-src.js",

"src",
"!dist/leaflet.zip"
"!dist/leaflet.zip",
"!*.leafdoc"
],
"scripts": {
"docs": "node ./build/docs.js",
"pretest": "npm run lint",
"test": "npm run test-nolint",
"test-nolint": "karma start ./spec/karma.conf.js",
"test": "karma start ./spec/karma.conf.js",
"build": "npm run rollup && npm run uglify",
"release": "./build/publish.sh",
"lint": "eslint src spec/suites docs/docs/js",
"lint": "eslint .",
"lintfix": "npm run lint -- --fix",
"rollup": "rollup -c build/rollup-config.js",
"watch": "rollup -w -c build/rollup-watch-config.js",
"watch": "rollup -w -c build/rollup-config.js",
"uglify": "uglifyjs dist/leaflet-src.js -c -m -o dist/leaflet.js --source-map filename=dist/leaflet.js.map --source-map content=dist/leaflet-src.js.map --source-map url=leaflet.js.map --comments",
"integrity": "node ./build/integrity.js"
"integrity": "node ./build/integrity.js",
"bundlemon": "bundlemon --subProject no-compression --defaultCompression none && bundlemon --subProject gzip-compression --defaultCompression gzip",
"serve": "cd docs && bundle exec jekyll serve"
},
"eslintConfig": {
"ignorePatterns": [
"dist",
"debug",
"docs/docs/highlight",
"docs/SlavaUkraini",
"docs/examples/choropleth/us-states.js",
"docs/examples/geojson/sample-geojson.js",
"docs/examples/map-panes/eu-countries.js",
"docs/examples/extending/extending-2-layers.md",
"docs/_posts/2012*",
"docs/_site"
],
"root": true,

@@ -66,2 +78,5 @@ "globals": {

"extends": "mourner",
"plugins": [
"script-tags"
],
"parserOptions": {

@@ -100,3 +115,25 @@ "ecmaVersion": 6,

]
}
},
"overrides": [
{
"files": [
"build/**/*"
],
"env": {
"node": true
},
"rules": {
"global-require": 0
}
},
{
"files": [
"*.md"
],
"rules": {
"eol-last": 0,
"no-unused-vars": 0
}
}
]
},

@@ -103,0 +140,0 @@ "repository": {

@@ -1,3 +0,28 @@

<img width="600" src="https://rawgit.com/Leaflet/Leaflet/master/src/images/logo.svg" alt="Leaflet" />
Leaflet was created 11 years ago by [Vladimir Agafonkin](https://agafonkin.com/), an Ukrainian citizen living in Kyiv.
Vladimir is no longer in Kyiv, because Russian bombs are falling over the city. His family, his friends, his neighbours, thousands and thousands of absolutely wonderful people, are either seeking refuge or fighting for their lives.
The Russian occupation of Ukraine contravenes and violates several international laws, including the United Nations Charter. It is an unprovoked, unjustifiable, and despicable action that endangers countless civilians.
As Vladimir [expressed a few days ago](https://twitter.com/LeafletJS/status/1496051256409919489):
> If you want to help, educate yourself and others on the Russian threat, follow reputable journalists, demand severe Russian sanctions and Ukrainian support from your leaders, protest war, reach out to Ukrainian friends, donate to Ukrainian charities. Just don't be silent.
Ukrainians are recommending the [https://savelife.in.ua/en/donate/](https://savelife.in.ua/en/donate/) charity. Consider also the [Ukrainian Red Cross](https://redcross.org.ua/en/).
If an appeal to humanity doesn't work for you, I'll appeal to your egoism: the future of Ukrainian citizens is the future of Leaflet.
It is chilling to see Leaflet being used for [factual reporting of the war](https://liveuamap.com/) and for coordination of humanitarian efforts [in Romaina](https://refugees.ro/) and [in Poland](https://dopomoha.pl/). We commend these uses of Leaflet.
If you support the actions of the Russian government (even after reading all this), do everyone else a favour and [carry some seeds in your pocket](https://www.theguardian.com/world/video/2022/feb/25/ukrainian-woman-sunflower-seeds-russian-soldiers-video).
Yours truly,
Leaflet maintainers.
---
<img width="600" src="https://rawgit.com/Leaflet/Leaflet/main/src/images/logo.svg" alt="Leaflet" />
Leaflet is the leading open-source JavaScript library for **mobile-friendly interactive maps**.

@@ -14,3 +39,3 @@ Weighing just about 39 KB of gzipped JS plus 4 KB of gzipped CSS code, it has all the mapping [features][] most developers ever need.

For more info, docs and tutorials, check out the [official website][].<br>
For **Leaflet downloads** (including the built master version), check out the [download page][].
For **Leaflet downloads** (including the built main version), check out the [download page][].

@@ -22,3 +47,3 @@ We're happy to meet new contributors.

[![Build Status](https://travis-ci.org/Leaflet/Leaflet.svg?branch=master)](https://travis-ci.org/Leaflet/Leaflet)
[![CI](https://github.com/Leaflet/Leaflet/actions/workflows/main.yml/badge.svg)](https://github.com/Leaflet/Leaflet/actions/workflows/main.yml)

@@ -31,5 +56,5 @@ [contributors]: https://github.com/Leaflet/Leaflet/graphs/contributors

[hosted on GitHub]: http://github.com/Leaflet/Leaflet
[contribute]: https://github.com/Leaflet/Leaflet/blob/master/CONTRIBUTING.md "A guide to contributing to Leaflet"
[contribute]: https://github.com/Leaflet/Leaflet/blob/main/CONTRIBUTING.md "A guide to contributing to Leaflet"
[official website]: http://leafletjs.com
[download page]: http://leafletjs.com/download.html

@@ -22,5 +22,6 @@

// @option prefix: String = 'Leaflet'
// @option prefix: String|false = 'Leaflet'
// The HTML text shown before the attributions. Pass `false` to disable.
prefix: '<a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'
prefix: '<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">Leaflet</a>'
},

@@ -48,7 +49,22 @@

map.on('layeradd', this._addAttribution, this);
return this._container;
},
// @method setPrefix(prefix: String): this
// Sets the text before the attributions.
onRemove: function (map) {
map.off('layeradd', this._addAttribution, this);
},
_addAttribution: function (ev) {
if (ev.layer.getAttribution) {
this.addAttribution(ev.layer.getAttribution());
ev.layer.once('remove', function () {
this.removeAttribution(ev.layer.getAttribution());
}, this);
}
},
// @method setPrefix(prefix: String|false): this
// The HTML text shown before the attributions. Pass `false` to disable.
setPrefix: function (prefix) {

@@ -108,3 +124,3 @@ this.options.prefix = prefix;

this._container.innerHTML = prefixAndAttribs.join(' | ');
this._container.innerHTML = prefixAndAttribs.join(' <span aria-hidden="true">|</span> ');
}

@@ -111,0 +127,0 @@ });

@@ -18,3 +18,3 @@

// @section
// @aka Control options
// @aka Control Options
options: {

@@ -21,0 +21,0 @@ // @option position: String = 'topright'

import {Control} from './Control';
import * as Util from '../core/Util';
import * as Browser from '../core/Browser';
import * as DomEvent from '../dom/DomEvent';

@@ -13,3 +12,3 @@ import * as DomUtil from '../dom/DomUtil';

*
* The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the [detailed example](http://leafletjs.com/examples/layers-control/)). Extends `Control`.
* The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the [detailed example](https://leafletjs.com/examples/layers-control/)). Extends `Control`.
*

@@ -53,3 +52,3 @@ * @example

// @option collapsed: Boolean = true
// If `true`, the control will be collapsed into an icon and expanded on mouse hover or touch.
// If `true`, the control will be collapsed into an icon and expanded on mouse hover, touch, or keyboard activation.
collapsed: true,

@@ -192,8 +191,12 @@ position: 'topright',

if (!Browser.android) {
DomEvent.on(container, {
mouseenter: this.expand,
mouseleave: this.collapse
}, this);
}
DomEvent.on(container, {
mouseenter: function () {
DomEvent.on(section, 'click', DomEvent.preventDefault);
this.expand();
setTimeout(function () {
DomEvent.off(section, 'click', DomEvent.preventDefault);
});
},
mouseleave: this.collapse
}, this);
}

@@ -204,9 +207,6 @@

link.title = 'Layers';
link.setAttribute('role', 'button');
if (Browser.touch) {
DomEvent.on(link, 'click', DomEvent.stop);
DomEvent.on(link, 'click', this.expand, this);
} else {
DomEvent.on(link, 'focus', this.expand, this);
}
DomEvent.on(link, 'click', DomEvent.preventDefault); // prevent link function
DomEvent.on(link, 'focus', this.expand, this);

@@ -311,3 +311,3 @@ if (!collapsed) {

// IE7 bugs out if you create a radio dynamically, so you have to do it this hacky way (see http://bit.ly/PqYLBe)
// IE7 bugs out if you create a radio dynamically, so you have to do it this hacky way (see https://stackoverflow.com/a/119079)
_createRadioElement: function (name, checked) {

@@ -348,3 +348,3 @@

// https://github.com/Leaflet/Leaflet/issues/2771
var holder = document.createElement('div');
var holder = document.createElement('span');

@@ -418,12 +418,2 @@ label.appendChild(holder);

return this;
},
_expand: function () {
// Backward compatibility, remove me in 1.1.
return this.expand();
},
_collapse: function () {
// Backward compatibility, remove me in 1.1.
return this.collapse();
}

@@ -430,0 +420,0 @@

@@ -21,5 +21,5 @@

// @option zoomInText: String = '+'
// @option zoomInText: String = '<span aria-hidden="true">+</span>'
// The text set on the 'zoom in' button.
zoomInText: '+',
zoomInText: '<span aria-hidden="true">+</span>',

@@ -30,5 +30,5 @@ // @option zoomInTitle: String = 'Zoom in'

// @option zoomOutText: String = '&#x2212;'
// @option zoomOutText: String = '<span aria-hidden="true">&#x2212;</span>'
// The text set on the 'zoom out' button.
zoomOutText: '&#x2212;',
zoomOutText: '<span aria-hidden="true">&#x2212;</span>',

@@ -110,8 +110,12 @@ // @option zoomOutTitle: String = 'Zoom out'

DomUtil.removeClass(this._zoomOutButton, className);
this._zoomInButton.setAttribute('aria-disabled', 'false');
this._zoomOutButton.setAttribute('aria-disabled', 'false');
if (this._disabled || map._zoom === map.getMinZoom()) {
DomUtil.addClass(this._zoomOutButton, className);
this._zoomOutButton.setAttribute('aria-disabled', 'true');
}
if (this._disabled || map._zoom === map.getMaxZoom()) {
DomUtil.addClass(this._zoomInButton, className);
this._zoomInButton.setAttribute('aria-disabled', 'true');
}

@@ -118,0 +122,0 @@ }

@@ -22,100 +22,104 @@ import * as Util from './Util';

// @property ie: Boolean; `true` for all Internet Explorer versions (not Edge).
export var ie = 'ActiveXObject' in window;
var ie = 'ActiveXObject' in window;
// @property ielt9: Boolean; `true` for Internet Explorer versions less than 9.
export var ielt9 = ie && !document.addEventListener;
var ielt9 = ie && !document.addEventListener;
// @property edge: Boolean; `true` for the Edge web browser.
export var edge = 'msLaunchUri' in navigator && !('documentMode' in document);
var edge = 'msLaunchUri' in navigator && !('documentMode' in document);
// @property webkit: Boolean;
// `true` for webkit-based browsers like Chrome and Safari (including mobile versions).
export var webkit = userAgentContains('webkit');
var webkit = userAgentContains('webkit');
// @property android: Boolean
// `true` for any browser running on an Android platform.
export var android = userAgentContains('android');
// **Deprecated.** `true` for any browser running on an Android platform.
var android = userAgentContains('android');
// @property android23: Boolean; `true` for browsers running on Android 2 or Android 3.
export var android23 = userAgentContains('android 2') || userAgentContains('android 3');
// @property android23: Boolean; **Deprecated.** `true` for browsers running on Android 2 or Android 3.
var android23 = userAgentContains('android 2') || userAgentContains('android 3');
/* See https://stackoverflow.com/a/17961266 for details on detecting stock Android */
var webkitVer = parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1], 10); // also matches AppleWebKit
// @property androidStock: Boolean; `true` for the Android stock browser (i.e. not Chrome)
export var androidStock = android && userAgentContains('Google') && webkitVer < 537 && !('AudioNode' in window);
// @property androidStock: Boolean; **Deprecated.** `true` for the Android stock browser (i.e. not Chrome)
var androidStock = android && userAgentContains('Google') && webkitVer < 537 && !('AudioNode' in window);
// @property opera: Boolean; `true` for the Opera browser
export var opera = !!window.opera;
var opera = !!window.opera;
// @property chrome: Boolean; `true` for the Chrome browser.
export var chrome = !edge && userAgentContains('chrome');
var chrome = !edge && userAgentContains('chrome');
// @property gecko: Boolean; `true` for gecko-based browsers like Firefox.
export var gecko = userAgentContains('gecko') && !webkit && !opera && !ie;
var gecko = userAgentContains('gecko') && !webkit && !opera && !ie;
// @property safari: Boolean; `true` for the Safari browser.
export var safari = !chrome && userAgentContains('safari');
var safari = !chrome && userAgentContains('safari');
export var phantom = userAgentContains('phantom');
var phantom = userAgentContains('phantom');
// @property opera12: Boolean
// `true` for the Opera browser supporting CSS transforms (version 12 or later).
export var opera12 = 'OTransition' in style;
var opera12 = 'OTransition' in style;
// @property win: Boolean; `true` when the browser is running in a Windows platform
export var win = navigator.platform.indexOf('Win') === 0;
var win = navigator.platform.indexOf('Win') === 0;
// @property ie3d: Boolean; `true` for all Internet Explorer versions supporting CSS transforms.
export var ie3d = ie && ('transition' in style);
var ie3d = ie && ('transition' in style);
// @property webkit3d: Boolean; `true` for webkit-based browsers supporting CSS transforms.
export var webkit3d = ('WebKitCSSMatrix' in window) && ('m11' in new window.WebKitCSSMatrix()) && !android23;
var webkit3d = ('WebKitCSSMatrix' in window) && ('m11' in new window.WebKitCSSMatrix()) && !android23;
// @property gecko3d: Boolean; `true` for gecko-based browsers supporting CSS transforms.
export var gecko3d = 'MozPerspective' in style;
var gecko3d = 'MozPerspective' in style;
// @property any3d: Boolean
// `true` for all browsers supporting CSS transforms.
export var any3d = !window.L_DISABLE_3D && (ie3d || webkit3d || gecko3d) && !opera12 && !phantom;
var any3d = !window.L_DISABLE_3D && (ie3d || webkit3d || gecko3d) && !opera12 && !phantom;
// @property mobile: Boolean; `true` for all browsers running in a mobile device.
export var mobile = typeof orientation !== 'undefined' || userAgentContains('mobile');
var mobile = typeof orientation !== 'undefined' || userAgentContains('mobile');
// @property mobileWebkit: Boolean; `true` for all webkit-based browsers in a mobile device.
export var mobileWebkit = mobile && webkit;
var mobileWebkit = mobile && webkit;
// @property mobileWebkit3d: Boolean
// `true` for all webkit-based browsers in a mobile device supporting CSS transforms.
export var mobileWebkit3d = mobile && webkit3d;
var mobileWebkit3d = mobile && webkit3d;
// @property msPointer: Boolean
// `true` for browsers implementing the Microsoft touch events model (notably IE10).
export var msPointer = !window.PointerEvent && window.MSPointerEvent;
var msPointer = !window.PointerEvent && window.MSPointerEvent;
// @property pointer: Boolean
// `true` for all browsers supporting [pointer events](https://msdn.microsoft.com/en-us/library/dn433244%28v=vs.85%29.aspx).
export var pointer = !!(window.PointerEvent || msPointer);
var pointer = !!(window.PointerEvent || msPointer);
// @property touch: Boolean
// @property touchNative: Boolean
// `true` for all browsers supporting [touch events](https://developer.mozilla.org/docs/Web/API/Touch_events).
// This does not necessarily mean that the browser is running in a computer with
// **This does not necessarily mean** that the browser is running in a computer with
// a touchscreen, it only means that the browser is capable of understanding
// touch events.
export var touch = !window.L_NO_TOUCH && (pointer || 'ontouchstart' in window ||
(window.DocumentTouch && document instanceof window.DocumentTouch));
var touchNative = 'ontouchstart' in window || !!window.TouchEvent;
// @property touch: Boolean
// `true` for all browsers supporting either [touch](#browser-touch) or [pointer](#browser-pointer) events.
// Note: pointer events will be preferred (if available), and processed for all `touch*` listeners.
var touch = !window.L_NO_TOUCH && (touchNative || pointer);
// @property mobileOpera: Boolean; `true` for the Opera browser in a mobile device.
export var mobileOpera = mobile && opera;
var mobileOpera = mobile && opera;
// @property mobileGecko: Boolean
// `true` for gecko-based browsers running in a mobile device.
export var mobileGecko = mobile && gecko;
var mobileGecko = mobile && gecko;
// @property retina: Boolean
// `true` for browsers on a high-resolution "retina" screen or on any screen when browser's display zoom is more than 100%.
export var retina = (window.devicePixelRatio || (window.screen.deviceXDPI / window.screen.logicalXDPI)) > 1;
var retina = (window.devicePixelRatio || (window.screen.deviceXDPI / window.screen.logicalXDPI)) > 1;
// @property passiveEvents: Boolean
// `true` for browsers that support passive events.
export var passiveEvents = (function () {
var passiveEvents = (function () {
var supportsPassiveOption = false;

@@ -138,3 +142,3 @@ try {

// `true` when the browser supports [`<canvas>`](https://developer.mozilla.org/docs/Web/API/Canvas_API).
export var canvas = (function () {
var canvas = (function () {
return !!document.createElement('canvas').getContext;

@@ -145,7 +149,7 @@ }());

// `true` when the browser supports [SVG](https://developer.mozilla.org/docs/Web/SVG).
export var svg = !!(document.createElementNS && svgCreate('svg').createSVGRect);
var svg = !!(document.createElementNS && svgCreate('svg').createSVGRect);
// @property vml: Boolean
// `true` if the browser supports [VML](https://en.wikipedia.org/wiki/Vector_Markup_Language).
export var vml = !svg && (function () {
var vml = !svg && (function () {
try {

@@ -169,1 +173,37 @@ var div = document.createElement('div');

}
export default {
ie: ie,
ielt9: ielt9,
edge: edge,
webkit: webkit,
android: android,
android23: android23,
androidStock: androidStock,
opera: opera,
chrome: chrome,
gecko: gecko,
safari: safari,
phantom: phantom,
opera12: opera12,
win: win,
ie3d: ie3d,
webkit3d: webkit3d,
gecko3d: gecko3d,
any3d: any3d,
mobile: mobile,
mobileWebkit: mobileWebkit,
mobileWebkit3d: mobileWebkit3d,
msPointer: msPointer,
pointer: pointer,
touch: touch,
touchNative: touchNative,
mobileOpera: mobileOpera,
mobileGecko: mobileGecko,
retina: retina,
passiveEvents: passiveEvents,
canvas: canvas,
svg: svg,
vml: vml,
};

@@ -20,2 +20,4 @@ import * as Util from './Util';

Util.setOptions(this);
// call the constructor

@@ -47,3 +49,2 @@ if (this.initialize) {

Util.extend(NewClass, props.statics);
delete props.statics;
}

@@ -55,13 +56,15 @@

Util.extend.apply(null, [proto].concat(props.includes));
delete props.includes;
}
// mix given properties into the prototype
Util.extend(proto, props);
delete proto.statics;
delete proto.includes;
// merge options
if (proto.options) {
props.options = Util.extend(Util.create(proto.options), props.options);
proto.options = parentProto.options ? Util.create(parentProto.options) : {};
Util.extend(proto.options, props.options);
}
// mix given properties into the prototype
Util.extend(proto, props);
proto._initHooks = [];

@@ -92,3 +95,8 @@

Class.include = function (props) {
var parentOptions = this.prototype.options;
Util.extend(this.prototype, props);
if (props.options) {
this.prototype.options = parentOptions;
this.mergeOptions(props.options);
}
return this;

@@ -95,0 +103,0 @@ };

@@ -72,3 +72,3 @@ import {Class} from './Class';

if (!types) {
if (!arguments.length) {
// clear all listeners if called without arguments

@@ -85,4 +85,9 @@ delete this._events;

var removeAll = arguments.length === 1;
for (var i = 0, len = types.length; i < len; i++) {
this._off(types[i], fn, context);
if (removeAll) {
this._off(types[i]);
} else {
this._off(types[i], fn, context);
}
}

@@ -96,2 +101,6 @@ }

_on: function (type, fn, context) {
if (typeof fn !== 'function') {
console.warn('wrong listener type: ' + typeof fn);
return;
}
this._events = this._events || {};

@@ -136,6 +145,9 @@

if (!fn) {
// Set all removed listeners to noop so they are not called if remove happens in fire
for (i = 0, len = listeners.length; i < len; i++) {
listeners[i].fn = Util.falseFn;
if (arguments.length === 1) { // remove all
if (this._firingCount) {
// Set all removed listeners to noop
// so they are not called if remove happens in fire
for (i = 0, len = listeners.length; i < len; i++) {
listeners[i].fn = Util.falseFn;
}
}

@@ -151,27 +163,28 @@ // clear all listeners for a type if function isn't specified

if (listeners) {
// find fn and remove it
for (i = 0, len = listeners.length; i < len; i++) {
var l = listeners[i];
if (l.ctx !== context) { continue; }
if (l.fn === fn) {
if (typeof fn !== 'function') {
console.warn('wrong listener type: ' + typeof fn);
return;
}
// find fn and remove it
for (i = 0, len = listeners.length; i < len; i++) {
var l = listeners[i];
if (l.ctx !== context) { continue; }
if (l.fn === fn) {
if (this._firingCount) {
// set the removed listener to noop so that's not called if remove happens in fire
l.fn = Util.falseFn;
if (this._firingCount) {
/* copy array in case events are being fired */
this._events[type] = listeners = listeners.slice();
}
listeners.splice(i, 1);
/* copy array in case events are being fired */
this._events[type] = listeners = listeners.slice();
}
listeners.splice(i, 1);
return;
}
return;
}
}
console.warn('listener not found');
},
// @method fire(type: String, data?: Object, propagate?: Boolean): this
// Fires an event of the specified type. You can optionally provide an data
// Fires an event of the specified type. You can optionally provide a data
// object — the first argument of the listener function will contain its

@@ -210,5 +223,9 @@ // properties. The event can optionally be propagated to event parents.

// @method listens(type: String): Boolean
// @method listens(type: String, propagate?: Boolean): Boolean
// Returns `true` if a particular event type has any listeners attached to it.
// The verification can optionally be propagated, it will return `true` if parents have the listener attached to it.
listens: function (type, propagate) {
if (typeof type !== 'string') {
console.warn('"string" type argument expected');
}
var listeners = this._events && this._events[type];

@@ -215,0 +232,0 @@ if (listeners && listeners.length) { return true; }

@@ -1,2 +0,2 @@

import * as Browser from './Browser';
import Browser from './Browser';
export {Browser};

@@ -3,0 +3,0 @@

@@ -55,6 +55,6 @@ /*

export function stamp(obj) {
/*eslint-disable */
obj._leaflet_id = obj._leaflet_id || ++lastId;
if (!('_leaflet_id' in obj)) {
obj['_leaflet_id'] = ++lastId;
}
return obj._leaflet_id;
/* eslint-enable */
}

@@ -112,6 +112,9 @@

// @function formatNum(num: Number, digits?: Number): Number
// Returns the number `num` rounded to `digits` decimals, or to 6 decimals by default.
export function formatNum(num, digits) {
var pow = Math.pow(10, (digits === undefined ? 6 : digits));
// @function formatNum(num: Number, precision?: Number|false): Number
// Returns the number `num` rounded with specified `precision`.
// The default `precision` value is 6 decimal places.
// `false` can be passed to skip any processing (can be useful to avoid round-off errors).
export function formatNum(num, precision) {
if (precision === false) { return num; }
var pow = Math.pow(10, precision === undefined ? 6 : precision);
return Math.round(num * pow) / pow;

@@ -157,3 +160,3 @@ }

var templateRe = /\{ *([\w_-]+) *\}/g;
var templateRe = /\{ *([\w_ -]+) *\}/g;

@@ -200,3 +203,3 @@ // @function template(str: String, data: Object): String

// inspired by http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// inspired by https://paulirish.com/2011/requestanimationframe-for-smart-animating/

@@ -203,0 +206,0 @@ function getPrefixed(name) {

@@ -1,81 +0,70 @@

import * as Browser from '../core/Browser';
/*
* Extends the event handling code with double tap support for mobile browsers.
*
* Note: currently most browsers fire native dblclick, with only a few exceptions
* (see https://github.com/Leaflet/Leaflet/issues/7012#issuecomment-595087386)
*/
var _touchstart = Browser.msPointer ? 'MSPointerDown' : Browser.pointer ? 'pointerdown' : 'touchstart';
var _touchend = Browser.msPointer ? 'MSPointerUp' : Browser.pointer ? 'pointerup' : 'touchend';
var _pre = '_leaflet_';
function makeDblclick(event) {
// in modern browsers `type` cannot be just overridden:
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only
var newEvent = {},
prop, i;
for (i in event) {
prop = event[i];
newEvent[i] = prop && prop.bind ? prop.bind(event) : prop;
}
event = newEvent;
newEvent.type = 'dblclick';
newEvent.detail = 2;
newEvent.isTrusted = false;
newEvent._simulated = true; // for debug purposes
return newEvent;
}
// inspired by Zepto touch code by Thomas Fuchs
export function addDoubleTapListener(obj, handler, id) {
var last, touch,
doubleTap = false,
delay = 250;
var delay = 200;
export function addDoubleTapListener(obj, handler) {
// Most browsers handle double tap natively
obj.addEventListener('dblclick', handler);
function onTouchStart(e) {
if (Browser.pointer) {
if (!e.isPrimary) { return; }
if (e.pointerType === 'mouse') { return; } // mouse fires native dblclick
} else if (e.touches.length > 1) {
// On some platforms the browser doesn't fire native dblclicks for touch events.
// It seems that in all such cases `detail` property of `click` event is always `1`.
// So here we rely on that fact to avoid excessive 'dblclick' simulation when not needed.
var last = 0,
detail;
function simDblclick(e) {
if (e.detail !== 1) {
detail = e.detail; // keep in sync to avoid false dblclick in some cases
return;
}
var now = Date.now(),
delta = now - (last || now);
if (e.pointerType === 'mouse' ||
(e.sourceCapabilities && !e.sourceCapabilities.firesTouchEvents)) {
touch = e.touches ? e.touches[0] : e;
doubleTap = (delta > 0 && delta <= delay);
last = now;
}
return;
}
function onTouchEnd(e) {
if (doubleTap && !touch.cancelBubble) {
if (Browser.pointer) {
if (e.pointerType === 'mouse') { return; }
// work around .type being readonly with MSPointer* events
var newTouch = {},
prop, i;
for (i in touch) {
prop = touch[i];
newTouch[i] = prop && prop.bind ? prop.bind(touch) : prop;
}
touch = newTouch;
var now = Date.now();
if (now - last <= delay) {
detail++;
if (detail === 2) {
handler(makeDblclick(e));
}
touch.type = 'dblclick';
touch.button = 0;
handler(touch);
last = null;
} else {
detail = 1;
}
last = now;
}
obj[_pre + _touchstart + id] = onTouchStart;
obj[_pre + _touchend + id] = onTouchEnd;
obj[_pre + 'dblclick' + id] = handler;
obj.addEventListener('click', simDblclick);
obj.addEventListener(_touchstart, onTouchStart, Browser.passiveEvents ? {passive: false} : false);
obj.addEventListener(_touchend, onTouchEnd, Browser.passiveEvents ? {passive: false} : false);
// On some platforms (notably, chrome<55 on win10 + touchscreen + mouse),
// the browser doesn't fire touchend/pointerup events but does fire
// native dblclicks. See #4127.
// Edge 14 also fires native dblclicks, but only for pointerType mouse, see #5180.
obj.addEventListener('dblclick', handler, false);
return this;
return {
dblclick: handler,
simDblclick: simDblclick
};
}
export function removeDoubleTapListener(obj, id) {
var touchstart = obj[_pre + _touchstart + id],
touchend = obj[_pre + _touchend + id],
dblclick = obj[_pre + 'dblclick' + id];
obj.removeEventListener(_touchstart, touchstart, Browser.passiveEvents ? {passive: false} : false);
obj.removeEventListener(_touchend, touchend, Browser.passiveEvents ? {passive: false} : false);
obj.removeEventListener('dblclick', dblclick, false);
return this;
export function removeDoubleTapListener(obj, handlers) {
obj.removeEventListener('dblclick', handlers.dblclick);
obj.removeEventListener('click', handlers.simDblclick);
}
import {Point} from '../geometry/Point';
import * as Util from '../core/Util';
import * as Browser from '../core/Browser';
import Browser from '../core/Browser';
import {addPointerListener, removePointerListener} from './DomEvent.Pointer';

@@ -26,3 +26,3 @@ import {addDoubleTapListener, removeDoubleTapListener} from './DomEvent.DoubleTap';

if (typeof types === 'object') {
if (types && typeof types === 'object') {
for (var type in types) {

@@ -52,19 +52,33 @@ addOne(obj, type, types[type], fn);

// Removes a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`
// @alternative
// @function off(el: HTMLElement, types: String): this
// Removes all previously added listeners of given types.
// @alternative
// @function off(el: HTMLElement): this
// Removes all previously added listeners from given HTMLElement
export function off(obj, types, fn, context) {
if (typeof types === 'object') {
if (arguments.length === 1) {
batchRemove(obj);
delete obj[eventsKey];
} else if (types && typeof types === 'object') {
for (var type in types) {
removeOne(obj, type, types[type], fn);
}
} else if (types) {
} else {
types = Util.splitWords(types);
for (var i = 0, len = types.length; i < len; i++) {
removeOne(obj, types[i], fn, context);
if (arguments.length === 2) {
batchRemove(obj, function (type) {
return Util.indexOf(types, type) !== -1;
});
} else {
for (var i = 0, len = types.length; i < len; i++) {
removeOne(obj, types[i], fn, context);
}
}
} else {
for (var j in obj[eventsKey]) {
removeOne(obj, j, obj[eventsKey][j]);
}
delete obj[eventsKey];
}

@@ -75,6 +89,8 @@

function browserFiresNativeDblClick() {
// See https://github.com/w3c/pointerevents/issues/171
if (Browser.pointer) {
return !(Browser.edge || Browser.safari);
function batchRemove(obj, filterFn) {
for (var id in obj[eventsKey]) {
var type = id.split(/\d/)[0];
if (!filterFn || filterFn(type)) {
removeOne(obj, type, null, null, id);
}
}

@@ -100,8 +116,8 @@ }

if (Browser.pointer && type.indexOf('touch') === 0) {
if (!Browser.touchNative && Browser.pointer && type.indexOf('touch') === 0) {
// Needs DomEvent.Pointer.js
addPointerListener(obj, type, handler, id);
handler = addPointerListener(obj, type, handler);
} else if (Browser.touch && (type === 'dblclick') && !browserFiresNativeDblClick()) {
addDoubleTapListener(obj, handler, id);
} else if (Browser.touch && (type === 'dblclick')) {
handler = addDoubleTapListener(obj, handler);

@@ -126,3 +142,3 @@ } else if ('addEventListener' in obj) {

} else if ('attachEvent' in obj) {
} else {
obj.attachEvent('on' + type, handler);

@@ -135,14 +151,13 @@ }

function removeOne(obj, type, fn, context) {
function removeOne(obj, type, fn, context, id) {
id = id || type + Util.stamp(fn) + (context ? '_' + Util.stamp(context) : '');
var handler = obj[eventsKey] && obj[eventsKey][id];
var id = type + Util.stamp(fn) + (context ? '_' + Util.stamp(context) : ''),
handler = obj[eventsKey] && obj[eventsKey][id];
if (!handler) { return this; }
if (Browser.pointer && type.indexOf('touch') === 0) {
removePointerListener(obj, type, id);
if (!Browser.touchNative && Browser.pointer && type.indexOf('touch') === 0) {
removePointerListener(obj, type, handler);
} else if (Browser.touch && (type === 'dblclick') && !browserFiresNativeDblClick()) {
removeDoubleTapListener(obj, id);
} else if (Browser.touch && (type === 'dblclick')) {
removeDoubleTapListener(obj, handler);

@@ -153,3 +168,3 @@ } else if ('removeEventListener' in obj) {

} else if ('detachEvent' in obj) {
} else {
obj.detachEvent('on' + type, handler);

@@ -177,3 +192,2 @@ }

}
skipped(e);

@@ -191,7 +205,7 @@ return this;

// @function disableClickPropagation(el: HTMLElement): this
// Adds `stopPropagation` to the element's `'click'`, `'doubleclick'`,
// Adds `stopPropagation` to the element's `'click'`, `'dblclick'`, `'contextmenu'`,
// `'mousedown'` and `'touchstart'` events (plus browser variants).
export function disableClickPropagation(el) {
on(el, 'mousedown touchstart dblclick', stopPropagation);
addOne(el, 'click', fakeStop);
on(el, 'mousedown touchstart dblclick contextmenu', stopPropagation);
el['_leaflet_disable_click'] = true;
return this;

@@ -264,16 +278,2 @@ }

var skipEvents = {};
export function fakeStop(e) {
// fakes stopPropagation by setting a special event flag, checked/reset with skipped(e)
skipEvents[e.type] = true;
}
export function skipped(e) {
var events = skipEvents[e.type];
// reset when checking, as it's only used in map container and propagates outside of the map
skipEvents[e.type] = false;
return events;
}
// check if element really left/entered the event target (for mouseenter/mouseleave)

@@ -280,0 +280,0 @@ export function isExternalTarget(el, e) {

import * as DomEvent from './DomEvent';
import * as Util from '../core/Util';
import * as Browser from '../core/Browser';
import Browser from '../core/Browser';

@@ -9,3 +8,2 @@ /*

var POINTER_DOWN = Browser.msPointer ? 'MSPointerDown' : 'pointerdown';

@@ -15,3 +13,14 @@ var POINTER_MOVE = Browser.msPointer ? 'MSPointerMove' : 'pointermove';

var POINTER_CANCEL = Browser.msPointer ? 'MSPointerCancel' : 'pointercancel';
var pEvent = {
touchstart : POINTER_DOWN,
touchmove : POINTER_MOVE,
touchend : POINTER_UP,
touchcancel : POINTER_CANCEL
};
var handle = {
touchstart : _onPointerStart,
touchmove : _handlePointer,
touchend : _handlePointer,
touchcancel : _handlePointer
};
var _pointers = {};

@@ -21,48 +30,40 @@ var _pointerDocListener = false;

// Provides a touch events wrapper for (ms)pointer events.
// ref http://www.w3.org/TR/pointerevents/ https://www.w3.org/Bugs/Public/show_bug.cgi?id=22890
// ref https://www.w3.org/TR/pointerevents/ https://www.w3.org/Bugs/Public/show_bug.cgi?id=22890
export function addPointerListener(obj, type, handler, id) {
export function addPointerListener(obj, type, handler) {
if (type === 'touchstart') {
_addPointerStart(obj, handler, id);
_addPointerDocListener();
}
if (!handle[type]) {
console.warn('wrong event specified:', type);
return L.Util.falseFn;
}
handler = handle[type].bind(this, handler);
obj.addEventListener(pEvent[type], handler, false);
return handler;
}
} else if (type === 'touchmove') {
_addPointerMove(obj, handler, id);
} else if (type === 'touchend') {
_addPointerEnd(obj, handler, id);
export function removePointerListener(obj, type, handler) {
if (!pEvent[type]) {
console.warn('wrong event specified:', type);
return;
}
obj.removeEventListener(pEvent[type], handler, false);
}
return this;
function _globalPointerDown(e) {
_pointers[e.pointerId] = e;
}
export function removePointerListener(obj, type, id) {
var handler = obj['_leaflet_' + type + id];
if (type === 'touchstart') {
obj.removeEventListener(POINTER_DOWN, handler, false);
} else if (type === 'touchmove') {
obj.removeEventListener(POINTER_MOVE, handler, false);
} else if (type === 'touchend') {
obj.removeEventListener(POINTER_UP, handler, false);
obj.removeEventListener(POINTER_CANCEL, handler, false);
function _globalPointerMove(e) {
if (_pointers[e.pointerId]) {
_pointers[e.pointerId] = e;
}
}
return this;
function _globalPointerUp(e) {
delete _pointers[e.pointerId];
}
function _addPointerStart(obj, handler, id) {
var onDown = Util.bind(function (e) {
// IE10 specific: MsTouch needs preventDefault. See #2000
if (e.MSPOINTER_TYPE_TOUCH && e.pointerType === e.MSPOINTER_TYPE_TOUCH) {
DomEvent.preventDefault(e);
}
_handlePointer(e, handler);
});
obj['_leaflet_touchstart' + id] = onDown;
obj.addEventListener(POINTER_DOWN, onDown, false);
function _addPointerDocListener() {
// need to keep track of what pointers and how many are active to provide e.touches emulation

@@ -80,17 +81,5 @@ if (!_pointerDocListener) {

function _globalPointerDown(e) {
_pointers[e.pointerId] = e;
}
function _handlePointer(handler, e) {
if (e.pointerType === (e.MSPOINTER_TYPE_MOUSE || 'mouse')) { return; }
function _globalPointerMove(e) {
if (_pointers[e.pointerId]) {
_pointers[e.pointerId] = e;
}
}
function _globalPointerUp(e) {
delete _pointers[e.pointerId];
}
function _handlePointer(e, handler) {
e.touches = [];

@@ -105,24 +94,8 @@ for (var i in _pointers) {

function _addPointerMove(obj, handler, id) {
var onMove = function (e) {
// don't fire touch moves when mouse isn't down
if ((e.pointerType === (e.MSPOINTER_TYPE_MOUSE || 'mouse')) && e.buttons === 0) {
return;
}
_handlePointer(e, handler);
};
obj['_leaflet_touchmove' + id] = onMove;
obj.addEventListener(POINTER_MOVE, onMove, false);
function _onPointerStart(handler, e) {
// IE10 specific: MsTouch needs preventDefault. See #2000
if (e.MSPOINTER_TYPE_TOUCH && e.pointerType === e.MSPOINTER_TYPE_TOUCH) {
DomEvent.preventDefault(e);
}
_handlePointer(handler, e);
}
function _addPointerEnd(obj, handler, id) {
var onUp = function (e) {
_handlePointer(e, handler);
};
obj['_leaflet_touchend' + id] = onUp;
obj.addEventListener(POINTER_UP, onUp, false);
obj.addEventListener(POINTER_CANCEL, onUp, false);
}
import * as DomEvent from './DomEvent';
import * as Util from '../core/Util';
import {Point} from '../geometry/Point';
import * as Browser from '../core/Browser';
import Browser from '../core/Browser';

@@ -6,0 +6,0 @@ /*

import {Evented} from '../core/Events';
import * as Browser from '../core/Browser';
import Browser from '../core/Browser';
import * as DomEvent from './DomEvent';

@@ -25,16 +25,3 @@ import * as DomUtil from './DomUtil';

var START = Browser.touch ? 'touchstart mousedown' : 'mousedown';
var END = {
mousedown: 'mouseup',
touchstart: 'touchend',
pointerdown: 'touchend',
MSPointerDown: 'touchend'
};
var MOVE = {
mousedown: 'mousemove',
touchstart: 'touchmove',
pointerdown: 'touchmove',
MSPointerDown: 'touchmove'
};
export var Draggable = Evented.extend({

@@ -89,8 +76,5 @@

_onDown: function (e) {
// Ignore simulated events, since we handle both touch and
// mouse explicitly; otherwise we risk getting duplicates of
// touch events, see #4315.
// Also ignore the event if disabled; this happens in IE11
// Ignore the event if disabled; this happens in IE11
// under some circumstances, see #3666.
if (e._simulated || !this._enabled) { return; }
if (!this._enabled) { return; }

@@ -121,2 +105,3 @@ this._moved = false;

this._startPoint = new Point(first.clientX, first.clientY);
this._startPos = DomUtil.getPosition(this._element);

@@ -126,13 +111,11 @@ // Cache the scale, so that we can continuously compensate for it during drag (_onMove).

DomEvent.on(document, MOVE[e.type], this._onMove, this);
DomEvent.on(document, END[e.type], this._onUp, this);
var mouseevent = e.type === 'mousedown';
DomEvent.on(document, mouseevent ? 'mousemove' : 'touchmove', this._onMove, this);
DomEvent.on(document, mouseevent ? 'mouseup' : 'touchend touchcancel', this._onUp, this);
},
_onMove: function (e) {
// Ignore simulated events, since we handle both touch and
// mouse explicitly; otherwise we risk getting duplicates of
// touch events, see #4315.
// Also ignore the event if disabled; this happens in IE11
// Ignore the event if disabled; this happens in IE11
// under some circumstances, see #3666.
if (e._simulated || !this._enabled) { return; }
if (!this._enabled) { return; }

@@ -164,3 +147,2 @@ if (e.touches && e.touches.length > 1) {

this._moved = true;
this._startPos = DomUtil.getPosition(this._element).subtract(offset);

@@ -181,5 +163,4 @@ DomUtil.addClass(document.body, 'leaflet-dragging');

Util.cancelAnimFrame(this._animRequest);
this._lastEvent = e;
this._animRequest = Util.requestAnimFrame(this._updatePosition, this, true);
this._updatePosition();
},

@@ -201,9 +182,6 @@

_onUp: function (e) {
// Ignore simulated events, since we handle both touch and
// mouse explicitly; otherwise we risk getting duplicates of
// touch events, see #4315.
// Also ignore the event if disabled; this happens in IE11
_onUp: function () {
// Ignore the event if disabled; this happens in IE11
// under some circumstances, see #3666.
if (e._simulated || !this._enabled) { return; }
if (!this._enabled) { return; }
this.finishDrag();

@@ -220,6 +198,4 @@ },

for (var i in MOVE) {
DomEvent.off(document, MOVE[i], this._onMove, this);
DomEvent.off(document, END[i], this._onUp, this);
}
DomEvent.off(document, 'mousemove touchmove', this._onMove, this);
DomEvent.off(document, 'mouseup touchend touchcancel', this._onUp, this);

@@ -230,4 +206,2 @@ DomUtil.enableImageDrag();

if (this._moved && this._moving) {
// ensure drag is not fired after dragend
Util.cancelAnimFrame(this._animRequest);

@@ -234,0 +208,0 @@ // @event dragend: DragEndEvent

@@ -28,3 +28,3 @@ import * as Util from '../core/Util';

// duration in seconds (`0.25` by default) and easing linearity factor (3rd
// argument of the [cubic bezier curve](http://cubic-bezier.com/#0,0,.5,1),
// argument of the [cubic bezier curve](https://cubic-bezier.com/#0,0,.5,1),
// `0.5` by default).

@@ -31,0 +31,0 @@ run: function (el, newPos, duration, easeLinearity) {

@@ -19,3 +19,3 @@ import {CRS} from './CRS';

// the International Union of Geodesy and Geophysics,
// see http://rosettacode.org/wiki/Haversine_formula
// see https://rosettacode.org/wiki/Haversine_formula
R: 6371000,

@@ -22,0 +22,0 @@

@@ -13,3 +13,3 @@

* coordinates in other units for [WMS](https://en.wikipedia.org/wiki/Web_Map_Service) services). See
* [spatial reference system](http://en.wikipedia.org/wiki/Coordinate_reference_system).
* [spatial reference system](https://en.wikipedia.org/wiki/Spatial_reference_system).
*

@@ -16,0 +16,0 @@ * Leaflet defines the most usual CRSs by default. If you want to use a

@@ -5,3 +5,3 @@ /*

* An object with methods for projecting geographical coordinates of the world onto
* a flat surface (and back). See [Map projection](http://en.wikipedia.org/wiki/Map_projection).
* a flat surface (and back). See [Map projection](https://en.wikipedia.org/wiki/Map_projection).

@@ -8,0 +8,0 @@ * @property bounds: Bounds

@@ -17,7 +17,7 @@ import {Point} from './Point';

// its shape and returns a new array of simplified points, using the
// [Douglas-Peucker algorithm](http://en.wikipedia.org/wiki/Douglas-Peucker_algorithm).
// [Ramer-Douglas-Peucker algorithm](https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm).
// Used for a huge performance boost when processing/displaying Leaflet polylines for
// each zoom level and also reducing visual noise. tolerance affects the amount of
// simplification (lesser value means higher quality but slower and with more points).
// Also released as a separated micro-library [Simplify.js](http://mourner.github.com/simplify-js/).
// Also released as a separated micro-library [Simplify.js](https://mourner.github.io/simplify-js/).
export function simplify(points, tolerance) {

@@ -51,3 +51,3 @@ if (!tolerance || !points.length) {

// Douglas-Peucker simplification, see http://en.wikipedia.org/wiki/Douglas-Peucker_algorithm
// Ramer-Douglas-Peucker simplification, see https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm
function _simplifyDP(points, sqTolerance) {

@@ -54,0 +54,0 @@

@@ -0,1 +1,2 @@

import {Map} from '../map/Map';
import {Layer} from './Layer';

@@ -10,5 +11,5 @@ import {FeatureGroup} from './FeatureGroup';

* @class DivOverlay
* @inherits Layer
* @inherits Interactive layer
* @aka L.DivOverlay
* Base model for L.Popup and L.Tooltip. Inherit from it for custom popup like plugins.
* Base model for L.Popup and L.Tooltip. Inherit from it for custom overlays like plugins.
*/

@@ -22,14 +23,17 @@

options: {
// @option offset: Point = Point(0, 7)
// The offset of the popup position. Useful to control the anchor
// of the popup when opening it on some overlays.
offset: [0, 7],
// @option interactive: Boolean = false
// If true, the popup/tooltip will listen to the mouse events.
interactive: false,
// @option offset: Point = Point(0, 0)
// The offset of the overlay position.
offset: [0, 0],
// @option className: String = ''
// A custom CSS class name to assign to the popup.
// A custom CSS class name to assign to the overlay.
className: '',
// @option pane: String = 'popupPane'
// `Map pane` where the popup will be added.
pane: 'popupPane'
// @option pane: String = undefined
// `Map pane` where the overlay will be added.
pane: undefined
},

@@ -43,2 +47,45 @@

// @method openOn(map: Map): this
// Adds the overlay to the map.
// Alternative to `map.openPopup(popup)`/`.openTooltip(tooltip)`.
openOn: function (map) {
map = arguments.length ? map : this._source._map; // experimental, not the part of public api
if (!map.hasLayer(this)) {
map.addLayer(this);
}
return this;
},
// @method close(): this
// Closes the overlay.
// Alternative to `map.closePopup(popup)`/`.closeTooltip(tooltip)`
// and `layer.closePopup()`/`.closeTooltip()`.
close: function () {
if (this._map) {
this._map.removeLayer(this);
}
return this;
},
// @method toggle(layer?: Layer): this
// Opens or closes the overlay bound to layer depending on its current state.
// Argument may be omitted only for overlay bound to layer.
// Alternative to `layer.togglePopup()`/`.toggleTooltip()`.
toggle: function (layer) {
if (this._map) {
this.close();
} else {
if (arguments.length) {
this._source = layer;
} else {
layer = this._source;
}
this._prepareOpen();
// open the overlay on the map
this.openOn(layer._map);
}
return this;
},
onAdd: function (map) {

@@ -64,2 +111,7 @@ this._zoomAnimated = map._zoomAnimated;

this.bringToFront();
if (this.options.interactive) {
DomUtil.addClass(this._container, 'leaflet-interactive');
this.addInteractiveTarget(this._container);
}
},

@@ -74,7 +126,12 @@

}
if (this.options.interactive) {
DomUtil.removeClass(this._container, 'leaflet-interactive');
this.removeInteractiveTarget(this._container);
}
},
// @namespace Popup
// @namespace DivOverlay
// @method getLatLng: LatLng
// Returns the geographical point of popup.
// Returns the geographical point of the overlay.
getLatLng: function () {

@@ -85,3 +142,3 @@ return this._latlng;

// @method setLatLng(latlng: LatLng): this
// Sets the geographical point where the popup will open.
// Sets the geographical point where the overlay will open.
setLatLng: function (latlng) {

@@ -97,3 +154,3 @@ this._latlng = toLatLng(latlng);

// @method getContent: String|HTMLElement
// Returns the content of the popup.
// Returns the content of the overlay.
getContent: function () {

@@ -104,3 +161,4 @@ return this._content;

// @method setContent(htmlContent: String|HTMLElement|Function): this
// Sets the HTML content of the popup. If a function is passed the source layer will be passed to the function. The function should return a `String` or `HTMLElement` to be used in the popup.
// Sets the HTML content of the overlay. If a function is passed the source layer will be passed to the function.
// The function should return a `String` or `HTMLElement` to be used in the overlay.
setContent: function (content) {

@@ -113,3 +171,3 @@ this._content = content;

// @method getElement: String|HTMLElement
// Returns the HTML container of the popup.
// Returns the HTML container of the overlay.
getElement: function () {

@@ -120,3 +178,3 @@ return this._container;

// @method update: null
// Updates the popup content, layout and position. Useful for updating the popup after something inside changed, e.g. image loaded.
// Updates the overlay content, layout and position. Useful for updating the overlay after something inside changed, e.g. image loaded.
update: function () {

@@ -149,3 +207,3 @@ if (!this._map) { return; }

// @method isOpen: Boolean
// Returns `true` when the popup is visible on the map.
// Returns `true` when the overlay is visible on the map.
isOpen: function () {

@@ -156,3 +214,3 @@ return !!this._map && this._map.hasLayer(this);

// @method bringToFront: this
// Brings this popup in front of other popups (in the same map pane).
// Brings this overlay in front of other overlays (in the same map pane).
bringToFront: function () {

@@ -166,3 +224,3 @@ if (this._map) {

// @method bringToBack: this
// Brings this popup to the back of other popups (in the same map pane).
// Brings this overlay to the back of other overlays (in the same map pane).
bringToBack: function () {

@@ -175,20 +233,29 @@ if (this._map) {

_prepareOpen: function (parent, layer, latlng) {
if (!(layer instanceof Layer)) {
latlng = layer;
layer = parent;
}
// prepare bound overlay to open: update latlng pos / content source (for FeatureGroup)
_prepareOpen: function (latlng) {
var source = this._source;
if (!source._map) { return false; }
if (layer instanceof FeatureGroup) {
for (var id in parent._layers) {
layer = parent._layers[id];
break;
if (source instanceof FeatureGroup) {
source = null;
var layers = this._source._layers;
for (var id in layers) {
if (layers[id]._map) {
source = layers[id];
break;
}
}
if (!source) { return false; } // Unable to get source layer.
// set overlay source to this layer
this._source = source;
}
if (!latlng) {
if (layer.getCenter) {
latlng = layer.getCenter();
} else if (layer.getLatLng) {
latlng = layer.getLatLng();
if (source.getCenter) {
latlng = source.getCenter();
} else if (source.getLatLng) {
latlng = source.getLatLng();
} else if (source.getBounds) {
latlng = source.getBounds().getCenter();
} else {

@@ -198,10 +265,10 @@ throw new Error('Unable to get source layer LatLng.');

}
this.setLatLng(latlng);
// set overlay source to this layer
this._source = layer;
if (this._map) {
// update the overlay (content, layout, etc...)
this.update();
}
// update the overlay (content, layout, ect...)
this.update();
return latlng;
return true;
},

@@ -223,2 +290,7 @@

}
// @namespace DivOverlay
// @section DivOverlay events
// @event contentupdate: Event
// Fired when the content of the overlay is updated
this.fire('contentupdate');

@@ -243,3 +315,3 @@ },

// bottom position the popup in case the height of the popup changes (images loading etc)
// bottom position the overlay in case the height of the overlay changes (images loading etc)
this._container.style.bottom = bottom + 'px';

@@ -254,1 +326,29 @@ this._container.style.left = left + 'px';

});
Map.include({
_initOverlay: function (OverlayClass, content, latlng, options) {
var overlay = content;
if (!(overlay instanceof OverlayClass)) {
overlay = new OverlayClass(options).setContent(content);
}
if (latlng) {
overlay.setLatLng(latlng);
}
return overlay;
}
});
Layer.include({
_initOverlay: function (OverlayClass, old, content, options) {
var overlay = content;
if (overlay instanceof OverlayClass) {
Util.setOptions(overlay, options);
overlay._source = this;
} else {
overlay = (old && !options) ? old : new OverlayClass(options, this);
overlay.setContent(content);
}
return overlay;
}
});

@@ -256,6 +256,6 @@ import {LayerGroup} from './LayerGroup';

// @function latLngToCoords(latlng: LatLng, precision?: Number): Array
// @function latLngToCoords(latlng: LatLng, precision?: Number|false): Array
// Reverse of [`coordsToLatLng`](#geojson-coordstolatlng)
// Coordinates values are rounded with [`formatNum`](#util-formatnum) function.
export function latLngToCoords(latlng, precision) {
precision = typeof precision === 'number' ? precision : 6;
return latlng.alt !== undefined ?

@@ -266,5 +266,6 @@ [Util.formatNum(latlng.lng, precision), Util.formatNum(latlng.lat, precision), Util.formatNum(latlng.alt, precision)] :

// @function latLngsToCoords(latlngs: Array, levelsDeep?: Number, closed?: Boolean): Array
// @function latLngsToCoords(latlngs: Array, levelsDeep?: Number, closed?: Boolean, precision?: Number|false): Array
// Reverse of [`coordsToLatLngs`](#geojson-coordstolatlngs)
// `closed` determines whether the first point should be appended to the end of the array to close the feature, only used when `levelsDeep` is 0. False by default.
// Coordinates values are rounded with [`formatNum`](#util-formatnum) function.
export function latLngsToCoords(latlngs, levelsDeep, closed, precision) {

@@ -317,13 +318,11 @@ var coords = [];

// @section Other methods
// @method toGeoJSON(precision?: Number): Object
// `precision` is the number of decimal places for coordinates.
// The default value is 6 places.
// Returns a [`GeoJSON`](http://en.wikipedia.org/wiki/GeoJSON) representation of the marker (as a GeoJSON `Point` Feature).
// @method toGeoJSON(precision?: Number|false): Object
// Coordinates values are rounded with [`formatNum`](#util-formatnum) function with given `precision`.
// Returns a [`GeoJSON`](https://en.wikipedia.org/wiki/GeoJSON) representation of the marker (as a GeoJSON `Point` Feature).
Marker.include(PointToGeoJSON);
// @namespace CircleMarker
// @method toGeoJSON(precision?: Number): Object
// `precision` is the number of decimal places for coordinates.
// The default value is 6 places.
// Returns a [`GeoJSON`](http://en.wikipedia.org/wiki/GeoJSON) representation of the circle marker (as a GeoJSON `Point` Feature).
// @method toGeoJSON(precision?: Number|false): Object
// Coordinates values are rounded with [`formatNum`](#util-formatnum) function with given `precision`.
// Returns a [`GeoJSON`](https://en.wikipedia.org/wiki/GeoJSON) representation of the circle marker (as a GeoJSON `Point` Feature).
Circle.include(PointToGeoJSON);

@@ -334,6 +333,5 @@ CircleMarker.include(PointToGeoJSON);

// @namespace Polyline
// @method toGeoJSON(precision?: Number): Object
// `precision` is the number of decimal places for coordinates.
// The default value is 6 places.
// Returns a [`GeoJSON`](http://en.wikipedia.org/wiki/GeoJSON) representation of the polyline (as a GeoJSON `LineString` or `MultiLineString` Feature).
// @method toGeoJSON(precision?: Number|false): Object
// Coordinates values are rounded with [`formatNum`](#util-formatnum) function with given `precision`.
// Returns a [`GeoJSON`](https://en.wikipedia.org/wiki/GeoJSON) representation of the polyline (as a GeoJSON `LineString` or `MultiLineString` Feature).
Polyline.include({

@@ -353,6 +351,5 @@ toGeoJSON: function (precision) {

// @namespace Polygon
// @method toGeoJSON(precision?: Number): Object
// `precision` is the number of decimal places for coordinates.
// The default value is 6 places.
// Returns a [`GeoJSON`](http://en.wikipedia.org/wiki/GeoJSON) representation of the polygon (as a GeoJSON `Polygon` or `MultiPolygon` Feature).
// @method toGeoJSON(precision?: Number|false): Object
// Coordinates values are rounded with [`formatNum`](#util-formatnum) function with given `precision`.
// Returns a [`GeoJSON`](https://en.wikipedia.org/wiki/GeoJSON) representation of the polygon (as a GeoJSON `Polygon` or `MultiPolygon` Feature).
Polygon.include({

@@ -392,6 +389,5 @@ toGeoJSON: function (precision) {

// @method toGeoJSON(precision?: Number): Object
// `precision` is the number of decimal places for coordinates.
// The default value is 6 places.
// Returns a [`GeoJSON`](http://en.wikipedia.org/wiki/GeoJSON) representation of the layer group (as a GeoJSON `FeatureCollection`, `GeometryCollection`, or `MultiPoint`).
// @method toGeoJSON(precision?: Number|false): Object
// Coordinates values are rounded with [`formatNum`](#util-formatnum) function with given `precision`.
// Returns a [`GeoJSON`](https://en.wikipedia.org/wiki/GeoJSON) representation of the layer group (as a GeoJSON `FeatureCollection`, `GeometryCollection`, or `MultiPoint`).
toGeoJSON: function (precision) {

@@ -398,0 +394,0 @@

@@ -17,3 +17,3 @@ import {Layer} from './Layer';

* ```js
* var imageUrl = 'http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg',
* var imageUrl = 'https://maps.lib.utexas.edu/maps/historical/newark_nj_1922.jpg',
* imageBounds = [[40.712216, -74.22655], [40.773941, -74.12544]];

@@ -257,2 +257,8 @@ * L.imageOverlay(imageUrl, imageBounds).addTo(map);

}
},
// @method getCenter(): LatLng
// Returns the center of the ImageOverlay.
getCenter: function () {
return this._bounds.getCenter();
}

@@ -259,0 +265,0 @@ });

@@ -116,6 +116,2 @@ import {Evented} from '../core/Events';

if (this.getAttribution && map.attributionControl) {
map.attributionControl.addAttribution(this.getAttribution());
}
this.fire('add');

@@ -193,6 +189,2 @@ map.fire('layeradd', {layer: this});

if (layer.getAttribution && this.attributionControl) {
this.attributionControl.removeAttribution(layer.getAttribution());
}
delete this._layers[id];

@@ -213,3 +205,3 @@

hasLayer: function (layer) {
return !!layer && (Util.stamp(layer) in this._layers);
return Util.stamp(layer) in this._layers;
},

@@ -241,3 +233,3 @@

_addZoomLimit: function (layer) {
if (isNaN(layer.options.maxZoom) || !isNaN(layer.options.minZoom)) {
if (!isNaN(layer.options.maxZoom) || !isNaN(layer.options.minZoom)) {
this._zoomBoundLayers[Util.stamp(layer)] = layer;

@@ -244,0 +236,0 @@ this._updateZoomLevels();

@@ -8,3 +8,3 @@

* @aka L.LayerGroup
* @inherits Layer
* @inherits Interactive layer
*

@@ -77,3 +77,2 @@ * Used to group several layers and handle them as one. If you add it to the map,

hasLayer: function (layer) {
if (!layer) { return false; }
var layerId = typeof layer === 'number' ? layer : this.getLayerId(layer);

@@ -80,0 +79,0 @@ return layerId in this._layers;

@@ -34,3 +34,3 @@ import {Icon} from './Icon';

_getIconUrl: function (name) {
if (!IconDefault.imagePath) { // Deprecated, backwards-compatibility only
if (typeof IconDefault.imagePath !== 'string') { // Deprecated, backwards-compatibility only
IconDefault.imagePath = this._detectIconPath();

@@ -46,2 +46,11 @@ }

_stripUrl: function (path) { // separate function to use in tests
var strip = function (str, re, idx) {
var match = re.exec(str);
return match && match[idx];
};
path = strip(path, /^url\((['"])?(.+)\1\)$/, 2);
return path && strip(path, /^(.*)marker-icon\.png$/, 1);
},
_detectIconPath: function () {

@@ -53,11 +62,8 @@ var el = DomUtil.create('div', 'leaflet-default-icon-path', document.body);

document.body.removeChild(el);
if (path === null || path.indexOf('url') !== 0) {
path = '';
} else {
path = path.replace(/^url\(["']?/, '').replace(/marker-icon\.png["']?\)$/, '');
}
return path;
path = this._stripUrl(path);
if (path) { return path; }
var link = document.querySelector('link[href$="leaflet.css"]');
if (!link) { return ''; }
return link.href.substring(0, link.href.length - 'leaflet.css'.length - 1);
}
});
import {Class} from '../../core/Class';
import {setOptions} from '../../core/Util';
import {toPoint as point} from '../../geometry/Point';
import {retina} from '../../core/Browser';
import Browser from '../../core/Browser';

@@ -78,3 +78,9 @@ /*

popupAnchor: [0, 0],
tooltipAnchor: [0, 0]
tooltipAnchor: [0, 0],
// @option crossOrigin: Boolean|String = false
// Whether the crossOrigin attribute will be added to the tiles.
// If a String is provided, all tiles will have their crossOrigin attribute set to the String provided. This is needed if you want to access tile pixel data.
// Refer to [CORS Settings](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for valid String values.
crossOrigin: false
},

@@ -112,2 +118,6 @@

if (this.options.crossOrigin || this.options.crossOrigin === '') {
img.crossOrigin = this.options.crossOrigin === true ? '' : this.options.crossOrigin;
}
return img;

@@ -148,3 +158,3 @@ },

_getIconUrl: function (name) {
return retina && this.options[name + 'RetinaUrl'] || this.options[name + 'Url'];
return Browser.retina && this.options[name + 'RetinaUrl'] || this.options[name + 'Url'];
}

@@ -151,0 +161,0 @@ });

@@ -43,5 +43,5 @@ import {Layer} from '../Layer';

// @option alt: String = ''
// @option alt: String = 'Marker'
// Text for the `alt` attribute of the icon image (useful for accessibility).
alt: '',
alt: 'Marker',

@@ -229,2 +229,3 @@ // @option zIndexOffset: Number = 0

icon.tabIndex = '0';
icon.setAttribute('role', 'button');
}

@@ -231,0 +232,0 @@

@@ -7,3 +7,2 @@ import {DivOverlay} from './DivOverlay';

import {Layer} from './Layer';
import * as Util from '../core/Util';
import {Path} from './vector/Path';

@@ -44,2 +43,10 @@

options: {
// @option pane: String = 'popupPane'
// `Map pane` where the popup will be added.
pane: 'popupPane',
// @option offset: Point = Point(0, 7)
// The offset of the popup position.
offset: [0, 7],
// @option maxWidth: Number = 300

@@ -107,6 +114,13 @@ // Max width of the popup, in pixels.

// @method openOn(map: Map): this
// Adds the popup to the map and closes the previous one. The same as `map.openPopup(popup)`.
// Alternative to `map.openPopup(popup)`.
// Adds the popup to the map and closes the previous one.
openOn: function (map) {
map.openPopup(this);
return this;
map = arguments.length ? map : this._source._map; // experimental, not the part of public api
if (!map.hasLayer(this) && map._popup && map._popup.options.autoClose) {
map.removeLayer(map._popup);
}
map._popup = this;
return DivOverlay.prototype.openOn.call(this, map);
},

@@ -162,3 +176,3 @@

if (this.options.closeOnClick !== undefined ? this.options.closeOnClick : this._map.options.closePopupOnClick) {
events.preclick = this._close;
events.preclick = this.close;
}

@@ -173,8 +187,2 @@

_close: function () {
if (this._map) {
this._map.closePopup(this);
}
},
_initLayout: function () {

@@ -198,6 +206,8 @@ var prefix = 'leaflet-popup',

var closeButton = this._closeButton = DomUtil.create('a', prefix + '-close-button', container);
closeButton.setAttribute('role', 'button'); // overrides the implicit role=link of <a> elements #7399
closeButton.setAttribute('aria-label', 'Close popup');
closeButton.href = '#close';
closeButton.innerHTML = '&#215;';
closeButton.innerHTML = '<span aria-hidden="true">&#215;</span>';
DomEvent.on(closeButton, 'click', this._onCloseButtonClick, this);
DomEvent.on(closeButton, 'click', this.close, this);
}

@@ -242,3 +252,3 @@ },

_adjustPan: function () {
_adjustPan: function (e) {
if (!this.options.autoPan) { return; }

@@ -283,11 +293,6 @@ if (this._map._panAnim) { this._map._panAnim.stop(); }

.fire('autopanstart')
.panBy([dx, dy]);
.panBy([dx, dy], {animate: e && e.type === 'moveend'});
}
},
_onCloseButtonClick: function (e) {
this._close();
DomEvent.stop(e);
},
_getAnchor: function () {

@@ -327,20 +332,6 @@ // Where should we anchor the popup on the source layer?

openPopup: function (popup, latlng, options) {
if (!(popup instanceof Popup)) {
popup = new Popup(options).setContent(popup);
}
this._initOverlay(Popup, popup, latlng, options)
.openOn(this);
if (latlng) {
popup.setLatLng(latlng);
}
if (this.hasLayer(popup)) {
return this;
}
if (this._popup && this._popup.options.autoClose) {
this.closePopup();
}
this._popup = popup;
return this.addLayer(popup);
return this;
},

@@ -351,8 +342,5 @@

closePopup: function (popup) {
if (!popup || popup === this._popup) {
popup = this._popup;
this._popup = null;
}
popup = arguments.length ? popup : this._popup;
if (popup) {
this.removeLayer(popup);
popup.close();
}

@@ -386,14 +374,3 @@ return this;

bindPopup: function (content, options) {
if (content instanceof Popup) {
Util.setOptions(content, options);
this._popup = content;
content._source = this;
} else {
if (!this._popup || options) {
this._popup = new Popup(options, this);
}
this._popup.setContent(content);
}
this._popup = this._initOverlay(Popup, this._popup, content, options);
if (!this._popupHandlersAdded) {

@@ -430,10 +407,7 @@ this.on({

// Opens the bound popup at the specified `latlng` or at the default popup anchor if no `latlng` is passed.
openPopup: function (layer, latlng) {
if (this._popup && this._map) {
latlng = this._popup._prepareOpen(this, layer, latlng);
openPopup: function (latlng) {
if (this._popup && this._popup._prepareOpen(latlng)) {
// open the popup on the map
this._map.openPopup(this._popup, latlng);
this._popup.openOn(this._map);
}
return this;

@@ -446,3 +420,3 @@ },

if (this._popup) {
this._popup._close();
this._popup.close();
}

@@ -454,9 +428,5 @@ return this;

// Opens or closes the popup bound to this layer depending on its current state.
togglePopup: function (target) {
togglePopup: function () {
if (this._popup) {
if (this._popup._map) {
this.closePopup();
} else {
this.openPopup(target);
}
this._popup.toggle(this);
}

@@ -488,29 +458,21 @@ return this;

_openPopup: function (e) {
var layer = e.layer || e.target;
if (!this._popup) {
if (!this._popup || !this._map) {
return;
}
if (!this._map) {
return;
}
// prevent map click
DomEvent.stop(e);
// if this inherits from Path its a vector and we can just
// open the popup at the new location
if (layer instanceof Path) {
this.openPopup(e.layer || e.target, e.latlng);
var target = e.layer || e.target;
if (this._popup._source === target && !(target instanceof Path)) {
// treat it like a marker and figure out
// if we should toggle it open/closed
if (this._map.hasLayer(this._popup)) {
this.closePopup();
} else {
this.openPopup(e.latlng);
}
return;
}
// otherwise treat it like a marker and figure out
// if we should toggle it open/closed
if (this._map.hasLayer(this._popup) && this._popup._source === layer) {
this.closePopup();
} else {
this.openPopup(layer, e.latlng);
}
this._popup._source = target;
this.openPopup(e.latlng);
},

@@ -517,0 +479,0 @@

import {Layer} from '../Layer';
import * as Browser from '../../core/Browser';
import Browser from '../../core/Browser';
import * as Util from '../../core/Util';

@@ -162,4 +162,3 @@ import * as DomUtil from '../../dom/DomUtil';

this._resetView();
this._update();
this._resetView(); // implicit _update() call
},

@@ -233,2 +232,7 @@

this._removeAllTiles();
var tileZoom = this._clampZoom(this._map.getZoom());
if (tileZoom !== this._tileZoom) {
this._tileZoom = tileZoom;
this._updateLevels();
}
this._update();

@@ -802,8 +806,2 @@ }

}
// without this hack, tiles disappear after zoom on Chrome for Android
// https://github.com/Leaflet/Leaflet/issues/2078
if (Browser.android && !Browser.android23) {
tile.style.WebkitBackfaceVisibility = 'hidden';
}
},

@@ -810,0 +808,0 @@

import {GridLayer} from './GridLayer';
import * as Browser from '../../core/Browser';
import Browser from '../../core/Browser';
import * as Util from '../../core/Util';

@@ -17,3 +17,3 @@ import * as DomEvent from '../../dom/DomEvent';

* ```js
* L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png?{foo}', {foo: 'bar', attribution: 'Map data &copy; <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);
* L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png?{foo}', {foo: 'bar', attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(map);
* ```

@@ -27,3 +27,3 @@ *

* ```
* 'http://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png'
* 'https://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png'
* ```

@@ -36,3 +36,3 @@ *

* ```
* L.tileLayer('http://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png', {foo: 'bar'});
* L.tileLayer('https://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png', {foo: 'bar'});
* ```

@@ -83,3 +83,11 @@ */

// Refer to [CORS Settings](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for valid String values.
crossOrigin: false
crossOrigin: false,
// @option referrerPolicy: Boolean|String = false
// Whether the referrerPolicy attribute will be added to the tiles.
// If a String is provided, all tiles will have their referrerPolicy attribute set to the String provided.
// This may be needed if your map's rendering context has a strict default but your tile provider expects a valid referrer
// (e.g. to validate an API token).
// Refer to [HTMLImageElement.referrerPolicy](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/referrerPolicy) for valid String values.
referrerPolicy: false
},

@@ -113,6 +121,3 @@

// for https://github.com/Leaflet/Leaflet/issues/137
if (!Browser.android) {
this.on('tileunload', this._onTileRemove);
}
this.on('tileunload', this._onTileRemove);
},

@@ -151,5 +156,11 @@

// for this new option we follow the documented behavior
// more closely by only setting the property when string
if (typeof this.options.referrerPolicy === 'string') {
tile.referrerPolicy = this.options.referrerPolicy;
}
/*
Alt tag is set to empty string to keep screen readers from reading URL and for compliance reasons
http://www.w3.org/TR/WCAG20-TECHS/H67
https://www.w3.org/TR/WCAG20-TECHS/H67
*/

@@ -245,4 +256,11 @@ tile.alt = '';

tile.src = Util.emptyImageUrl;
var coords = this._tiles[i].coords;
DomUtil.remove(tile);
delete this._tiles[i];
// @event tileabort: TileEvent
// Fired when a tile was loading but is now not wanted.
this.fire('tileabort', {
tile: tile,
coords: coords
});
}

@@ -258,7 +276,3 @@ }

// 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 (!Browser.androidStock) {
tile.el.setAttribute('src', Util.emptyImageUrl);
}
tile.el.setAttribute('src', Util.emptyImageUrl);

@@ -265,0 +279,0 @@ return GridLayer.prototype._removeTile.call(this, key);

import {TileLayer} from './TileLayer';
import {extend, setOptions, getParamString} from '../../core/Util';
import {retina} from '../../core/Browser';
import Browser from '../../core/Browser';
import {EPSG4326} from '../../geo/crs/CRS.EPSG4326';

@@ -31,3 +31,3 @@ import {toBounds} from '../../geometry/Bounds';

// WMS server as extra parameters in each request URL. This can be useful for
// [non-standard vendor WMS parameters](http://docs.geoserver.org/stable/en/user/services/wms/vendor.html).
// [non-standard vendor WMS parameters](https://docs.geoserver.org/stable/en/user/services/wms/vendor.html).
defaultWmsParams: {

@@ -84,3 +84,3 @@ service: 'WMS',

var realRetina = options.detectRetina && retina ? 2 : 1;
var realRetina = options.detectRetina && Browser.retina ? 2 : 1;
var tileSize = this.getTileSize();

@@ -87,0 +87,0 @@ wmsParams.width = tileSize.x * realRetina;

@@ -1,3 +0,1 @@

import * as Browser from '../core/Browser';
import {DivOverlay} from './DivOverlay';

@@ -7,3 +5,2 @@ import {toPoint} from '../geometry/Point';

import {Layer} from './Layer';
import * as Util from '../core/Util';
import * as DomUtil from '../dom/DomUtil';

@@ -61,6 +58,2 @@

// @option interactive: Boolean = false
// If true, the tooltip will listen to the feature events.
interactive: false,
// @option opacity: Number = 0.9

@@ -82,2 +75,4 @@ // Tooltip container opacity.

if (this._source) {
this.addEventParent(this._source);
// @namespace Layer

@@ -101,2 +96,4 @@ // @section Tooltip events

if (this._source) {
this.removeEventParent(this._source);
// @namespace Layer

@@ -113,4 +110,4 @@ // @section Tooltip events

if (Browser.touch && !this.options.permanent) {
events.preclick = this._close;
if (!this.options.permanent) {
events.preclick = this.close;
}

@@ -121,8 +118,2 @@

_close: function () {
if (this._map) {
this._map.closeTooltip(this);
}
},
_initLayout: function () {

@@ -228,23 +219,12 @@ var prefix = 'leaflet-tooltip',

openTooltip: function (tooltip, latlng, options) {
if (!(tooltip instanceof Tooltip)) {
tooltip = new Tooltip(options).setContent(tooltip);
}
this._initOverlay(Tooltip, tooltip, latlng, options)
.openOn(this);
if (latlng) {
tooltip.setLatLng(latlng);
}
if (this.hasLayer(tooltip)) {
return this;
}
return this.addLayer(tooltip);
return this;
},
// @method closeTooltip(tooltip?: Tooltip): this
// @method closeTooltip(tooltip: Tooltip): this
// Closes the tooltip given as parameter.
closeTooltip: function (tooltip) {
if (tooltip) {
this.removeLayer(tooltip);
}
tooltip.close();
return this;

@@ -277,14 +257,7 @@ }

if (content instanceof Tooltip) {
Util.setOptions(content, options);
this._tooltip = content;
content._source = this;
} else {
if (!this._tooltip || options) {
this._tooltip = new Tooltip(options, this);
}
this._tooltip.setContent(content);
if (this._tooltip && this.isTooltipOpen()) {
this.unbindTooltip();
}
this._tooltip = this._initOverlay(Tooltip, this._tooltip, content, options);
this._initTooltipInteractions();

@@ -320,11 +293,9 @@

events.mouseout = this.closeTooltip;
if (this._tooltip.options.sticky) {
events.mousemove = this._moveTooltip;
}
if (Browser.touch) {
events.click = this._openTooltip;
}
events.click = this._openTooltip;
} else {
events.add = this._openTooltip;
}
if (this._tooltip.options.sticky) {
events.mousemove = this._moveTooltip;
}
this[onOff](events);

@@ -336,17 +307,7 @@ this._tooltipHandlersAdded = !remove;

// Opens the bound tooltip at the specified `latlng` or at the default tooltip anchor if no `latlng` is passed.
openTooltip: function (layer, latlng) {
if (this._tooltip && this._map) {
latlng = this._tooltip._prepareOpen(this, layer, latlng);
openTooltip: function (latlng) {
if (this._tooltip && this._tooltip._prepareOpen(latlng)) {
// open the tooltip on the map
this._map.openTooltip(this._tooltip, latlng);
// Tooltip container may not be defined if not permanent and never
// opened.
if (this._tooltip.options.interactive && this._tooltip._container) {
DomUtil.addClass(this._tooltip._container, 'leaflet-clickable');
this.addInteractiveTarget(this._tooltip._container);
}
this._tooltip.openOn(this._map);
}
return this;

@@ -359,9 +320,4 @@ },

if (this._tooltip) {
this._tooltip._close();
if (this._tooltip.options.interactive && this._tooltip._container) {
DomUtil.removeClass(this._tooltip._container, 'leaflet-clickable');
this.removeInteractiveTarget(this._tooltip._container);
}
return this._tooltip.close();
}
return this;
},

@@ -371,9 +327,5 @@

// Opens or closes the tooltip bound to this layer depending on its current state.
toggleTooltip: function (target) {
toggleTooltip: function () {
if (this._tooltip) {
if (this._tooltip._map) {
this.closeTooltip();
} else {
this.openTooltip(target);
}
this._tooltip.toggle(this);
}

@@ -405,8 +357,8 @@ return this;

_openTooltip: function (e) {
var layer = e.layer || e.target;
if (!this._tooltip || !this._map) {
if (!this._tooltip || !this._map || (this._map.dragging && this._map.dragging.moving())) {
return;
}
this.openTooltip(layer, this._tooltip.options.sticky ? e.latlng : undefined);
this._tooltip._source = e.layer || e.target;
this.openTooltip(this._tooltip.options.sticky ? e.latlng : undefined);
},

@@ -413,0 +365,0 @@

import {Renderer} from './Renderer';
import * as DomUtil from '../../dom/DomUtil';
import * as DomEvent from '../../dom/DomEvent';
import * as Browser from '../../core/Browser';
import Browser from '../../core/Browser';
import * as Util from '../../core/Util';

@@ -16,3 +16,3 @@ import {Bounds} from '../../geometry/Bounds';

*
* Due to [technical limitations](http://caniuse.com/#search=canvas), Canvas is not
* Due to [technical limitations](https://caniuse.com/canvas), Canvas is not
* available in all web browsers, notably IE8, and overlapping geometries might

@@ -42,2 +42,11 @@ * not display properly in some edge cases.

export var Canvas = Renderer.extend({
// @section
// @aka Canvas options
options: {
// @option tolerance: Number = 0
// How much to extend the click tolerance around a path/object on the map.
tolerance: 0
},
getEvents: function () {

@@ -68,2 +77,3 @@ var events = Renderer.prototype.getEvents.call(this);

DomEvent.on(container, 'mouseout', this._handleMouseOut, this);
container['_leaflet_disable_events'] = true;

@@ -355,3 +365,3 @@ this._ctx = container.getContext('2d');

if (layer.options.interactive && layer._containsPoint(point)) {
if (!(e.type === 'click' || e.type !== 'preclick') || !this._map._draggableMoved(layer)) {
if (!(e.type === 'click' || e.type === 'preclick') || !this._map._draggableMoved(layer)) {
clickedLayer = layer;

@@ -361,6 +371,3 @@ }

}
if (clickedLayer) {
DomEvent.fakeStop(e);
this._fireEvent([clickedLayer], e);
}
this._fireEvent(clickedLayer ? [clickedLayer] : false, e);
},

@@ -411,5 +418,3 @@

if (this._hoveredLayer) {
this._fireEvent([this._hoveredLayer], e);
}
this._fireEvent(this._hoveredLayer ? [this._hoveredLayer] : false, e);

@@ -416,0 +421,0 @@ this._mouseHoverThrottled = true;

@@ -145,4 +145,5 @@ import {Layer} from '../Layer';

// used when doing hit detection for Canvas layers
return (this.options.stroke ? this.options.weight / 2 : 0) + this._renderer.options.tolerance;
return (this.options.stroke ? this.options.weight / 2 : 0) +
(this._renderer.options.tolerance || 0);
}
});

@@ -117,3 +117,3 @@ import {Path} from './Path';

// @method getCenter(): LatLng
// Returns the center ([centroid](http://en.wikipedia.org/wiki/Centroid)) of the polyline.
// Returns the center ([centroid](https://en.wikipedia.org/wiki/Centroid)) of the polyline.
getCenter: function () {

@@ -216,2 +216,7 @@ // throws error when not yet added to map as this center calculation requires projected coordinates

p = new Point(w, w);
if (!this._rawPxBounds) {
return;
}
this._pxBounds = new Bounds([

@@ -218,0 +223,0 @@ this._rawPxBounds.min.subtract(p),

import {Layer} from '../Layer';
import * as DomUtil from '../../dom/DomUtil';
import * as Util from '../../core/Util';
import * as Browser from '../../core/Browser';
import Browser from '../../core/Browser';
import {Bounds} from '../../geometry/Bounds';

@@ -37,7 +37,3 @@

// e.g. 0.1 would be 10% of map view in each direction
padding: 0.1,
// @option tolerance: Number = 0
// How much to extend click tolerance round a path/object on the map
tolerance : 0
padding: 0.1
},

@@ -44,0 +40,0 @@

import {Renderer} from './Renderer';
import * as DomUtil from '../../dom/DomUtil';
import * as DomEvent from '../../dom/DomEvent';
import * as Browser from '../../core/Browser';
import Browser from '../../core/Browser';
import {stamp} from '../../core/Util';

@@ -20,3 +20,3 @@ import {svgCreate, pointsToPath} from './SVG.Util';

*
* Due to [technical limitations](http://caniuse.com/#search=svg), SVG is not
* Due to [technical limitations](https://caniuse.com/svg), SVG is not
* available in all web browsers, notably Android 2.x and 3.x.

@@ -23,0 +23,0 @@ *

@@ -1,2 +0,2 @@

import * as Browser from '../../core/Browser';
import Browser from '../../core/Browser';

@@ -3,0 +3,0 @@ // @namespace SVG; @section

@@ -17,6 +17,8 @@ import * as DomUtil from '../../dom/DomUtil';

} catch (e) {
return function (name) {
return document.createElement('<' + name + ' xmlns="urn:schemas-microsoft.com:vml" class="lvml">');
};
// Do not return fn from catch block so `e` can be garbage collected
// See https://github.com/Leaflet/Leaflet/pull/7279
}
return function (name) {
return document.createElement('<' + name + ' xmlns="urn:schemas-microsoft.com:vml" class="lvml">');
};
})();

@@ -23,0 +25,0 @@

@@ -31,2 +31,3 @@ import {ImageOverlay} from './ImageOverlay';

// Whether the video starts playing automatically when loaded.
// On some browsers autoplay will only work with `muted: true`
autoplay: true,

@@ -40,3 +41,3 @@

// Whether the video will save aspect ratio after the projection.
// Relevant for supported browsers. Browser compatibility- https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit
// Relevant for supported browsers. See [browser compatibility](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit)
keepAspectRatio: true,

@@ -46,3 +47,7 @@

// Whether the video starts on mute when loaded.
muted: false
muted: false,
// @option playsInline: Boolean = true
// Mobile browsers will play the video right where it is instead of open it up in fullscreen mode.
playsInline: true
},

@@ -84,2 +89,3 @@

vid.muted = !!this.options.muted;
vid.playsInline = !!this.options.playsInline;
for (var i = 0; i < this._url.length; i++) {

@@ -86,0 +92,0 @@ var source = DomUtil.create('source');

@@ -143,2 +143,4 @@ import {Map} from '../Map';

this._finish();
this._clearDeferredResetState();
this._resetState();
}

@@ -145,0 +147,0 @@ }

import {Map} from '../Map';
import * as Browser from '../../core/Browser';
import {Handler} from '../../core/Handler';

@@ -26,4 +25,4 @@ import {Draggable} from '../../dom/Draggable';

// the same direction for some time. Feels especially nice on touch
// devices. Enabled by default unless running on old Android devices.
inertia: !Browser.android23,
// devices. Enabled by default.
inertia: true,

@@ -30,0 +29,0 @@ // @option inertiaDeceleration: Number = 3000

@@ -6,3 +6,3 @@ import {Map} from '../Map';

import * as DomUtil from '../../dom/DomUtil';
import * as Browser from '../../core/Browser';
import Browser from '../../core/Browser';

@@ -21,4 +21,4 @@ /*

// where the touch events (fingers) were. Enabled for touch-capable web
// browsers except for old Androids.
touchZoom: Browser.touch && !Browser.android23,
// browsers.
touchZoom: Browser.touch,

@@ -64,3 +64,3 @@ // @option bounceAtZoomLimits: Boolean = true

DomEvent.on(document, 'touchmove', this._onTouchMove, this);
DomEvent.on(document, 'touchend', this._onTouchEnd, this);
DomEvent.on(document, 'touchend touchcancel', this._onTouchEnd, this);

@@ -119,3 +119,3 @@ DomEvent.preventDefault(e);

DomEvent.off(document, 'touchmove', this._onTouchMove, this);
DomEvent.off(document, 'touchend', this._onTouchEnd, this);
DomEvent.off(document, 'touchend touchcancel', this._onTouchEnd, this);

@@ -122,0 +122,0 @@ // Pinch updates GridLayers' levels only when zoomSnap is off, so zoomSnap becomes noUpdate.

@@ -12,4 +12,4 @@ import {Map} from './Map';

Map.ScrollWheelZoom = ScrollWheelZoom;
import {Tap} from './handler/Map.Tap';
Map.Tap = Tap;
import {TapHold} from './handler/Map.TapHold';
Map.TapHold = TapHold;
import {TouchZoom} from './handler/Map.TouchZoom';

@@ -16,0 +16,0 @@ Map.TouchZoom = TouchZoom;

@@ -8,3 +8,3 @@ import * as Util from '../core/Util';

import {LatLngBounds, toLatLngBounds} from '../geo/LatLngBounds';
import * as Browser from '../core/Browser';
import Browser from '../core/Browser';
import * as DomEvent from '../dom/DomEvent';

@@ -515,6 +515,5 @@ import * as DomUtil from '../dom/DomUtil';

// @method panInside(latlng: LatLng, options?: options): this
// @method panInside(latlng: LatLng, options?: padding 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).
// padding options to fit the display to more restricted bounds.
// If `latlng` is already within the (optionally padded) display bounds,

@@ -527,31 +526,15 @@ // the map will not be panned.

paddingBR = toPoint(options.paddingBottomRight || options.padding || [0, 0]),
center = this.getCenter(),
pixelCenter = this.project(center),
pixelCenter = this.project(this.getCenter()),
pixelPoint = this.project(latlng),
pixelBounds = this.getPixelBounds(),
halfPixelBounds = pixelBounds.getSize().divideBy(2),
paddedBounds = toBounds([pixelBounds.min.add(paddingTL), pixelBounds.max.subtract(paddingBR)]);
paddedBounds = toBounds([pixelBounds.min.add(paddingTL), pixelBounds.max.subtract(paddingBR)]),
paddedSize = paddedBounds.getSize();
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);
var centerOffset = pixelPoint.subtract(paddedBounds.getCenter());
var offset = paddedBounds.extend(pixelPoint).getSize().subtract(paddedSize);
pixelCenter.x += centerOffset.x < 0 ? -offset.x : offset.x;
pixelCenter.y += centerOffset.y < 0 ? -offset.y : offset.y;
this.panTo(this.unproject(pixelCenter), options);
this._enforcingBounds = false;

@@ -687,2 +670,4 @@ }

_handleGeolocationError: function (error) {
if (!this._container._leaflet_id) { return; }
var c = error.code,

@@ -707,2 +692,4 @@ message = error.message ||

_handleGeolocationResponse: function (pos) {
if (!this._container._leaflet_id) { return; }
var lat = pos.coords.latitude,

@@ -760,3 +747,3 @@ lng = pos.coords.longitude,

this._initEvents(true);
this.off('moveend', this._panInsideMaxBounds);
if (this.options.maxBounds) { this.off('moveend', this._panInsideMaxBounds); }

@@ -1166,7 +1153,7 @@ if (this._containerId !== this._container._leaflet_id) {

// @pane overlayPane: HTMLElement = 400
// Pane for vectors (`Path`s, like `Polyline`s and `Polygon`s), `ImageOverlay`s and `VideoOverlay`s
this.createPane('overlayPane');
// @pane shadowPane: HTMLElement = 500
// Pane for overlay shadows (e.g. `Marker` shadows)
this.createPane('shadowPane');
// @pane shadowPane: HTMLElement = 500
// Pane for vectors (`Path`s, like `Polyline`s and `Polygon`s), `ImageOverlay`s and `VideoOverlay`s
this.createPane('overlayPane');
// @pane markerPane: HTMLElement = 600

@@ -1234,3 +1221,3 @@ // Pane for `Icon`s of `Marker`s

_move: function (center, zoom, data) {
_move: function (center, zoom, data, supressEvent) {
if (zoom === undefined) {

@@ -1245,13 +1232,18 @@ zoom = this._zoom;

// @event zoom: Event
// Fired repeatedly during any change in zoom level, including zoom
// and fly animations.
if (zoomChanged || (data && data.pinch)) { // Always fire 'zoom' if pinching because #3530
if (!supressEvent) {
// @event zoom: Event
// Fired repeatedly during any change in zoom level,
// including zoom and fly animations.
if (zoomChanged || (data && data.pinch)) { // Always fire 'zoom' if pinching because #3530
this.fire('zoom', data);
}
// @event move: Event
// Fired repeatedly during any movement of the map,
// including pan and fly animations.
this.fire('move', data);
} else if (data && data.pinch) { // Always fire 'zoom' if pinching because #3530
this.fire('zoom', data);
}
// @event move: Event
// Fired repeatedly during any movement of the map, including pan and
// fly animations.
return this.fire('move', data);
return this;
},

@@ -1261,3 +1253,3 @@

// @event zoomend: Event
// Fired when the map has changed, after any animations.
// Fired when the map zoom changed, after any animations.
if (zoomChanged) {

@@ -1268,4 +1260,4 @@ this.fire('zoomend');

// @event moveend: Event
// Fired when the center of the map stops changing (e.g. user stopped
// dragging the map).
// Fired when the center of the map stops changing
// (e.g. user stopped dragging the map or after non-centered zoom).
return this.fire('moveend');

@@ -1365,3 +1357,3 @@ },

// https://bugzilla.mozilla.org/show_bug.cgi?id=1203873 but Webkit also have
// a pixel offset on very high values, see: http://jsfiddle.net/dg6r5hhb/
// a pixel offset on very high values, see: https://jsfiddle.net/dg6r5hhb/
this._resetView(this.getCenter(), this.getZoom());

@@ -1380,3 +1372,3 @@ }

target = this._targets[Util.stamp(src)];
if (target && (type === 'click' || type === 'preclick') && !e._simulated && this._draggableMoved(target)) {
if (target && (type === 'click' || type === 'preclick') && this._draggableMoved(target)) {
// Prevent firing click after you just dragged an object.

@@ -1394,3 +1386,3 @@ dragging = true;

}
if (!targets.length && !dragging && !isHover && DomEvent.isExternalTarget(src, e)) {
if (!targets.length && !dragging && !isHover && this.listens(type, true)) {
targets = [this];

@@ -1401,10 +1393,20 @@ }

_isClickDisabled: function (el) {
while (el !== this._container) {
if (el['_leaflet_disable_click']) { return true; }
el = el.parentNode;
}
},
_handleDOMEvent: function (e) {
if (!this._loaded || DomEvent.skipped(e)) { return; }
var el = (e.target || e.srcElement);
if (!this._loaded || el['_leaflet_disable_events'] || e.type === 'click' && this._isClickDisabled(el)) {
return;
}
var type = e.type;
if (type === 'mousedown' || type === 'keypress' || type === 'keyup' || type === 'keydown') {
if (type === 'mousedown') {
// prevents outline when clicking on keyboard-focusable element
DomUtil.preventOutline(e.target || e.srcElement);
DomUtil.preventOutline(el);
}

@@ -1417,3 +1419,3 @@

_fireDOMEvent: function (e, type, targets) {
_fireDOMEvent: function (e, type, canvasTargets) {

@@ -1428,17 +1430,25 @@ if (e.type === 'click') {

synth.type = 'preclick';
this._fireDOMEvent(synth, synth.type, targets);
this._fireDOMEvent(synth, synth.type, canvasTargets);
}
if (e._stopped) { return; }
// Find the layer the event is propagating from and its parents.
targets = (targets || []).concat(this._findEventTargets(e, type));
var targets = this._findEventTargets(e, type);
if (canvasTargets) {
var filtered = []; // pick only targets with listeners
for (var i = 0; i < canvasTargets.length; i++) {
if (canvasTargets[i].listens(type, true)) {
filtered.push(canvasTargets[i]);
}
}
targets = filtered.concat(targets);
}
if (!targets.length) { return; }
var target = targets[0];
if (type === 'contextmenu' && target.listens(type, true)) {
if (type === 'contextmenu') {
DomEvent.preventDefault(e);
}
var target = targets[0];
var data = {

@@ -1456,3 +1466,3 @@ originalEvent: e

for (var i = 0; i < targets.length; i++) {
for (i = 0; i < targets.length; i++) {
targets[i].fire(type, data, true);

@@ -1713,2 +1723,8 @@ if (data.originalEvent._stopped ||

if (!this._tempFireZoomEvent) {
this._tempFireZoomEvent = this._zoom !== this._animateToZoom;
}
this._move(this._animateToCenter, this._animateToZoom, undefined, true);
// Work around webkit not firing 'transitionend', see https://github.com/Leaflet/Leaflet/issues/3689, 2693

@@ -1727,4 +1743,11 @@ setTimeout(Util.bind(this._onZoomTransitionEnd, this), 250);

this._move(this._animateToCenter, this._animateToZoom);
this._move(this._animateToCenter, this._animateToZoom, undefined, true);
if (this._tempFireZoomEvent) {
this.fire('zoom');
}
delete this._tempFireZoomEvent;
this.fire('move');
// This anim frame should prevent an obscure iOS webkit tile loading race condition.

@@ -1731,0 +1754,0 @@ Util.requestAnimFrame(function () {

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 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 not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc