upgrade deps, fix indenting (#5743)
This commit is contained in:
parent
4e8b30a379
commit
88dd22cfe8
@ -28,7 +28,7 @@ const banner = `/* @preserve
|
||||
|
||||
export default {
|
||||
format: 'umd',
|
||||
moduleName: 'L',
|
||||
name: 'L',
|
||||
banner: banner,
|
||||
entry: 'src/Leaflet.js',
|
||||
dest: 'dist/leaflet-src.js',
|
||||
|
@ -22,7 +22,7 @@ const banner = `
|
||||
|
||||
export default {
|
||||
format: 'umd',
|
||||
moduleName: 'L',
|
||||
name: 'L',
|
||||
banner,
|
||||
entry: 'src/Leaflet.js',
|
||||
dest: 'dist/leaflet-src.js',
|
||||
|
@ -3,7 +3,7 @@
|
||||
"version": "1.2.0",
|
||||
"description": "JavaScript library for mobile-friendly interactive maps",
|
||||
"devDependencies": {
|
||||
"eslint": "^3.5.0 <3.6.0",
|
||||
"eslint": "^4.5.0",
|
||||
"eslint-config-mourner": "^2.0.1",
|
||||
"git-rev-sync": "^1.8.0",
|
||||
"happen": "~0.3.1",
|
||||
@ -14,13 +14,13 @@
|
||||
"karma-firefox-launcher": "~1.0.0",
|
||||
"karma-mocha": "^1.2.0",
|
||||
"karma-phantomjs-launcher": "^1.0.2",
|
||||
"karma-rollup-preprocessor": "^4.0.1",
|
||||
"karma-rollup-preprocessor": "^5.0.1",
|
||||
"karma-safari-launcher": "~1.0.0",
|
||||
"leafdoc": "^1.4.1",
|
||||
"mocha": "^3.1.0",
|
||||
"phantomjs-prebuilt": "^2.1.12",
|
||||
"prosthetic-hand": "^1.3.1",
|
||||
"rollup": "^0.45.2",
|
||||
"rollup": "^0.49.2",
|
||||
"rollup-plugin-git-version": "0.2.1",
|
||||
"rollup-plugin-json": "^2.1.0",
|
||||
"rollup-watch": "^4.3.1",
|
||||
@ -76,7 +76,8 @@
|
||||
2,
|
||||
"tab",
|
||||
{
|
||||
"VariableDeclarator": 0
|
||||
"VariableDeclarator": 0,
|
||||
"flatTernaryExpressions": true
|
||||
}
|
||||
],
|
||||
"curly": 2,
|
||||
|
@ -52,7 +52,7 @@ module.exports = function (config) {
|
||||
json()
|
||||
],
|
||||
format: 'umd',
|
||||
moduleName: 'L'
|
||||
name: 'L'
|
||||
},
|
||||
|
||||
// test results reporter to use
|
||||
|
@ -5,7 +5,7 @@ describe('DomEvent', function () {
|
||||
if (document.createEvent) {
|
||||
var e = document.createEvent('MouseEvents');
|
||||
e.initMouseEvent('click', true, true, window,
|
||||
0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
||||
0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
||||
return el.dispatchEvent(e);
|
||||
} else if (el.fireEvent) {
|
||||
return el.fireEvent('onclick');
|
||||
|
@ -68,7 +68,7 @@ describe("Projection.SphericalMercator", function () {
|
||||
|
||||
// from https://github.com/Leaflet/Leaflet/issues/1578
|
||||
expect(p.project(new L.LatLng(51.9371170300465, 80.11230468750001)))
|
||||
.near(new L.Point(8918060.96409, 6788763.38325));
|
||||
.near(new L.Point(8918060.96409, 6788763.38325));
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -341,12 +341,12 @@ describe('GridLayer', function () {
|
||||
};
|
||||
|
||||
grid.on('tileload tileunload tileerror tileloadstart', function (ev) {
|
||||
// console.log(ev.type);
|
||||
// console.log(ev.type);
|
||||
counts[ev.type]++;
|
||||
});
|
||||
// grid.on('tileunload', function (ev) {
|
||||
// console.log(ev.type, ev.coords, counts);
|
||||
// });
|
||||
// grid.on('tileunload', function (ev) {
|
||||
// console.log(ev.type, ev.coords, counts);
|
||||
// });
|
||||
|
||||
map.options.fadeAnimation = false;
|
||||
map.options.zoomAnimation = false;
|
||||
@ -545,7 +545,7 @@ describe('GridLayer', function () {
|
||||
// browsers due to CSS animations!
|
||||
it.skipInPhantom("Loads 32, unloads 16 tiles zooming in 10-11", function (done) {
|
||||
|
||||
// grid.on('tileload tileunload tileloadstart load', logTiles);
|
||||
// grid.on('tileload tileunload tileloadstart load', logTiles);
|
||||
|
||||
grid.on('load', function () {
|
||||
expect(counts.tileloadstart).to.be(16);
|
||||
@ -553,7 +553,7 @@ describe('GridLayer', function () {
|
||||
expect(counts.tileunload).to.be(0);
|
||||
grid.off('load');
|
||||
|
||||
// grid.on('load', logTiles);
|
||||
// grid.on('load', logTiles);
|
||||
grid.on('load', function () {
|
||||
|
||||
// We're one frame into the zoom animation, there are
|
||||
@ -618,7 +618,7 @@ describe('GridLayer', function () {
|
||||
// browsers due to CSS animations!
|
||||
it.skipInPhantom("Loads 32, unloads 16 tiles zooming out 11-10", function (done) {
|
||||
|
||||
// grid.on('tileload tileunload load', logTiles);
|
||||
// grid.on('tileload tileunload load', logTiles);
|
||||
|
||||
grid.on('load', function () {
|
||||
expect(counts.tileloadstart).to.be(16);
|
||||
@ -626,11 +626,11 @@ describe('GridLayer', function () {
|
||||
expect(counts.tileunload).to.be(0);
|
||||
grid.off('load');
|
||||
|
||||
// grid.on('load', logTiles);
|
||||
// grid.on('load', logTiles);
|
||||
grid.on('load', function () {
|
||||
|
||||
grid.off('load');
|
||||
// grid.on('load', logTiles);
|
||||
// grid.on('load', logTiles);
|
||||
|
||||
// We're one frame into the zoom animation, there are
|
||||
// 16 tiles for z11 plus 4 tiles for z10 covering the
|
||||
@ -717,9 +717,9 @@ describe('GridLayer', function () {
|
||||
|
||||
map.flyTo(trd, 12, {animate: true});
|
||||
|
||||
// map.on('_frame', function () {
|
||||
// console.log('frame', counts);
|
||||
// });
|
||||
// map.on('_frame', function () {
|
||||
// console.log('frame', counts);
|
||||
// });
|
||||
|
||||
runFrames(500);
|
||||
});
|
||||
@ -756,12 +756,12 @@ describe('GridLayer', function () {
|
||||
};
|
||||
|
||||
grid.on('tileload tileunload tileerror tileloadstart', function (ev) {
|
||||
// console.log(ev.type);
|
||||
// console.log(ev.type);
|
||||
counts[ev.type]++;
|
||||
});
|
||||
// grid.on('tileunload', function (ev) {
|
||||
// console.log(ev.type, ev.coords, counts);
|
||||
// });
|
||||
// grid.on('tileunload', function (ev) {
|
||||
// console.log(ev.type, ev.coords, counts);
|
||||
// });
|
||||
|
||||
map.options.fadeAnimation = false;
|
||||
map.options.zoomAnimation = false;
|
||||
|
@ -214,12 +214,12 @@ describe('TileLayer', function () {
|
||||
};
|
||||
|
||||
kittenLayer.on('tileload tileunload tileerror tileloadstart', function (ev) {
|
||||
// console.log(ev.type);
|
||||
// console.log(ev.type);
|
||||
counts[ev.type]++;
|
||||
});
|
||||
// grid.on('tileunload', function (ev) {
|
||||
// console.log(ev.type, ev.coords, counts);
|
||||
// });
|
||||
// grid.on('tileunload', function (ev) {
|
||||
// console.log(ev.type, ev.coords, counts);
|
||||
// });
|
||||
|
||||
map.options.fadeAnimation = false;
|
||||
map.options.zoomAnimation = false;
|
||||
@ -274,9 +274,9 @@ describe('TileLayer', function () {
|
||||
|
||||
map.flyTo(trd, 12, {animate: true});
|
||||
|
||||
// map.on('_frame', function () {
|
||||
// console.log('frame', counts);
|
||||
// });
|
||||
// map.on('_frame', function () {
|
||||
// console.log('frame', counts);
|
||||
// });
|
||||
|
||||
runFrames(500);
|
||||
});
|
||||
|
@ -11,9 +11,9 @@ describe('PolylineGeometry', function () {
|
||||
var p1 = map.latLngToLayerPoint(new L.LatLng(55.8, 37.6));
|
||||
var p2 = map.latLngToLayerPoint(new L.LatLng(57.123076977278, 44.861962891635));
|
||||
var latlngs = [[56.485503424111, 35.545556640339], [55.972522915346, 36.116845702918], [55.502459116923, 34.930322265253], [55.31534617509, 38.973291015816]]
|
||||
.map(function (ll) {
|
||||
return new L.LatLng(ll[0], ll[1]);
|
||||
});
|
||||
.map(function (ll) {
|
||||
return new L.LatLng(ll[0], ll[1]);
|
||||
});
|
||||
var polyline = new L.Polyline([], {
|
||||
'noClip': true
|
||||
});
|
||||
|
@ -193,7 +193,7 @@ describe("Map", function () {
|
||||
var container = map.getContainer();
|
||||
container.style.height = height;
|
||||
document.body.appendChild(container);
|
||||
// L.Browser.any3d = true; // L.Browser is frozen since ES6ication
|
||||
// L.Browser.any3d = true; // L.Browser is frozen since ES6ication
|
||||
map.options.zoomSnap = 0.5;
|
||||
expect(map.getBoundsZoom(bounds, false, padding)).to.be.equal(19.5);
|
||||
map.options.zoomSnap = 0.2;
|
||||
@ -787,7 +787,7 @@ describe("Map", function () {
|
||||
});
|
||||
|
||||
it.skipInNonPhantom('zoomIn ignores the zoomDelta option on non-any3d browsers', function (done) {
|
||||
// L.Browser.any3d = false; // L.Browser is frozen since ES6ication
|
||||
L.Browser.any3d = false;
|
||||
map.options.zoomSnap = 0.25;
|
||||
map.options.zoomDelta = 0.25;
|
||||
map.once('zoomend', function () {
|
||||
@ -799,7 +799,7 @@ describe("Map", function () {
|
||||
});
|
||||
|
||||
it.skipInPhantom('zoomIn respects the zoomDelta option on any3d browsers', function (done) {
|
||||
// L.Browser.any3d = true; // L.Browser is frozen since ES6ication
|
||||
L.Browser.any3d = true;
|
||||
map.options.zoomSnap = 0.25;
|
||||
map.options.zoomDelta = 0.25;
|
||||
map.setView(center, 10);
|
||||
@ -812,7 +812,7 @@ describe("Map", function () {
|
||||
});
|
||||
|
||||
it.skipInPhantom('zoomOut respects the zoomDelta option on any3d browsers', function (done) {
|
||||
// L.Browser.any3d = true; // L.Browser is frozen since ES6ication
|
||||
L.Browser.any3d = true;
|
||||
map.options.zoomSnap = 0.25;
|
||||
map.options.zoomDelta = 0.25;
|
||||
map.setView(center, 10);
|
||||
@ -832,7 +832,7 @@ describe("Map", function () {
|
||||
expect(map.getCenter()).to.eql(center);
|
||||
done();
|
||||
});
|
||||
// L.Browser.any3d = true; // L.Browser is frozen since ES6ication
|
||||
L.Browser.any3d = true;
|
||||
map.zoomIn(0.22, {animate: false});
|
||||
});
|
||||
|
||||
@ -844,7 +844,7 @@ describe("Map", function () {
|
||||
expect(map.getCenter()).to.eql(center);
|
||||
done();
|
||||
});
|
||||
// L.Browser.any3d = true; // L.Browser is frozen since ES6ication
|
||||
L.Browser.any3d = true;
|
||||
map.zoomOut(0.22, {animate: false});
|
||||
});
|
||||
});
|
||||
@ -888,7 +888,7 @@ describe("Map", function () {
|
||||
|
||||
it.skipInPhantom('Snaps zoom to zoomSnap on any3d browsers', function (done) {
|
||||
map.options.zoomSnap = 0.25;
|
||||
// L.Browser.any3d = true; // L.Browser is frozen since ES6ication
|
||||
L.Browser.any3d = true;
|
||||
map.once('zoomend', function () {
|
||||
expect(map.getZoom()).to.eql(2.75);
|
||||
expect(map.getCenter().equals(boundsCenter, 0.05)).to.eql(true);
|
||||
@ -899,7 +899,7 @@ describe("Map", function () {
|
||||
|
||||
it.skipInNonPhantom('Ignores zoomSnap on non-any3d browsers', function (done) {
|
||||
map.options.zoomSnap = 0.25;
|
||||
// L.Browser.any3d = false; // L.Browser is frozen since ES6ication
|
||||
L.Browser.any3d = false;
|
||||
map.once('zoomend', function () {
|
||||
expect(map.getZoom()).to.eql(2);
|
||||
expect(map.getCenter().equals(boundsCenter, 0.05)).to.eql(true);
|
||||
|
@ -141,7 +141,7 @@ describe("Map.Keyboard", function () {
|
||||
expect(popup.isOpen()).to.be(true);
|
||||
|
||||
happen.keydown(document, {keyCode: 27}); // 27 = Esc
|
||||
// happen.keypress(document, {keyCode: 27});
|
||||
// happen.keypress(document, {keyCode: 27});
|
||||
happen.keyup(document, {keyCode: 27});
|
||||
|
||||
expect(popup.isOpen()).to.be(false);
|
||||
|
@ -69,8 +69,8 @@ export var Scale = Control.extend({
|
||||
y = map.getSize().y / 2;
|
||||
|
||||
var maxMeters = map.distance(
|
||||
map.containerPointToLatLng([0, y]),
|
||||
map.containerPointToLatLng([this.options.maxWidth, y]));
|
||||
map.containerPointToLatLng([0, y]),
|
||||
map.containerPointToLatLng([this.options.maxWidth, y]));
|
||||
|
||||
this._updateScales(maxMeters);
|
||||
},
|
||||
|
@ -155,7 +155,7 @@ export function getParamString(obj, existingUrl, uppercase) {
|
||||
return ((!existingUrl || existingUrl.indexOf('?') === -1) ? '?' : '&') + params.join('&');
|
||||
}
|
||||
|
||||
var templateRe = /\{ *([\w_\-]+) *\}/g;
|
||||
var templateRe = /\{ *([\w_-]+) *\}/g;
|
||||
|
||||
// @function template(str: String, data: Object): String
|
||||
// Simple templating facility, accepts a template string of the form `'Hello {a}, {b}'`
|
||||
|
@ -5,9 +5,9 @@ import {_pointersCount} from './DomEvent.Pointer';
|
||||
* Extends the event handling code with double tap support for mobile browsers.
|
||||
*/
|
||||
|
||||
var _touchstart = Browser.msPointer ? 'MSPointerDown' : Browser.pointer ? 'pointerdown' : 'touchstart',
|
||||
_touchend = Browser.msPointer ? 'MSPointerUp' : Browser.pointer ? 'pointerup' : 'touchend',
|
||||
_pre = '_leaflet_';
|
||||
var _touchstart = Browser.msPointer ? 'MSPointerDown' : Browser.pointer ? 'pointerdown' : 'touchstart';
|
||||
var _touchend = Browser.msPointer ? 'MSPointerUp' : Browser.pointer ? 'pointerup' : 'touchend';
|
||||
var _pre = '_leaflet_';
|
||||
|
||||
// inspired by Zepto touch code by Thomas Fuchs
|
||||
export function addDoubleTapListener(obj, handler, id) {
|
||||
|
@ -7,14 +7,14 @@ import * as Browser from '../core/Browser';
|
||||
*/
|
||||
|
||||
|
||||
var POINTER_DOWN = Browser.msPointer ? 'MSPointerDown' : 'pointerdown',
|
||||
POINTER_MOVE = Browser.msPointer ? 'MSPointerMove' : 'pointermove',
|
||||
POINTER_UP = Browser.msPointer ? 'MSPointerUp' : 'pointerup',
|
||||
POINTER_CANCEL = Browser.msPointer ? 'MSPointerCancel' : 'pointercancel',
|
||||
TAG_WHITE_LIST = ['INPUT', 'SELECT', 'OPTION'],
|
||||
var POINTER_DOWN = Browser.msPointer ? 'MSPointerDown' : 'pointerdown';
|
||||
var POINTER_MOVE = Browser.msPointer ? 'MSPointerMove' : 'pointermove';
|
||||
var POINTER_UP = Browser.msPointer ? 'MSPointerUp' : 'pointerup';
|
||||
var POINTER_CANCEL = Browser.msPointer ? 'MSPointerCancel' : 'pointercancel';
|
||||
var TAG_WHITE_LIST = ['INPUT', 'SELECT', 'OPTION'];
|
||||
|
||||
_pointers = {},
|
||||
_pointerDocListener = false;
|
||||
var _pointers = {};
|
||||
var _pointerDocListener = false;
|
||||
|
||||
// DomEvent.DoubleTap needs to know about this
|
||||
export var _pointersCount = 0;
|
||||
|
@ -23,8 +23,8 @@ export var SphericalMercator = {
|
||||
sin = Math.sin(lat * d);
|
||||
|
||||
return new Point(
|
||||
this.R * latlng.lng * d,
|
||||
this.R * Math.log((1 + sin) / (1 - sin)) / 2);
|
||||
this.R * latlng.lng * d,
|
||||
this.R * Math.log((1 + sin) / (1 - sin)) / 2);
|
||||
},
|
||||
|
||||
unproject: function (point) {
|
||||
|
@ -231,8 +231,8 @@ export function coordsToLatLngs(coords, levelsDeep, _coordsToLatLng) {
|
||||
|
||||
for (var i = 0, len = coords.length, latlng; i < len; i++) {
|
||||
latlng = levelsDeep ?
|
||||
coordsToLatLngs(coords[i], levelsDeep - 1, _coordsToLatLng) :
|
||||
(_coordsToLatLng || coordsToLatLng)(coords[i]);
|
||||
coordsToLatLngs(coords[i], levelsDeep - 1, _coordsToLatLng) :
|
||||
(_coordsToLatLng || coordsToLatLng)(coords[i]);
|
||||
|
||||
latlngs.push(latlng);
|
||||
}
|
||||
@ -245,8 +245,8 @@ export function coordsToLatLngs(coords, levelsDeep, _coordsToLatLng) {
|
||||
export function latLngToCoords(latlng, precision) {
|
||||
precision = typeof precision === 'number' ? precision : 6;
|
||||
return latlng.alt !== undefined ?
|
||||
[Util.formatNum(latlng.lng, precision), Util.formatNum(latlng.lat, precision), Util.formatNum(latlng.alt, precision)] :
|
||||
[Util.formatNum(latlng.lng, precision), Util.formatNum(latlng.lat, precision)];
|
||||
[Util.formatNum(latlng.lng, precision), Util.formatNum(latlng.lat, precision), Util.formatNum(latlng.alt, precision)] :
|
||||
[Util.formatNum(latlng.lng, precision), Util.formatNum(latlng.lat, precision)];
|
||||
}
|
||||
|
||||
// @function latLngsToCoords(latlngs: Array, levelsDeep?: Number, closed?: Boolean): Array
|
||||
@ -270,8 +270,8 @@ export function latLngsToCoords(latlngs, levelsDeep, closed, precision) {
|
||||
|
||||
export function getFeature(layer, newGeometry) {
|
||||
return layer.feature ?
|
||||
Util.extend({}, layer.feature, {geometry: newGeometry}) :
|
||||
asFeature(newGeometry);
|
||||
Util.extend({}, layer.feature, {geometry: newGeometry}) :
|
||||
asFeature(newGeometry);
|
||||
}
|
||||
|
||||
// @function asFeature(geojson: Object): Object
|
||||
|
@ -180,8 +180,8 @@ export var ImageOverlay = Layer.extend({
|
||||
|
||||
_initImage: function () {
|
||||
var img = this._image = DomUtil.create('img',
|
||||
'leaflet-image-layer ' + (this._zoomAnimated ? 'leaflet-zoom-animated' : '') +
|
||||
(this.options.className || ''));
|
||||
'leaflet-image-layer ' + (this._zoomAnimated ? 'leaflet-zoom-animated' : '') +
|
||||
(this.options.className || ''));
|
||||
|
||||
img.onselectstart = Util.falseFn;
|
||||
img.onmousemove = Util.falseFn;
|
||||
|
@ -52,7 +52,7 @@ export var IconDefault = Icon.extend({
|
||||
if (path === null || path.indexOf('url') !== 0) {
|
||||
path = '';
|
||||
} else {
|
||||
path = path.replace(/^url\([\"\']?/, '').replace(/marker-icon\.png[\"\']?\)$/, '');
|
||||
path = path.replace(/^url\(["']?/, '').replace(/marker-icon\.png["']?\)$/, '');
|
||||
}
|
||||
|
||||
return path;
|
||||
|
@ -69,11 +69,12 @@ export var MarkerDrag = Handler.extend({
|
||||
padding = this._marker.options.autoPanPadding,
|
||||
iconPos = L.DomUtil.getPosition(marker._icon),
|
||||
bounds = map.getPixelBounds(),
|
||||
origin = map.getPixelOrigin(),
|
||||
panBounds = toBounds(
|
||||
bounds.min._subtract(origin).add(padding),
|
||||
bounds.max._subtract(origin).subtract(padding)
|
||||
);
|
||||
origin = map.getPixelOrigin();
|
||||
|
||||
var panBounds = toBounds(
|
||||
bounds.min._subtract(origin).add(padding),
|
||||
bounds.max._subtract(origin).subtract(padding)
|
||||
);
|
||||
|
||||
if (!panBounds.contains(iconPos)) {
|
||||
// Compute incremental movement
|
||||
|
@ -126,7 +126,7 @@ export var vmlMixin = {
|
||||
r2 = Math.round(layer._radiusY || r);
|
||||
|
||||
this._setPath(layer, layer._empty() ? 'M0 0' :
|
||||
'AL ' + p.x + ',' + p.y + ' ' + r + ',' + r2 + ' 0,' + (65535 * 360));
|
||||
'AL ' + p.x + ',' + p.y + ' ' + r + ',' + r2 + ' 0,' + (65535 * 360));
|
||||
},
|
||||
|
||||
_setPath: function (layer, path) {
|
||||
|
@ -186,9 +186,9 @@ export var SVG = Renderer.extend({
|
||||
|
||||
// drawing a circle with two half-arcs
|
||||
var d = layer._empty() ? 'M0 0' :
|
||||
'M' + (p.x - r) + ',' + p.y +
|
||||
arc + (r * 2) + ',0 ' +
|
||||
arc + (-r * 2) + ',0 ';
|
||||
'M' + (p.x - r) + ',' + p.y +
|
||||
arc + (r * 2) + ',0 ' +
|
||||
arc + (-r * 2) + ',0 ';
|
||||
|
||||
this._setPath(layer, d);
|
||||
},
|
||||
|
@ -1355,7 +1355,7 @@ export var Map = Evented.extend({
|
||||
if (e.type !== 'keypress') {
|
||||
var isMarker = (target.options && 'icon' in target.options);
|
||||
data.containerPoint = isMarker ?
|
||||
this.latLngToContainerPoint(target.getLatLng()) : this.mouseEventToContainerPoint(e);
|
||||
this.latLngToContainerPoint(target.getLatLng()) : this.mouseEventToContainerPoint(e);
|
||||
data.layerPoint = this.containerPointToLayerPoint(data.containerPoint);
|
||||
data.latlng = isMarker ? target.getLatLng() : this.layerPointToLatLng(data.layerPoint);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user