loleaflet: eslint 4.0.0 conformance
Change-Id: I6ca3eacf50bf5d28ebdfdaf13adcbeec619c97e1
This commit is contained in:
parent
48637c4408
commit
c6486d472e
4 changed files with 43 additions and 43 deletions
|
@ -239,11 +239,11 @@ L.ImpressTileLayer = L.CanvasTileLayer.extend({
|
|||
}
|
||||
var scale = this._map.getZoomScale(coords.z);
|
||||
topLeftTwips = new L.Point(
|
||||
this.options.tileWidthTwips / scale * coords.x,
|
||||
this.options.tileHeightTwips / scale * coords.y);
|
||||
this.options.tileWidthTwips / scale * coords.x,
|
||||
this.options.tileHeightTwips / scale * coords.y);
|
||||
bottomRightTwips = topLeftTwips.add(new L.Point(
|
||||
this.options.tileWidthTwips / scale,
|
||||
this.options.tileHeightTwips / scale));
|
||||
this.options.tileWidthTwips / scale,
|
||||
this.options.tileHeightTwips / scale));
|
||||
bounds = new L.Bounds(topLeftTwips, bottomRightTwips);
|
||||
if (invalidBounds.intersects(bounds)) {
|
||||
delete this._tileCache[key];
|
||||
|
|
|
@ -323,7 +323,7 @@ L.TileLayer = L.GridLayer.extend({
|
|||
this._map.showWelcomeDialog();
|
||||
}
|
||||
},
|
||||
this);
|
||||
this);
|
||||
|
||||
map.on('updatepermission', function(e) {
|
||||
if (e.perm !== 'edit') {
|
||||
|
@ -1180,10 +1180,10 @@ L.TileLayer = L.GridLayer.extend({
|
|||
var offset = new L.Point(parseInt(strTwips[2]), parseInt(strTwips[3]));
|
||||
var bottomRightTwips = topLeftTwips.add(offset);
|
||||
this._cellCursorTwips = this._convertToTileTwipsSheetArea(
|
||||
new L.Bounds(topLeftTwips, bottomRightTwips));
|
||||
new L.Bounds(topLeftTwips, bottomRightTwips));
|
||||
this._cellCursor = new L.LatLngBounds(
|
||||
this._twipsToLatLng(this._cellCursorTwips.getTopLeft(), this._map.getZoom()),
|
||||
this._twipsToLatLng(this._cellCursorTwips.getBottomRight(), this._map.getZoom()));
|
||||
this._twipsToLatLng(this._cellCursorTwips.getTopLeft(), this._map.getZoom()),
|
||||
this._twipsToLatLng(this._cellCursorTwips.getBottomRight(), this._map.getZoom()));
|
||||
this._cellCursorXY = new L.Point(parseInt(strTwips[4]), parseInt(strTwips[5]));
|
||||
}
|
||||
|
||||
|
@ -1261,9 +1261,9 @@ L.TileLayer = L.GridLayer.extend({
|
|||
// # for internal links
|
||||
if (!url.startsWith('#')) {
|
||||
this._map.hyperlinkPopup = new L.Popup({className: 'hyperlink-popup', closeButton: false, closeOnClick: false, autoPan: false})
|
||||
.setContent('<a id="hyperlink-pop-up">' + url + '</a>')
|
||||
.setLatLng(position)
|
||||
.openOn(this._map);
|
||||
.setContent('<a id="hyperlink-pop-up">' + url + '</a>')
|
||||
.setLatLng(position)
|
||||
.openOn(this._map);
|
||||
var offsetDiffTop = $('.hyperlink-popup').offset().top - $('#map').offset().top;
|
||||
var offsetDiffLeft = $('.hyperlink-popup').offset().left - $('#map').offset().left;
|
||||
if (offsetDiffTop < 10) this._movePopUpBelow();
|
||||
|
@ -1333,8 +1333,8 @@ L.TileLayer = L.GridLayer.extend({
|
|||
var modifierViewId = parseInt(obj.viewId);
|
||||
this._cursorAtMispelledWord = obj.mispelledWord ? Boolean(parseInt(obj.mispelledWord)).valueOf() : false;
|
||||
this._visibleCursor = new L.LatLngBounds(
|
||||
this._twipsToLatLng(rectangle.getTopLeft(), this._map.getZoom()),
|
||||
this._twipsToLatLng(rectangle.getBottomRight(), this._map.getZoom()));
|
||||
this._twipsToLatLng(rectangle.getTopLeft(), this._map.getZoom()),
|
||||
this._twipsToLatLng(rectangle.getBottomRight(), this._map.getZoom()));
|
||||
var cursorPos = this._visibleCursor.getNorthWest();
|
||||
var docLayer = this._map._docLayer;
|
||||
if ((docLayer._followEditor || docLayer._followUser) && this._map.lastActionByUser) {
|
||||
|
@ -1902,8 +1902,8 @@ L.TileLayer = L.GridLayer.extend({
|
|||
var bottomRightTwips = rectangles[0].getBottomRight();
|
||||
var oldSelection = this._textSelectionEnd;
|
||||
this._textSelectionEnd = new L.LatLngBounds(
|
||||
this._twipsToLatLng(topLeftTwips, this._map.getZoom()),
|
||||
this._twipsToLatLng(bottomRightTwips, this._map.getZoom()));
|
||||
this._twipsToLatLng(topLeftTwips, this._map.getZoom()),
|
||||
this._twipsToLatLng(bottomRightTwips, this._map.getZoom()));
|
||||
|
||||
this._updateScrollOnCellSelection(oldSelection, this._textSelectionEnd);
|
||||
this._updateMarkers();
|
||||
|
@ -1924,8 +1924,8 @@ L.TileLayer = L.GridLayer.extend({
|
|||
//FIXME: on top of each other, but on separate lines. We should
|
||||
//FIXME: capture the whole area in _onTextSelectionMsg.
|
||||
this._textSelectionStart = new L.LatLngBounds(
|
||||
this._twipsToLatLng(topLeftTwips, this._map.getZoom()),
|
||||
this._twipsToLatLng(bottomRightTwips, this._map.getZoom()));
|
||||
this._twipsToLatLng(topLeftTwips, this._map.getZoom()),
|
||||
this._twipsToLatLng(bottomRightTwips, this._map.getZoom()));
|
||||
|
||||
this._updateScrollOnCellSelection(oldSelection, this._textSelectionStart);
|
||||
}
|
||||
|
@ -1941,11 +1941,11 @@ L.TileLayer = L.GridLayer.extend({
|
|||
var offset = new L.Point(parseInt(strTwips[2]), parseInt(strTwips[3]));
|
||||
var bottomRightTwips = topLeftTwips.add(offset);
|
||||
var boundsTwips = this._convertToTileTwipsSheetArea(
|
||||
new L.Bounds(topLeftTwips, bottomRightTwips));
|
||||
new L.Bounds(topLeftTwips, bottomRightTwips));
|
||||
var oldSelection = this._cellSelectionArea;
|
||||
this._cellSelectionArea = new L.LatLngBounds(
|
||||
this._twipsToLatLng(boundsTwips.getTopLeft(), this._map.getZoom()),
|
||||
this._twipsToLatLng(boundsTwips.getBottomRight(), this._map.getZoom()));
|
||||
this._twipsToLatLng(boundsTwips.getTopLeft(), this._map.getZoom()),
|
||||
this._twipsToLatLng(boundsTwips.getBottomRight(), this._map.getZoom()));
|
||||
|
||||
if (this._cellCursor === null) {
|
||||
this._cellCursor = L.LatLngBounds.createDefault();
|
||||
|
@ -1963,8 +1963,8 @@ L.TileLayer = L.GridLayer.extend({
|
|||
var offset = new L.Point(parseInt(strTwips[2]), parseInt(strTwips[3]));
|
||||
var bottomRightTwips = topLeftTwips.add(offset);
|
||||
this._cellAutoFillArea = new L.LatLngBounds(
|
||||
this._twipsToLatLng(topLeftTwips, this._map.getZoom()),
|
||||
this._twipsToLatLng(bottomRightTwips, this._map.getZoom()));
|
||||
this._twipsToLatLng(topLeftTwips, this._map.getZoom()),
|
||||
this._twipsToLatLng(bottomRightTwips, this._map.getZoom()));
|
||||
} else {
|
||||
this._cellAutoFillArea = null;
|
||||
}
|
||||
|
@ -2008,7 +2008,7 @@ L.TileLayer = L.GridLayer.extend({
|
|||
if (!tile._debugPopup) {
|
||||
var tileBound = this._keyToBounds(key);
|
||||
tile._debugPopup = L.popup({className: 'debug', offset: new L.Point(0, 0), autoPan: false, closeButton: false, closeOnClick: false})
|
||||
.setLatLng(new L.LatLng(tileBound.getSouth(), tileBound.getWest() + (tileBound.getEast() - tileBound.getWest())/5));
|
||||
.setLatLng(new L.LatLng(tileBound.getSouth(), tileBound.getWest() + (tileBound.getEast() - tileBound.getWest())/5));
|
||||
this._debugInfo.addLayer(tile._debugPopup);
|
||||
if (this._debugTiles[key]) {
|
||||
this._debugInfo.removeLayer(this._debugTiles[key]);
|
||||
|
@ -2061,16 +2061,16 @@ L.TileLayer = L.GridLayer.extend({
|
|||
console.log('Applying a delta of length ' + delta.length + ' pix size: ' + pixSize + '\nhex: ' + hex2string(delta));
|
||||
|
||||
// Green-tinge the old-Data ...
|
||||
// for (var i = 0; i < pixSize; ++i)
|
||||
// {
|
||||
// oldData[i*4 + 1] = 128;
|
||||
// }
|
||||
// for (var i = 0; i < pixSize; ++i)
|
||||
// {
|
||||
// oldData[i*4 + 1] = 128;
|
||||
// }
|
||||
|
||||
// wipe to grey.
|
||||
// for (var i = 0; i < pixSize * 4; ++i)
|
||||
// {
|
||||
// imgData.data[i] = 128;
|
||||
// }
|
||||
// for (var i = 0; i < pixSize * 4; ++i)
|
||||
// {
|
||||
// imgData.data[i] = 128;
|
||||
// }
|
||||
|
||||
// Apply delta.
|
||||
for (var i = 1; i < delta.length;)
|
||||
|
@ -3448,8 +3448,8 @@ L.TileLayer = L.GridLayer.extend({
|
|||
else {
|
||||
// we have a custom preview
|
||||
var bounds = new L.Bounds(
|
||||
new L.Point(preview.tilePosX, preview.tilePosY),
|
||||
new L.Point(preview.tilePosX + preview.tileWidth, preview.tilePosY + preview.tileHeight));
|
||||
new L.Point(preview.tilePosX, preview.tilePosY),
|
||||
new L.Point(preview.tilePosX + preview.tileWidth, preview.tilePosY + preview.tileHeight));
|
||||
if (preview.invalid || (preview.part === this._selectedPart ||
|
||||
(preview.part === this._prevSelectedPart && this._prevSelectedPartNeedsUpdate)) &&
|
||||
invalidBounds.intersects(bounds)) {
|
||||
|
@ -3475,7 +3475,7 @@ L.TileLayer = L.GridLayer.extend({
|
|||
}
|
||||
else {
|
||||
this._map.getCustomPreview(preview.id, preview.part, preview.width, preview.height, preview.tilePosX,
|
||||
preview.tilePosY, preview.tileWidth, preview.tileHeight, {autoUpdate: true});
|
||||
preview.tilePosY, preview.tileWidth, preview.tileHeight, {autoUpdate: true});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3652,7 +3652,7 @@ L.TileLayer = L.GridLayer.extend({
|
|||
var now = +new Date();
|
||||
|
||||
var invalidBoundCoords = new L.LatLngBounds(this._twipsToLatLng(topLeftTwips, this._tileZoom),
|
||||
this._twipsToLatLng(bottomRightTwips, this._tileZoom));
|
||||
this._twipsToLatLng(bottomRightTwips, this._tileZoom));
|
||||
var rect = L.rectangle(invalidBoundCoords, {color: 'red', weight: 1, opacity: 1, fillOpacity: 0.4, pointerEvents: 'none'});
|
||||
this._debugInvalidBounds[this._debugId] = rect;
|
||||
this._debugInvalidBoundsMessage[this._debugId] = command;
|
||||
|
|
|
@ -294,7 +294,7 @@ L.Handler.PathDrag = L.Handler.extend(/** @lends L.Path.Drag.prototype */ {
|
|||
var projection = crs.projection;
|
||||
|
||||
var diff = transformation.untransform(px, scale)
|
||||
.subtract(transformation.untransform(L.point(0, 0), scale));
|
||||
.subtract(transformation.untransform(L.point(0, 0), scale));
|
||||
var applyTransform = !dest;
|
||||
var bounds = path._bounds;
|
||||
|
||||
|
@ -304,7 +304,7 @@ L.Handler.PathDrag = L.Handler.extend(/** @lends L.Path.Drag.prototype */ {
|
|||
// all shifts are in-place
|
||||
if (path._point) { // L.Circle
|
||||
dest = projection.unproject(
|
||||
projection.project(path._latlng)._add(diff));
|
||||
projection.project(path._latlng)._add(diff));
|
||||
if (applyTransform) {
|
||||
path._latlng = dest;
|
||||
path._point._add(px);
|
||||
|
|
|
@ -455,7 +455,7 @@ L.Handler.PathTransform = L.Handler.extend({
|
|||
// all shifts are in-place
|
||||
if (path._point) { // L.Circle
|
||||
path._latlng = this._transformPoint(
|
||||
path._latlng, projectedMatrix, map, zoom);
|
||||
path._latlng, projectedMatrix, map, zoom);
|
||||
} else if (path._rings || path._parts) { // everything else
|
||||
var rings = path._rings;
|
||||
var latlngs = path._latlngs;
|
||||
|
@ -548,14 +548,14 @@ L.Handler.PathTransform = L.Handler.extend({
|
|||
(latlngs[1].lng + latlngs[2].lng) / 2);
|
||||
|
||||
var handlerPosition = map.layerPointToLatLng(
|
||||
L.PathTransform.pointOnLine(
|
||||
map.latLngToLayerPoint(bottom),
|
||||
map.latLngToLayerPoint(topPoint),
|
||||
this.options.handleLength)
|
||||
L.PathTransform.pointOnLine(
|
||||
map.latLngToLayerPoint(bottom),
|
||||
map.latLngToLayerPoint(topPoint),
|
||||
this.options.handleLength)
|
||||
);
|
||||
|
||||
this._handleLine = new L.Polyline([topPoint, handlerPosition],
|
||||
this.options.rotateHandleOptions).addTo(this._handlersGroup);
|
||||
this.options.rotateHandleOptions).addTo(this._handlersGroup);
|
||||
var RotateHandleClass = this.options.rotateHandleClass;
|
||||
this._rotationMarker = new RotateHandleClass(handlerPosition,
|
||||
this.options.handlerOptions)
|
||||
|
|
Loading…
Reference in a new issue