nakarte

Source code of https://map.sikmir.ru (fork)
git clone git://git.sikmir.ru/nakarte
Log | Files | Refs | LICENSE

commit a45328748e478abc289bd1fd40a2cae81a1e7b00
parent b74b18644ed60475639c7e1ab00b765dd4bf1a91
Author: Sergej Orlov <wladimirych@gmail.com>
Date:   Tue,  3 Dec 2019 18:34:22 +0100

lint: enable check and fix semicolons

Diffstat:
M.eslintrc | 3++-
Msrc/App.js | 10+++++-----
Msrc/index.js | 4++--
Msrc/layers.js | 8++++----
Msrc/lib/cache/index.js | 6+++---
Msrc/lib/clipboardCopy/index.js | 4++--
Msrc/lib/file-read/index.js | 2+-
Msrc/lib/googleMapsApi/index.js | 2+-
Msrc/lib/iconFromBackgroundImage/index.js | 2+-
Msrc/lib/leaflet.control.azimuth/index.js | 8++++----
Msrc/lib/leaflet.control.commons/index.js | 2+-
Msrc/lib/leaflet.control.coordinates/formats.js | 4++--
Msrc/lib/leaflet.control.coordinates/index.js | 4++--
Msrc/lib/leaflet.control.elevation-profile/index.js | 18+++++++++---------
Msrc/lib/leaflet.control.jnx/binary-stream.js | 6+++---
Msrc/lib/leaflet.control.jnx/index.js | 4++--
Msrc/lib/leaflet.control.jnx/jnx-maker.js | 4++--
Msrc/lib/leaflet.control.layers.configure/index.js | 10+++++-----
Msrc/lib/leaflet.control.layers.minimize/index.js | 2+-
Msrc/lib/leaflet.control.layers.top-row/index.js | 2+-
Msrc/lib/leaflet.control.locate/index.js | 12++++++------
Msrc/lib/leaflet.control.panoramas/index.js | 10+++++-----
Msrc/lib/leaflet.control.panoramas/lib/google/index.js | 4++--
Msrc/lib/leaflet.control.panoramas/lib/mapillary/index.js | 4++--
Msrc/lib/leaflet.control.panoramas/lib/mapillary/mapillary-coverage-layer.js | 8++++----
Msrc/lib/leaflet.control.panoramas/lib/mapillary/mapillary-loader.js | 10+++++-----
Msrc/lib/leaflet.control.panoramas/lib/mapillary/mvt.js | 6+++---
Msrc/lib/leaflet.control.panoramas/lib/wikimedia/coverage-layer.js | 10+++++-----
Msrc/lib/leaflet.control.panoramas/lib/wikimedia/index.js | 6+++---
Msrc/lib/leaflet.control.printPages/control.js | 16++++++++--------
Msrc/lib/leaflet.control.printPages/decoration.grid.js | 8++++----
Msrc/lib/leaflet.control.printPages/decoration.magnetic-meridians.js | 2+-
Msrc/lib/leaflet.control.printPages/decoration.scale.js | 6+++---
Msrc/lib/leaflet.control.printPages/decorations.js | 2+-
Msrc/lib/leaflet.control.printPages/map-render.js | 2+-
Msrc/lib/leaflet.control.printPages/pageFeature.js | 2+-
Msrc/lib/leaflet.control.track-list/lib/geo_file_exporters.js | 2+-
Msrc/lib/leaflet.control.track-list/lib/parsers/index.js | 2+-
Msrc/lib/leaflet.control.track-list/lib/parsers/kml.js | 6+++---
Msrc/lib/leaflet.control.track-list/lib/parsers/nktk.js | 2+-
Msrc/lib/leaflet.control.track-list/lib/parsers/ozi.js | 2+-
Msrc/lib/leaflet.control.track-list/lib/parsers/urlSafeBase64.js | 2+-
Msrc/lib/leaflet.control.track-list/lib/parsers/xmlUtils.js | 4++--
Msrc/lib/leaflet.control.track-list/lib/parsers/zip.js | 2+-
Msrc/lib/leaflet.control.track-list/lib/services/endomondo.js | 4++--
Msrc/lib/leaflet.control.track-list/lib/services/etomesto.js | 2+-
Msrc/lib/leaflet.control.track-list/lib/services/gpsies.js | 4++--
Msrc/lib/leaflet.control.track-list/lib/services/gpslib.js | 2+-
Msrc/lib/leaflet.control.track-list/lib/services/index.js | 6+++---
Msrc/lib/leaflet.control.track-list/lib/services/movescount.js | 4++--
Msrc/lib/leaflet.control.track-list/lib/services/nakarte/index.js | 6+++---
Msrc/lib/leaflet.control.track-list/lib/services/nakarte/loadTracksFromJson.js | 8++++----
Msrc/lib/leaflet.control.track-list/lib/services/osm.js | 2+-
Msrc/lib/leaflet.control.track-list/lib/services/sportstracker.js | 2+-
Msrc/lib/leaflet.control.track-list/lib/services/tracedetrail.js | 2+-
Msrc/lib/leaflet.control.track-list/track-list.hash-state.js | 2+-
Msrc/lib/leaflet.control.track-list/track-list.js | 4++--
Msrc/lib/leaflet.control.track-list/track-list.localstorage.js | 4++--
Msrc/lib/leaflet.fixes/fixWorldCopyJump.js | 10+++++-----
Msrc/lib/leaflet.fixes/index.js | 10+++++-----
Msrc/lib/leaflet.hashState/Leaflet.Map.js | 2+-
Msrc/lib/leaflet.hashState/leaflet.hashState.js | 2+-
Msrc/lib/leaflet.layer.canvasMarkers/index.js | 4++--
Msrc/lib/leaflet.layer.geocaching-su/index.js | 10+++++-----
Msrc/lib/leaflet.layer.geojson-ajax/index.js | 2+-
Msrc/lib/leaflet.layer.google/index.js | 2+-
Msrc/lib/leaflet.layer.rasterize/Bing.js | 2+-
Msrc/lib/leaflet.layer.rasterize/CanvasMarkers.js | 6+++---
Msrc/lib/leaflet.layer.rasterize/MeasuredLine.js | 6+++---
Msrc/lib/leaflet.layer.rasterize/TileLayer.js | 4++--
Msrc/lib/leaflet.layer.rasterize/WestraPasses.js | 4++--
Msrc/lib/leaflet.layer.rasterize/imgFromDataString.js | 4++--
Msrc/lib/leaflet.layer.rasterize/index.js | 18+++++++++---------
Msrc/lib/leaflet.layer.soviet-topomaps-grid/index.js | 10+++++-----
Msrc/lib/leaflet.layer.westraPasses/westraPassesMarkers.js | 10+++++-----
Msrc/lib/leaflet.layer.wikimapia/index.js | 2+-
Msrc/lib/leaflet.layer.wikimapia/wikimapia-loader.js | 12++++++------
Msrc/lib/leaflet.layer.wikimapia/wm-utils.js | 8++++----
Msrc/lib/leaflet.layer.yandex/index.js | 4++--
Msrc/lib/leaflet.polyline-edit/index.js | 4++--
Msrc/lib/logging/index.js | 12++++++------
Msrc/lib/magnetic-declination/index.js | 4++--
Msrc/lib/safe-localstorage/index.js | 2+-
Msrc/lib/tiled-data-loader/index.js | 8++++----
Msrc/lib/xhr-promise/index.js | 2+-
Asrc/vendored/.eslintrc | 6++++++
86 files changed, 232 insertions(+), 225 deletions(-)

diff --git a/.eslintrc b/.eslintrc @@ -12,7 +12,8 @@ "rules": { "no-unused-vars": ["error", {"argsIgnorePattern": "_unused(_.+)?"}], "no-constant-condition": ["error", {"checkLoops": false}], - "no-prototype-builtins": 0 + "no-prototype-builtins": "off", + "semi": "error", }, "globals": { "NODE_ENV": true, diff --git a/src/App.js b/src/App.js @@ -2,14 +2,14 @@ import './App.css'; import './leaflet-fixes.css'; import L from 'leaflet'; import 'leaflet/dist/leaflet.css'; -import '~/lib/leaflet.control.printPages/control' -import '~/lib/leaflet.control.caption' -import config from './config' +import '~/lib/leaflet.control.printPages/control'; +import '~/lib/leaflet.control.caption'; +import config from './config'; import '~/lib/leaflet.control.coordinates'; import enableLayersControlHotKeys from '~/lib/leaflet.control.layers.hotkeys'; import '~/lib/leaflet.hashState/Leaflet.Map'; import '~/lib/leaflet.hashState/Leaflet.Control.Layers'; -import {fixAll} from '~/lib/leaflet.fixes' +import {fixAll} from '~/lib/leaflet.fixes'; import './adaptive.css'; import '~/lib/leaflet.control.panoramas'; import '~/lib/leaflet.control.track-list/track-list'; @@ -166,7 +166,7 @@ function setUp() { } if (L.Browser.mobile) { - map.on('mousedown dragstart', () => layersControl.setMinimized()) + map.on('mousedown dragstart', () => layersControl.setMinimized()); } raiseControlsOnFocus(map); diff --git a/src/index.js b/src/index.js @@ -1,6 +1,6 @@ import Raven from 'raven-js'; import './index.css'; -import App from './App' +import App from './App'; import config from './config'; function getUid() { @@ -45,7 +45,7 @@ console.log('Version:', RELEASE_VER); let uid; try { - uid = getUid()} catch (e) { + uid = getUid();} catch (e) { // ignore error } console.log('UID:', uid); diff --git a/src/layers.js b/src/layers.js @@ -1114,7 +1114,7 @@ export default function getLayers() { // set metadata for (let layer of layers) { - layer.layer.meta = {title: layer.title} + layer.layer.meta = {title: layer.title}; } // assign order to layers @@ -1128,7 +1128,7 @@ export default function getLayers() { const title = layer.title; layer.order = orderByTitle[title]; if (!layer.order) { - throw new Error(`Layer title not found in titlesByOrder list: ${title}`) + throw new Error(`Layer title not found in titlesByOrder list: ${title}`); } } @@ -1144,7 +1144,7 @@ export default function getLayers() { for (let title of groupDef.layers) { let layer = layersByTitle[title]; if (!layer) { - throw new Error(`Unknown layer in groups definitions: ${title}`) + throw new Error(`Unknown layer in groups definitions: ${title}`); } group.layers.push(layer); } @@ -1214,7 +1214,7 @@ export default function getLayers() { for (let group of groupsDefs) { for (let title of group.layers) { if (seenLayerTitles.has(title)) { - throw new Error(`Duplicate layer in groups definition: ${title}`) + throw new Error(`Duplicate layer in groups definition: ${title}`); } seenLayerTitles.add(title); } diff --git a/src/lib/cache/index.js b/src/lib/cache/index.js @@ -12,7 +12,7 @@ class Cache { this._store[key] = value; return {value, found: true}; } - return {found: false} + return {found: false}; } put(key, value) { @@ -29,4 +29,4 @@ class Cache { } } -export {Cache} -\ No newline at end of file +export {Cache}; +\ No newline at end of file diff --git a/src/lib/clipboardCopy/index.js b/src/lib/clipboardCopy/index.js @@ -11,10 +11,10 @@ function showNotification(message, mouseEvent) { x = mouseEvent.clientX - w - 8, y = mouseEvent.clientY - h / 2; if (x < 0) { - x = 0 + x = 0; } if (y < 0) { - y = 0 + y = 0; } el.style.top = y + 'px'; el.style.left = x + 'px'; diff --git a/src/lib/file-read/index.js b/src/lib/file-read/index.js @@ -21,7 +21,7 @@ const selectFiles = (() => { ); fileInput.click(); return result; - } + }; })(); function readFile(file) { diff --git a/src/lib/googleMapsApi/index.js b/src/lib/googleMapsApi/index.js @@ -12,7 +12,7 @@ function getGoogle() { _pending = new Promise((resolve, reject) => { loadScript(config.googleApiUrl, (error) => { if (error) { - reject(error) + reject(error); } _google = window.google; resolve(_google); diff --git a/src/lib/iconFromBackgroundImage/index.js b/src/lib/iconFromBackgroundImage/index.js @@ -5,7 +5,7 @@ function cached(f) { cache[arg] = f(arg); } return cache[arg]; - } + }; } function iconFromBackgroundImage(className) { diff --git a/src/lib/leaflet.control.azimuth/index.js b/src/lib/leaflet.control.azimuth/index.js @@ -43,7 +43,7 @@ function calcAngle(latlng1, latlng2) { } function roundAzimuth(a) { - return (Math.round(a) + 360) % 360 + return (Math.round(a) + 360) % 360; } L.Control.Azimuth = L.Control.extend({ @@ -203,12 +203,12 @@ L.Control.Azimuth = L.Control.extend({ onMapClick: function(e) { if (!this.points.start && !this.points.end) { - this.setPoints({start: e.latlng}) + this.setPoints({start: e.latlng}); } else if (this.points.start && !this.points.end) { - this.setPoints({end: e.latlng}) + this.setPoints({end: e.latlng}); } else if (this.points.start && this.points.end) { this.hideProfile(); - this.setPoints({start: e.latlng, end: null}) + this.setPoints({start: e.latlng, end: null}); } }, diff --git a/src/lib/leaflet.control.commons/index.js b/src/lib/leaflet.control.commons/index.js @@ -45,7 +45,7 @@ function makeButtonWithBar(containerClass, title, iconClass) { const barContainer = L.DomUtil.create('div', 'leaflet-bar bar', container); stopContainerEvents(barContainer); - return {container, buttonContainer, link, icon, barContainer} + return {container, buttonContainer, link, icon, barContainer}; } export {stopContainerEvents, makeButton, makeButtonWithBar}; \ No newline at end of file diff --git a/src/lib/leaflet.control.coordinates/formats.js b/src/lib/leaflet.control.coordinates/formats.js @@ -37,7 +37,7 @@ function formatLatLng(latlng, format) { return { lat: format.formatter(coordinatePresentations(latlng.lat, true)), lng: format.formatter(coordinatePresentations(latlng.lng, false)) - } + }; } const SIGNED_DEGREES = { @@ -73,4 +73,4 @@ export default { DEGREES_AND_MINUTES, DEGREES_AND_MINUTES_AND_SECONDS, formatLatLng -} +}; diff --git a/src/lib/leaflet.control.coordinates/index.js b/src/lib/leaflet.control.coordinates/index.js @@ -1,4 +1,4 @@ -import L from 'leaflet' +import L from 'leaflet'; import ko from 'knockout'; import './coordinates.css'; import copyToClipboard from '~/lib/clipboardCopy'; @@ -37,7 +37,7 @@ L.Control.Coordinates = L.Control.extend({ for (let format of this.formats) { if (value === format.code) { this.format(format); - break + break; } } } diff --git a/src/lib/leaflet.control.elevation-profile/index.js b/src/lib/leaflet.control.elevation-profile/index.js @@ -88,12 +88,12 @@ function offestFromEvent(e) { return { offsetX: e.clientX - rect.left, offestY: e.clientY - rect.top - } + }; } else { return { offsetX: e.offsetX, offestY: e.offsetY - } + }; } } @@ -101,7 +101,7 @@ function movementFromEvents(e1, e2) { return { movementX: e2.clientX - e1.clientX, movementY: e2.clientY - e1.clientY - } + }; } var DragEvents = L.Class.extend({ @@ -507,7 +507,7 @@ const ElevationProfile = L.Class.extend({ endApprox: '', approx: '', incomplete: 'No elevation data', - } + }; } else { d = { maxElev: Math.round(stats.max), @@ -546,7 +546,7 @@ const ElevationProfile = L.Class.extend({ <tr class="start-group"><td>Distance:</td><td>${d.dist} km</td></tr> <tr><td colspan="2" style="text-align: center">${d.incomplete}</td></tr> </table> - ` + `; }, calcGridValues: function(minValue, maxValue) { @@ -564,7 +564,7 @@ const ElevationProfile = L.Class.extend({ tick2 = Math.ceil(maxValue / tickStep); if ((tick2 - tick1) < ticksN) { matchFound = true; - break + break; } } if (matchFound) { @@ -596,7 +596,7 @@ const ElevationProfile = L.Class.extend({ for (i = scanStart + 1; i < scanEnd; i++) { linearValue += linearDelta; if (filtered[i] === null) { - continue + continue; } error = Math.abs(filtered[i] - linearValue); if (error === null || error > maxError) { @@ -656,7 +656,7 @@ const ElevationProfile = L.Class.extend({ for (let i = firstNotNullIndex + 1; i <= lastNotNullIndex; i++) { let value = values[i]; if (value === null) { - continue + continue; } let length = i - prevNotNullIndex; let gradient = (value - prevNotNullValue) / length; @@ -854,7 +854,7 @@ const ElevationProfile = L.Class.extend({ if (prevDist < minDist + prevSampleDist) { di = -((minDist - prevDist) / 2 / prevSampleDist + 1 / 2); } else { - di = -0.001 + di = -0.001; } } else { if (prevDist < nextDist) { diff --git a/src/lib/leaflet.control.jnx/binary-stream.js b/src/lib/leaflet.control.jnx/binary-stream.js @@ -1,4 +1,4 @@ -import utf8 from 'utf8' +import utf8 from 'utf8'; class BinStream { constructor(size, littlEndian) { @@ -87,4 +87,4 @@ class BinStream { } } -export {BinStream} -\ No newline at end of file +export {BinStream}; +\ No newline at end of file diff --git a/src/lib/leaflet.control.jnx/index.js b/src/lib/leaflet.control.jnx/index.js @@ -29,7 +29,7 @@ L.Control.JNX = L.Control.extend({ selectedLayer = { layer, layerName: layerRec.name - } + }; } } return selectedLayer; @@ -139,7 +139,7 @@ L.Control.JNX = L.Control.extend({ .on('change', () => this.fire('selectionchange')) .on('click contextmenu', (e) => { L.DomEvent.stop(e); - this.contextMenu.show(e) + this.contextMenu.show(e); }); this.fire('selectionchange'); }, diff --git a/src/lib/leaflet.control.jnx/jnx-maker.js b/src/lib/leaflet.control.jnx/jnx-maker.js @@ -22,7 +22,7 @@ function imageFromarrayBuffer(arr) { image.onerror = () => reject(new Error('Tile image corrupt')); image.src = dataUrl; } - ) + ); } async function convertToJpeg(image) { @@ -47,7 +47,7 @@ function ensureImageJpg(image) { } if (arrayBufferToString(image.slice(0, 4)) === '\x89PNG' && arrayBufferToString(image.slice(-8)) === 'IEND\xae\x42\x60\x82') { - return convertToJpeg(image) + return convertToJpeg(image); } else if (arrayBufferToString(image.slice(0, 2)) === '\xff\xd8' && arrayBufferToString(image.slice(-2)) === '\xff\xd9') { return Promise.resolve(image); diff --git a/src/lib/leaflet.control.layers.configure/index.js b/src/lib/leaflet.control.layers.configure/index.js @@ -49,7 +49,7 @@ function enableConfig(control, {layers, customLayersOrder}) { } catch (e) { logging.captureMessage('Failed to load enabled layers from localstorage - invalid json',{ extra: {"localstorage.layersEnabled": serialized.slice(0, 1000)} - }) + }); } } // restore custom layers; @@ -75,7 +75,7 @@ function enableConfig(control, {layers, customLayersOrder}) { }, _onConfigButtonClick: function() { - this.showLayersSelectWindow() + this.showLayersSelectWindow(); }, _initLayersSelectWindow: function() { @@ -350,10 +350,10 @@ function enableConfig(control, {layers, customLayersOrder}) { checkCustomLayerValues: function(fieldValues) { if (!fieldValues.url) { - return {'error': 'Url is empty'} + return {'error': 'Url is empty'}; } if (!fieldValues.name) { - return {'error': 'Name is empty'} + return {'error': 'Name is empty'}; } return {}; }, @@ -501,7 +501,7 @@ function enableConfig(control, {layers, customLayersOrder}) { } ); if (control._map) { - control.__injectConfigButton() + control.__injectConfigButton(); } control._initializeLayersState(); } diff --git a/src/lib/leaflet.control.layers.minimize/index.js b/src/lib/leaflet.control.layers.minimize/index.js @@ -45,7 +45,7 @@ function enableMinimize(control) { } ); if (control._map) { - control.__injectMinimizeButtons() + control.__injectMinimizeButtons(); } diff --git a/src/lib/leaflet.control.layers.top-row/index.js b/src/lib/leaflet.control.layers.top-row/index.js @@ -26,7 +26,7 @@ function enableTopRow(control) { }); if (control._map) { - control.__injectTopRow() + control.__injectTopRow(); } diff --git a/src/lib/leaflet.control.locate/index.js b/src/lib/leaflet.control.locate/index.js @@ -179,7 +179,7 @@ const LocateControl = L.Control.extend({ setTimeout(() => { this._onLocationError(error); }, 0 - ) + ); } this._watchID = navigator.geolocation.watchPosition( this._onLocationSuccess.bind(this), this._onLocationError.bind(this), @@ -254,7 +254,7 @@ const LocateControl = L.Control.extend({ const screenSize = this._map.getSize(); const averageScreenSize = (screenSize.x + screenSize.y) / 2; if (p1.distanceTo(p2) > averageScreenSize * this.options.minDistForAutoZoom) { - newZoom = autoZoom + newZoom = autoZoom; } else { newZoom = currentZoom > zoomFitAccuracy ? zoomFitAccuracy : currentZoom; } @@ -263,14 +263,14 @@ const LocateControl = L.Control.extend({ }, _onMapMove: function() { - this._handleEvent(EVENT_MAP_MOVE) + this._handleEvent(EVENT_MAP_MOVE); }, _onMapMoveEnd: function() { const ll = this._map.getCenter(); setTimeout(() => { if (this._map.getCenter().equals(ll)) { - this._handleEvent(EVENT_MAP_MOVE_END) + this._handleEvent(EVENT_MAP_MOVE_END); } }, 100 ); @@ -351,12 +351,12 @@ const LocateControl = L.Control.extend({ this._setViewToLocation(); } else if (this._state === STATE_ENABLED_FOLLOWING || state === STATE_UPDATING_FOLLOWING) { this._updateMapPositionWhileFollowing(); - this._setState(STATE_UPDATING_FOLLOWING) + this._setState(STATE_UPDATING_FOLLOWING); } break; case EVENT_LOCATION_ERROR: if (state === STATE_DISABLED) { - return + return; } this.options.showError(data); this._setState(STATE_DISABLED); diff --git a/src/lib/leaflet.control.panoramas/index.js b/src/lib/leaflet.control.panoramas/index.js @@ -43,7 +43,7 @@ const PanoMarker = L.Marker.extend({ setType: function(markerType) { const className = { 'slim': 'leaflet-panorama-marker-circle', - 'normal': 'leaflet-panorama-marker-binocular'}[markerType] + 'normal': 'leaflet-panorama-marker-binocular'}[markerType]; this.getIcon().className = className; } }); @@ -72,7 +72,7 @@ L.Control.Panoramas = L.Control.extend({ code: 'm', selected: ko.observable(false), mapMarkerType: 'normal'}, - ] + ]; }, initialize: function(panoramaContainer, options) { @@ -181,7 +181,7 @@ L.Control.Panoramas = L.Control.extend({ if (L.DomUtil.hasClass(this._panoramaContainer, 'enabled')) { for (let provider of this.providers) { if (L.DomUtil.hasClass(provider.container, 'enabled')) { - return provider + return provider; } } } @@ -190,7 +190,7 @@ L.Control.Panoramas = L.Control.extend({ setupNearbyPoints: function(points) { for (let point of this.nearbyPoints) { - this._map.removeLayer(point) + this._map.removeLayer(point); } this.nearbyPoints = []; if (points) { @@ -347,7 +347,7 @@ L.Control.Panoramas.include({ } this.enableControl(); for (let provider of this.providers) { - provider.selected(coverageCode.includes(provider.code)) + provider.selected(coverageCode.includes(provider.code)); } if (state.length > 2) { const panoramaVisible = state[1]; diff --git a/src/lib/leaflet.control.panoramas/lib/google/index.js b/src/lib/leaflet.control.panoramas/lib/google/index.js @@ -25,7 +25,7 @@ async function getPanoramaAtPos(latlng, searchRadiusMeters) { radius: searchRadiusMeters, preference: google.maps.StreetViewPreference.NEAREST }, (data, status) => resolve({data, status}) - ) + ); } ); if (status === google.maps.StreetViewStatus.OK) { @@ -106,7 +106,7 @@ const Viewer = L.Evented.extend({ async function getViewer(container) { const google = await getGoogle(); - return new Viewer(google, container) + return new Viewer(google, container); } diff --git a/src/lib/leaflet.control.panoramas/lib/mapillary/index.js b/src/lib/leaflet.control.panoramas/lib/mapillary/index.js @@ -1,5 +1,5 @@ import L from 'leaflet'; -import {MapillaryCoverage} from './mapillary-coverage-layer' +import {MapillaryCoverage} from './mapillary-coverage-layer'; import {fetch} from '~/lib/xhr-promise'; import config from '~/config'; import './style.css'; @@ -116,7 +116,7 @@ const Viewer = L.Evented.extend({ updateZoomAndCenter: function() { this.viewer.getZoom().then((zoom) => { - this._zoom=zoom + this._zoom=zoom; }); this.viewer.getCenter().then((center) => { this._center = center; diff --git a/src/lib/leaflet.control.panoramas/lib/mapillary/mapillary-coverage-layer.js b/src/lib/leaflet.control.panoramas/lib/mapillary/mapillary-coverage-layer.js @@ -42,7 +42,7 @@ const MapillaryCoverage = L.GridLayer.extend({ canvasCtx.fillStyle = this.options.color; for (let feature of tileData['mapillary-sequence-overview']) { if (feature.geometry.type !== 'Point') { - throw new Error(`Invalid sequence overview geometry type "${feature.geometry.type}"`) + throw new Error(`Invalid sequence overview geometry type "${feature.geometry.type}"`); } canvasCtx.beginPath(); let x = feature.geometry.coordinates[0] * multiplier - offsetX; @@ -70,7 +70,7 @@ const MapillaryCoverage = L.GridLayer.extend({ canvasCtx.lineJoin = "bevel"; for (let feature of tileData['mapillary-sequences']) { if (feature.geometry.type !== 'MultiLineString') { - throw new Error(`Invalid sequence geometry type "${feature.geometry.type}"`) + throw new Error(`Invalid sequence geometry type "${feature.geometry.type}"`); } let {multiplier, offsetX, offsetY} = adjustment; @@ -109,7 +109,7 @@ const MapillaryCoverage = L.GridLayer.extend({ canvasCtx.fillStyle = this.options.color; for (let feature of tileData['mapillary-images']) { if (feature.geometry.type !== 'Point') { - throw new Error(`Invalid image geometry type "${feature.geometry.type}"`) + throw new Error(`Invalid image geometry type "${feature.geometry.type}"`); } canvasCtx.beginPath(); let x = feature.geometry.coordinates[0] * multiplier - offsetX; @@ -134,7 +134,7 @@ const MapillaryCoverage = L.GridLayer.extend({ this.drawSequences(canvas, width); } else { this.drawSequences(canvas, 2); - this.drawImages(canvas) + this.drawImages(canvas); } }, diff --git a/src/lib/leaflet.control.panoramas/lib/mapillary/mapillary-loader.js b/src/lib/leaflet.control.panoramas/lib/mapillary/mapillary-loader.js @@ -26,9 +26,9 @@ class MapillaryLoader extends TiledDataLoader { } else if (z < 0) { z2 = 0; } else if (z > this.maxZoom) { - z2 = this.maxZoom + z2 = this.maxZoom; } else { - return {z, x: layerTileCoords.x, y: layerTileCoords.y} + return {z, x: layerTileCoords.x, y: layerTileCoords.y}; } let multiplier = 1 << (z - z2); @@ -36,7 +36,7 @@ class MapillaryLoader extends TiledDataLoader { x: Math.floor(layerTileCoords.x / multiplier), y: Math.floor(layerTileCoords.y / multiplier), z: z2 - } + }; } @@ -48,7 +48,7 @@ class MapillaryLoader extends TiledDataLoader { timeout: 10000, isResponseSuccess: (xhr) => xhr.status === 200 || xhr.status === 403 } - } + }; } calcAdjustment(layerTileCoords, dataTileCoords) { @@ -82,7 +82,7 @@ class MapillaryLoader extends TiledDataLoader { return { tileData, coords: originalDataTileCoords - } + }; } } diff --git a/src/lib/leaflet.control.panoramas/lib/mapillary/mvt.js b/src/lib/leaflet.control.panoramas/lib/mapillary/mvt.js @@ -40,7 +40,7 @@ function parseGeometry(geometryType, ints, coordinatesScale) { throw new Error(`repeat=${cmdRepeat} for command LineTo`); } if (!line) { - throw new Error('LineTo with empty linestring') + throw new Error('LineTo with empty linestring'); } pos +=1; for (let cmdN = 0; cmdN < cmdRepeat; cmdN++){ @@ -49,7 +49,7 @@ function parseGeometry(geometryType, ints, coordinatesScale) { } x += decodeCoordinate(ints[pos]); y += decodeCoordinate(ints[pos + 1]); - line.push([x * coordinatesScale, y * coordinatesScale]) + line.push([x * coordinatesScale, y * coordinatesScale]); pos += 2; } break; @@ -58,7 +58,7 @@ function parseGeometry(geometryType, ints, coordinatesScale) { throw new Error(`ClosePath command for non-polygon type ${geometryType}`); } if (!line) { - throw new Error('ClosePath with empty linestring') + throw new Error('ClosePath with empty linestring'); } if (cmdRepeat !== 1) { throw new Error(`ClosePath repeats ${cmdRepeat} times`); diff --git a/src/lib/leaflet.control.panoramas/lib/wikimedia/coverage-layer.js b/src/lib/leaflet.control.panoramas/lib/wikimedia/coverage-layer.js @@ -64,9 +64,9 @@ class WikimediaLoader extends TiledDataLoader { let z = layerTileCoords.z; let z2 = null; if (z > this.maxZoom) { - z2 = this.maxZoom + z2 = this.maxZoom; } else { - return {z, x: layerTileCoords.x, y: layerTileCoords.y} + return {z, x: layerTileCoords.x, y: layerTileCoords.y}; } let multiplier = 1 << (z - z2); @@ -74,7 +74,7 @@ class WikimediaLoader extends TiledDataLoader { x: Math.floor(layerTileCoords.x / multiplier), y: Math.floor(layerTileCoords.y / multiplier), z: z2 - } + }; } @@ -86,7 +86,7 @@ class WikimediaLoader extends TiledDataLoader { timeout: 10000, isResponseSuccess: (xhr) => xhr.status === 200 || xhr.status === 404 } - } + }; } async processResponse(xhr, originalDataTileCoords) { @@ -100,7 +100,7 @@ class WikimediaLoader extends TiledDataLoader { return { tileData, coords: originalDataTileCoords - } + }; } } diff --git a/src/lib/leaflet.control.panoramas/lib/wikimedia/index.js b/src/lib/leaflet.control.panoramas/lib/wikimedia/index.js @@ -75,7 +75,7 @@ function parseSearchResponse(resp) { description: description, pageUrl: iinfo.descriptionurl, pageId: page.pageid.toString() - }) + }); } if (images.length) { return images; @@ -204,7 +204,7 @@ const Viewer = L.Evented.extend({ let image = this.images[imageIdx]; let mapSize = this.map.getSize(); if (!mapSize.x || !mapSize.y) { - mapSize = {x: 500, y: 500} + mapSize = {x: 500, y: 500}; } let maxZoom = Math.log2(Math.max(image.width / mapSize.x, image.height / mapSize.y)) + 2; if (maxZoom < 1) { @@ -267,7 +267,7 @@ const Viewer = L.Evented.extend({ }) } - ) + ); } }, diff --git a/src/lib/leaflet.control.printPages/control.js b/src/lib/leaflet.control.printPages/control.js @@ -1,11 +1,11 @@ -import L from 'leaflet' +import L from 'leaflet'; import ko from 'knockout'; import '~/lib/knockout.component.progress/progress'; import '~/lib/controls-styles/controls-styles.css'; import './control.css'; import PageFeature from './pageFeature'; import Contextmenu from '~/lib/contextmenu'; -import {renderPages} from './map-render' +import {renderPages} from './map-render'; import formHtml from './form.html'; import {notify} from '~/lib/notifications'; import {makePdf} from './pdf'; @@ -137,7 +137,7 @@ L.Control.PrintPages = L.Control.extend({ page.on('moveend', this.notifyChange, this); this.updateFormZooms(); this.notifyChange(); - return page + return page; }, addLandscapePage: function() { @@ -157,7 +157,7 @@ L.Control.PrintPages = L.Control.extend({ this.pages[i].setLabel((i + 1).toString()); } this.notifyChange(); - this.updateFormZooms() + this.updateFormZooms(); }, removePages: function() { @@ -179,9 +179,9 @@ L.Control.PrintPages = L.Control.extend({ zoomForPrint: function() { let zoom = this.zoomLevel(); if (zoom === 'auto') { - zoom = this.suggestZooms() + zoom = this.suggestZooms(); } else { - zoom = {mapZoom: zoom, satZoom: zoom} + zoom = {mapZoom: zoom, satZoom: zoom}; } return zoom; }, @@ -204,7 +204,7 @@ L.Control.PrintPages = L.Control.extend({ latLngBounds: page.getLatLngBounds(), printSize: page.getPrintSize(), label: page.getLabel() - } + }; } ); const resolution = this.resolution(); @@ -411,7 +411,7 @@ L.Control.PrintPages = L.Control.extend({ }, hasPages: function() { - return !!this.pages.length + return !!this.pages.length; }, _pagesNumLabel: function() { diff --git a/src/lib/leaflet.control.printPages/decoration.grid.js b/src/lib/leaflet.control.printPages/decoration.grid.js @@ -26,7 +26,7 @@ class Grid extends PrintStaticLayer { let intervalM; for (intervalM of this.intervals) { if (intervalM > minGridIntervalM) { - break + break; } } return intervalM; @@ -66,7 +66,7 @@ class Grid extends PrintStaticLayer { let lat = L.Projection.SphericalMercator.unproject(L.point(0, yMerc)).lat; rows.push({lat, y}); if (y < 0) { - break + break; } let lat2 = lat + intervalM / metersPerDegree; let yMerc2 = L.Projection.SphericalMercator.project(L.latLng(lat2, 0)).y; @@ -103,7 +103,7 @@ class Grid extends PrintStaticLayer { firstRow = false; } if (!hasPointInPage) { - break + break; } colN += 1; } @@ -150,7 +150,7 @@ class Grid extends PrintStaticLayer { ), abortLoading: () => { } - } + }; }).bind(this), count: 2 }; diff --git a/src/lib/leaflet.control.printPages/decoration.magnetic-meridians.js b/src/lib/leaflet.control.printPages/decoration.magnetic-meridians.js @@ -24,7 +24,7 @@ class MagneticMeridians extends PrintStaticLayer { const origin = projectedBounds.min; return function(pixel) { return L.CRS.EPSG3857.pointToLatLng(pixel.scaleBy(scale).add(origin), printOptions.zoom); - } + }; } _drawRaster(canvas, printOptions) { diff --git a/src/lib/leaflet.control.printPages/decoration.scale.js b/src/lib/leaflet.control.printPages/decoration.scale.js @@ -11,7 +11,7 @@ function pageScaleRange(printOptions) { return { min: Math.min(nScale, sScale, printOptions.scale), max: Math.max(nScale, sScale, printOptions.scale) - } + }; } function formatScale(nominalScale, scaleRange) { @@ -22,9 +22,9 @@ function formatScale(nominalScale, scaleRange) { if (scaleRange.min >= 1000) { scaleRange.min /= 1000; scaleRange.max /= 1000; - unit = 'km' + unit = 'km'; } else { - unit = 'm' + unit = 'm'; } return `${scaleRange.min} – ${scaleRange.max} ${unit} in 1 cm`; } else { diff --git a/src/lib/leaflet.control.printPages/decorations.js b/src/lib/leaflet.control.printPages/decorations.js @@ -27,7 +27,7 @@ class PrintStaticLayer { ), abortLoading: () => { } - } + }; }).bind(this), count: 1 }; diff --git a/src/lib/leaflet.control.printPages/map-render.js b/src/lib/leaflet.control.printPages/map-render.js @@ -31,7 +31,7 @@ function getLayersForPrint(map, xhrQueue) { order.push(getZIndex(el)); el = el.parentNode; } - return order.reverse() + return order.reverse(); } diff --git a/src/lib/leaflet.control.printPages/pageFeature.js b/src/lib/leaflet.control.printPages/pageFeature.js @@ -1,4 +1,4 @@ -import L from 'leaflet' +import L from 'leaflet'; import './page-feature.css'; const PageFeature = L.Marker.extend({ diff --git a/src/lib/leaflet.control.track-list/lib/geo_file_exporters.js b/src/lib/leaflet.control.track-list/lib/geo_file_exporters.js @@ -124,7 +124,7 @@ function saveKml(segments, name, points) { var label = marker.label; label = escapeHtml(label); label = utf8.encode(label); - var coordinates = marker.latlng.lng.toFixed(6) + ',' + marker.latlng.lat.toFixed(6) + ',0' + var coordinates = marker.latlng.lng.toFixed(6) + ',' + marker.latlng.lat.toFixed(6) + ',0'; kml.push('\t\t<Placemark>'); kml.push('\t\t\t<name>' + label + '</name>'); diff --git a/src/lib/leaflet.control.track-list/lib/parsers/index.js b/src/lib/leaflet.control.track-list/lib/parsers/index.js @@ -11,4 +11,4 @@ export default [ parseOziPlt, parseOziWpt, parseKml, -] +]; diff --git a/src/lib/leaflet.control.track-list/lib/parsers/kml.js b/src/lib/leaflet.control.track-list/lib/parsers/kml.js @@ -48,7 +48,7 @@ function parseKml(txt, name) { for (i = 0; i < placemarks.length; i++) { pointObjs = placemarks[i].getElementsByTagName('Point'); if (pointObjs.length === 0) { - continue + continue; } else if (pointObjs.length > 1) { error = 'CORRUPT'; break; @@ -159,4 +159,4 @@ function parseKmz(txt, name) { return geodata; } -export {parseKml, parseKmz} -\ No newline at end of file +export {parseKml, parseKmz}; +\ No newline at end of file diff --git a/src/lib/leaflet.control.track-list/lib/parsers/nktk.js b/src/lib/leaflet.control.track-list/lib/parsers/nktk.js @@ -208,7 +208,7 @@ function parseNktkOld(s, version) { } if (version >= 3) { try { - trackHidden = !!(s.readNumber()) + trackHidden = !!(s.readNumber()); } catch (e) { if (e.message.match('Unexpected end of line while unpacking number')) { error = ['CORRUPT']; diff --git a/src/lib/leaflet.control.track-list/lib/parsers/ozi.js b/src/lib/leaflet.control.track-list/lib/parsers/ozi.js @@ -30,7 +30,7 @@ function parseOziRte(txt, name) { currentSegment.push({lat, lng}); } else { error = 'CORRUPT'; - break + break; } } if (currentSegment.length) { diff --git a/src/lib/leaflet.control.track-list/lib/parsers/urlSafeBase64.js b/src/lib/leaflet.control.track-list/lib/parsers/urlSafeBase64.js @@ -23,4 +23,4 @@ function decode(s) { return null; } -export default {encode, decode} +export default {encode, decode}; diff --git a/src/lib/leaflet.control.track-list/lib/parsers/xmlUtils.js b/src/lib/leaflet.control.track-list/lib/parsers/xmlUtils.js @@ -9,4 +9,4 @@ function xmlGetNodeText(node) { } } -export {xmlGetNodeText} -\ No newline at end of file +export {xmlGetNodeText}; +\ No newline at end of file diff --git a/src/lib/leaflet.control.track-list/lib/parsers/zip.js b/src/lib/leaflet.control.track-list/lib/parsers/zip.js @@ -34,7 +34,7 @@ function parseZip(txt, _unused_name) { if (item.error === 'UNSUPPORTED' && item.name.match(/\.pdf$|\.doc$|\.txt$\.jpg$/)) { continue; } - geodata_array.push(item) + geodata_array.push(item); } } return geodata_array; diff --git a/src/lib/leaflet.control.track-list/lib/services/endomondo.js b/src/lib/leaflet.control.track-list/lib/services/endomondo.js @@ -38,7 +38,7 @@ class Endomondo extends BaseService { let data; try { - data = JSON.parse(response.responseBinaryText) + data = JSON.parse(response.responseBinaryText); } catch (e) { return [{name: 'Endomondo activity', error: 'UNSUPPORTED'}]; } @@ -52,7 +52,7 @@ class Endomondo extends BaseService { return { lat: p.latitude, lng: p.longitude - } + }; } ); if (track.length === 0) { diff --git a/src/lib/leaflet.control.track-list/lib/services/etomesto.js b/src/lib/leaflet.control.track-list/lib/services/etomesto.js @@ -24,7 +24,7 @@ class Etomesto extends BaseService { xhr.status === 200 && !xhr.responseBinaryText.startsWith('ERROR')) } - }] + }]; } parseResponse(responses) { diff --git a/src/lib/leaflet.control.track-list/lib/services/gpsies.js b/src/lib/leaflet.control.track-list/lib/services/gpsies.js @@ -40,4 +40,4 @@ class Gpsies extends BaseService { } -export default Gpsies -\ No newline at end of file +export default Gpsies; +\ No newline at end of file diff --git a/src/lib/leaflet.control.track-list/lib/services/gpslib.js b/src/lib/leaflet.control.track-list/lib/services/gpslib.js @@ -15,7 +15,7 @@ class Gpslib extends BaseService { return [{ url: urlViaCorsProxy(`https://www.gpslib.ru/tracks/download/${trackId}.gpx`), options: {responseType: 'binarystring'} - }] + }]; } parseResponse(responses) { diff --git a/src/lib/leaflet.control.track-list/lib/services/index.js b/src/lib/leaflet.control.track-list/lib/services/index.js @@ -1,4 +1,4 @@ -import SimpleService from './simpleService' +import SimpleService from './simpleService'; import Endomondo from './endomondo'; import Etomesto from './etomesto'; import Gpsies from './gpsies'; @@ -26,4 +26,4 @@ export default [ MovescountRoute, SportsTrackerActivity, SimpleService -] -\ No newline at end of file +]; +\ No newline at end of file diff --git a/src/lib/leaflet.control.track-list/lib/services/movescount.js b/src/lib/leaflet.control.track-list/lib/services/movescount.js @@ -19,7 +19,7 @@ class MovescountRoute extends MovescountBase { responseType: 'json', isResponseSuccess: (xhr) => xhr.status === 200 || xhr.status === 403 }, - }] + }]; } parseResponse(responses) { @@ -78,7 +78,7 @@ class MovescountMove extends MovescountBase { isResponseSuccess: (xhr) => xhr.status === 200 || xhr.status === 403 || xhr.status === 404 } } - ] + ]; } parseResponse(responses) { diff --git a/src/lib/leaflet.control.track-list/lib/services/nakarte/index.js b/src/lib/leaflet.control.track-list/lib/services/nakarte/index.js @@ -78,7 +78,7 @@ class NakarteUrlLoader { } async loadPoint(values) { - return parsePointFromHashValues(values) + return parsePointFromHashValues(values); } } @@ -104,12 +104,12 @@ class NakarteUrl { function parsePointFromHashValues(values) { if (values.length < 2) { - return [{name: 'Point in url', error: 'CORRUPT'}] + return [{name: 'Point in url', error: 'CORRUPT'}]; } const lat = parseFloat(values[0]); const lng = parseFloat(values[1]); if (isNaN(lat) || isNaN(lng) || lat < -90 || lat > 90 || lng < -180 || lng > 180) { - return [{name: 'Point in url', error: 'CORRUPT'}] + return [{name: 'Point in url', error: 'CORRUPT'}]; } const name = ((values[2] || '').trim()) || 'Point'; return [{name, points: [{name, lat, lng}]}]; diff --git a/src/lib/leaflet.control.track-list/lib/services/nakarte/loadTracksFromJson.js b/src/lib/leaflet.control.track-list/lib/services/nakarte/loadTracksFromJson.js @@ -8,12 +8,12 @@ function parseWaypoint(rawPoint) { let lng = Number(rawPoint.ln); if (typeof name !== 'string' || !name || isNaN(lat) || isNaN(lng) || lat < -90 || lat > 90 || lng < -180 || lng > 180) { - return {valid: false} + return {valid: false}; } return { valid: true, point: {lat, lng, name} - } + }; } function parseTrack(rawTrack) { @@ -48,7 +48,7 @@ async function loadTracksFromJson(value) { const jsonString = urlSafeBase64.decode(value); let data; try { - data = JSON.parse(jsonString) + data = JSON.parse(jsonString); } catch (e) { return errCorrupt; } @@ -106,7 +106,7 @@ async function loadTracksFromJson(value) { viewProps.measureTicksShown = !!el.m; } geodata.forEach((el) => Object.assign(el, viewProps)); - geoDataArray.push(...geodata) + geoDataArray.push(...geodata); } return geoDataArray; } diff --git a/src/lib/leaflet.control.track-list/lib/services/osm.js b/src/lib/leaflet.control.track-list/lib/services/osm.js @@ -19,7 +19,7 @@ class Osm extends BaseService { return [{ url: urlViaCorsProxy(`https://www.openstreetmap.org/trace/${trackId}/data`), options: {responseType: 'binarystring'} - }] + }]; } parseResponse(responses) { diff --git a/src/lib/leaflet.control.track-list/lib/services/sportstracker.js b/src/lib/leaflet.control.track-list/lib/services/sportstracker.js @@ -29,7 +29,7 @@ class SportsTrackerActivity extends SportsTrackerBase { isResponseSuccess: (xhr) => xhr.status === 200 || xhr.status === 403 } } - ] + ]; } parseResponse(responses) { diff --git a/src/lib/leaflet.control.track-list/lib/services/tracedetrail.js b/src/lib/leaflet.control.track-list/lib/services/tracedetrail.js @@ -16,7 +16,7 @@ class Tracedetrail extends BaseService { return [{ url: urlViaCorsProxy(`https://tracedetrail.com/en/trace/geomSections/${trackId}`), options: {responseType: 'json'} - }] + }]; } parseResponse(responses) { diff --git a/src/lib/leaflet.control.track-list/track-list.hash-state.js b/src/lib/leaflet.control.track-list/track-list.hash-state.js @@ -1,5 +1,5 @@ import L from 'leaflet'; -import {NakarteUrlLoader} from './lib/services/nakarte' +import {NakarteUrlLoader} from './lib/services/nakarte'; L.Control.TrackList.include({ diff --git a/src/lib/leaflet.control.track-list/track-list.js b/src/lib/leaflet.control.track-list/track-list.js @@ -194,7 +194,7 @@ L.Control.TrackList = L.Control.extend({ return track.feature.getLayers().filter(function(layer) { return layer instanceof L.Polyline; } - ) + ); }, getTrackPoints: function(track) { @@ -470,7 +470,7 @@ L.Control.TrackList = L.Control.extend({ duplicateTrack: function(track) { const segments = this.getTrackPolylines(track).map((line) => { - return line.getLatLngs().map((latlng) => [latlng.lat, latlng.lng]) + return line.getLatLngs().map((latlng) => [latlng.lat, latlng.lng]); }); const points = this.getTrackPoints(track) .map((point) => ({lat: point.latlng.lat, lng: point.latlng.lng, name: point.label})); diff --git a/src/lib/leaflet.control.track-list/track-list.localstorage.js b/src/lib/leaflet.control.track-list/track-list.localstorage.js @@ -1,4 +1,4 @@ -import './track-list' +import './track-list'; import L from 'leaflet'; import {parseNktkSequence} from './lib/parsers/nktk'; import safeLocalStorage from '~/lib/safe-localstorage'; @@ -50,7 +50,7 @@ L.Control.TrackList.include({ } if (keys.length > this.maxLocalStorageSessions) { keys.sort(function(a, b) { - return a - b + return a - b; } ); for (i = 0; i < keys.length - this.maxLocalStorageSessions; i++) { diff --git a/src/lib/leaflet.fixes/fixWorldCopyJump.js b/src/lib/leaflet.fixes/fixWorldCopyJump.js @@ -40,7 +40,7 @@ function fixVectorMarkerWorldJump() { const mapCenter = this._map.getCenter(); if (polylineCenter.lng < mapCenter.lng - 180) { - shift = worldWidth + shift = worldWidth; } else if (polylineCenter.lng > mapCenter.lng + 180) { shift = -worldWidth; } else { @@ -124,7 +124,7 @@ function fixVectorMarkerWorldJump() { } else if (Math.abs(lng - this._lastResetLongitude) > 90) { this.fire('viewreset'); } - }) + }); }); // Avoid marker longitude change from 180 to -180 while dragging. @@ -148,7 +148,7 @@ function fixVectorMarkerWorldJump() { marker .fire('move', e) .fire('drag', e); - } + }; } -export {wrapLatLngToTarget, fixVectorMarkerWorldJump, wrapLatLngBoundsToTarget} -\ No newline at end of file +export {wrapLatLngToTarget, fixVectorMarkerWorldJump, wrapLatLngBoundsToTarget}; +\ No newline at end of file diff --git a/src/lib/leaflet.fixes/index.js b/src/lib/leaflet.fixes/index.js @@ -29,7 +29,7 @@ function fixPanAnimationBug() { } function fixTouchDetection() { - L.Browser.touch &= ((navigator.pointerEnabled && !L.Browser.ie)|| navigator.maxTouchPoints) + L.Browser.touch &= ((navigator.pointerEnabled && !L.Browser.ie)|| navigator.maxTouchPoints); } function fixMapKeypressEvent() { @@ -40,7 +40,7 @@ function fixMapKeypressEvent() { } else { originalHandleDOMEvent.call(this, e); } - } + }; } function fixVectorDrawWhileAnimation() { @@ -90,7 +90,7 @@ function allowControlHorizontalStacking() { L.DomUtil.addClass(this._container, 'leaflet-control-horizontal-stack'); } return result; - } + }; } function addTooltipDelay() { @@ -108,7 +108,7 @@ function addTooltipDelay() { L.Layer.prototype.closeTooltip = function() { clearInterval(this._pendingTooltip); origCloseTooltip.call(this); - } + }; } -export {fixAll} +export {fixAll}; diff --git a/src/lib/leaflet.hashState/Leaflet.Map.js b/src/lib/leaflet.hashState/Leaflet.Map.js @@ -1,5 +1,5 @@ import L from 'leaflet'; -import './leaflet.hashState' +import './leaflet.hashState'; L.Map.include(L.Mixin.HashState); diff --git a/src/lib/leaflet.hashState/leaflet.hashState.js b/src/lib/leaflet.hashState/leaflet.hashState.js @@ -21,7 +21,7 @@ L.Mixin.HashState = { const state = hashState.getState(key) || defaultInitialState; if (!state || !this.unserializeState(state)) { - this.unserializeState(defaultInitialState) + this.unserializeState(defaultInitialState); } hashState.updateState(this._hashStateKey, this.serializeState()); return this; diff --git a/src/lib/leaflet.layer.canvasMarkers/index.js b/src/lib/leaflet.layer.canvasMarkers/index.js @@ -149,7 +149,7 @@ L.Layer.CanvasMarkers = L.GridLayer.extend({ this._images[image.src] = image; } } - ) + ); } else { return Promise.resolve(); } @@ -447,7 +447,7 @@ L.Layer.CanvasMarkers = L.GridLayer.extend({ this._map.off('contextmenu', this.onRightClick, this); if (this._hoverMarker) { this._hoverMarker = null; - this.fire('markerleave', {marker: this._hoverMarker}) + this.fire('markerleave', {marker: this._hoverMarker}); } this._map.getPanes().markerPane.removeChild(this.toolTip); L.GridLayer.prototype.onRemove.call(this, map); diff --git a/src/lib/leaflet.layer.geocaching-su/index.js b/src/lib/leaflet.layer.geocaching-su/index.js @@ -53,7 +53,7 @@ const GeocachingSu = L.Layer.CanvasMarkers.extend({ label: marker.label, icon: marker.icon, _label: marker._label - } + }; }, _loadMarkers: function(data) { @@ -69,7 +69,7 @@ const GeocachingSu = L.Layer.CanvasMarkers.extend({ _label: label, label: getLabel, icon, cacheId - } + }; }); this.addMarkers(markers); this._dataLoaded = true; @@ -77,10 +77,10 @@ const GeocachingSu = L.Layer.CanvasMarkers.extend({ }, openCachePage: function(e) { - const url = `https://geocaching.su/?pn=101&cid=${e.marker.cacheId}` + const url = `https://geocaching.su/?pn=101&cid=${e.marker.cacheId}`; openPopupWindow(url, 900, 'geocaching_su'); } }); -export {GeocachingSu} -\ No newline at end of file +export {GeocachingSu}; +\ No newline at end of file diff --git a/src/lib/leaflet.layer.geojson-ajax/index.js b/src/lib/leaflet.layer.geojson-ajax/index.js @@ -33,7 +33,7 @@ L.Layer.GeoJSONAjax = L.GeoJSON.extend({ }}); notify(`Failed to get GeoJSON data from ${this.url}: ${e.message}`); } - ) + ); }, onAdd: function(map) { diff --git a/src/lib/leaflet.layer.google/index.js b/src/lib/leaflet.layer.google/index.js @@ -46,6 +46,6 @@ L.Layer.GoogleSat = L.TileLayer.extend({ initialize: function(options) { L.TileLayer.prototype.initialize.call( - this, 'https://mt{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}', options) + this, 'https://mt{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}', options); } }); diff --git a/src/lib/leaflet.layer.rasterize/Bing.js b/src/lib/leaflet.layer.rasterize/Bing.js @@ -13,7 +13,7 @@ BingLayer.include({ resolve(); } }, 50 - ) + ); } ); } diff --git a/src/lib/leaflet.layer.rasterize/CanvasMarkers.js b/src/lib/leaflet.layer.rasterize/CanvasMarkers.js @@ -1,5 +1,5 @@ import L from "leaflet"; -import '~/lib/leaflet.layer.canvasMarkers' +import '~/lib/leaflet.layer.canvasMarkers'; L.Layer.CanvasMarkers.include({ _printProgressWeight: 0.1, @@ -9,7 +9,7 @@ L.Layer.CanvasMarkers.include({ latlng: {lat: marker.latlng.lat, lng: marker.latlng.lng}, label: marker.label, icon: marker.icon - } + }; }, cloneMarkers: function() { @@ -63,7 +63,7 @@ L.Layer.CanvasMarkers.include({ ), abortLoading: () => { } - } + }; }).bind(this), count: 1 }; diff --git a/src/lib/leaflet.layer.rasterize/MeasuredLine.js b/src/lib/leaflet.layer.rasterize/MeasuredLine.js @@ -20,7 +20,7 @@ L.Polyline.include({ .subtract(origin) .add(L.point([shift, 0])) .unscaleBy(scale); - } + }; }, _shift: function(targetBounds, zoom) { @@ -32,7 +32,7 @@ L.Polyline.include({ const targetCenter = targetBounds.getCenter(); if (polylineCenter.lng < targetCenter.lng - 180) { - shift = 1 + shift = 1; } else if (polylineCenter.lng > targetCenter.lng + 180) { shift = -1; } else { @@ -88,7 +88,7 @@ L.Polyline.include({ ), abortLoading: () => { } - } + }; }).bind(this), count: 1 }; diff --git a/src/lib/leaflet.layer.rasterize/TileLayer.js b/src/lib/leaflet.layer.rasterize/TileLayer.js @@ -71,7 +71,7 @@ const TileLayerGrabMixin = L.Util.extend({}, GridLayerGrabMixin, { return { tilePromise: printOptions.rawData ? promise : promise.then(imgFromDataString), abortLoading: () => promise.abort() - } + }; } } ); @@ -99,7 +99,7 @@ const CanvasLayerGrabMixin = L.Util.extend({}, GridLayerGrabMixin, { return { tilePromise: tilePromise.then(this.getCanvasFromTile), abortLoading: noop - } + }; } }); diff --git a/src/lib/leaflet.layer.rasterize/WestraPasses.js b/src/lib/leaflet.layer.rasterize/WestraPasses.js @@ -1,7 +1,7 @@ import L from "leaflet"; import '~/lib/leaflet.layer.westraPasses'; import {WestraPassesMarkers} from '~/lib/leaflet.layer.westraPasses/westraPassesMarkers'; -import '~/lib/leaflet.layer.canvasMarkers' +import '~/lib/leaflet.layer.canvasMarkers'; import './CanvasMarkers'; L.Layer.WestraPasses.addInitHook(function() { @@ -12,7 +12,7 @@ L.Layer.WestraPasses.addInitHook(function() { WestraPassesMarkers.include({ waitDataReady: function() { if (this._dataLoaded) { - return Promise.resolve() + return Promise.resolve(); } return new Promise((resolve) => { this.on('data-loaded', resolve); diff --git a/src/lib/leaflet.layer.rasterize/imgFromDataString.js b/src/lib/leaflet.layer.rasterize/imgFromDataString.js @@ -10,7 +10,7 @@ function imgFromDataString(xhr) { image.onerror = () => { reject(new Error('Image corrupt')); window.URL.revokeObjectURL(blobUrl); - } + }; } ); image.src = blobUrl; @@ -20,4 +20,4 @@ function imgFromDataString(xhr) { } } -export {imgFromDataString} +export {imgFromDataString}; diff --git a/src/lib/leaflet.layer.rasterize/index.js b/src/lib/leaflet.layer.rasterize/index.js @@ -1,11 +1,11 @@ import L from 'leaflet'; -import './TileLayer' -import './Bing' -import './Yandex' -import './Google' -import './WestraPasses' -import './CanvasMarkers' -import './MeasuredLine' +import './TileLayer'; +import './Bing'; +import './Yandex'; +import './Google'; +import './WestraPasses'; +import './CanvasMarkers'; +import './MeasuredLine'; function getTempMap(zoom, fullSize, pixelBounds) { const container = L.DomUtil.create('div', '', document.body); @@ -44,4 +44,4 @@ function disposeMap(map) { } -export {getTempMap, disposeMap} -\ No newline at end of file +export {getTempMap, disposeMap}; +\ No newline at end of file diff --git a/src/lib/leaflet.layer.soviet-topomaps-grid/index.js b/src/lib/leaflet.layer.soviet-topomaps-grid/index.js @@ -56,7 +56,7 @@ var Nomenclature = { const names = [name1 + name2]; for (let replacer of bigLetterReplacers) { let name3 = name2.replace(/\b[1-4]\b/g, (s) => { - return replacer[s] + return replacer[s]; } ); names.push(name1 + name3); @@ -94,7 +94,7 @@ var Nomenclature = { const names = [name1 + name2]; for (let replacer of bigLetterReplacers) { let name3 = name2.replace(/\b[1-4]\b/g, (s) => { - return replacer[s] + return replacer[s]; } ); names.push(name1 + name3); @@ -224,20 +224,20 @@ L.Layer.SovietTopoGrid = L.LayerGroup.extend({ {'text': 'Click name to copy to clibpoard', header: true}, { 'text': titles[0], callback: () => { - copyToClipboard(titles[0], e.originalEvent) + copyToClipboard(titles[0], e.originalEvent); } } ]; if (titles.length > 1) { items.push({ 'text': titles[1] + ' <span class="leaflet-sovietgrid-lang">RUS</span>', callback: () => { - copyToClipboard(titles[1], e.originalEvent) + copyToClipboard(titles[1], e.originalEvent); } } ); items.push({ 'text': titles[2] + ' <span class="leaflet-sovietgrid-lang">LAT</span>', callback: () => { - copyToClipboard(titles[2], e.originalEvent) + copyToClipboard(titles[2], e.originalEvent); } } ); diff --git a/src/lib/leaflet.layer.westraPasses/westraPassesMarkers.js b/src/lib/leaflet.layer.westraPasses/westraPassesMarkers.js @@ -1,5 +1,5 @@ import L from 'leaflet'; -import '~/lib/leaflet.layer.canvasMarkers' +import '~/lib/leaflet.layer.canvasMarkers'; import {openPopupWindow} from '~/lib/popup-window'; import escapeHtml from 'escape-html'; import {saveAs} from '~/vendored/github.com/eligrey/FileSaver'; @@ -53,7 +53,7 @@ const WestraPassesMarkers = L.Layer.CanvasMarkers.extend({ var properties = marker.properties, toolTip = properties.grade || ''; if (toolTip && properties.elevation) { - toolTip += ', ' + toolTip += ', '; } toolTip += properties.elevation || ''; if (toolTip) { @@ -167,7 +167,7 @@ const WestraPassesMarkers = L.Layer.CanvasMarkers.extend({ for (let comment of properties.comments) { let user = ''; if (comment.user) { - user = `<span class="westra-passes-description-comment-author">${comment.user}:</span>` + user = `<span class="westra-passes-description-comment-author">${comment.user}:</span>`; } comments += `<p class="westra-passes-description-comment">${user}${comment.content}</p>`; } @@ -175,13 +175,13 @@ const WestraPassesMarkers = L.Layer.CanvasMarkers.extend({ <tr> <td>Комментарии</td> <td>${comments}</td> - </tr>` + </tr>`; } let reports; if (properties.reports_total) { reports = `<br>Отчетов: ${properties.reports_total}, с фото: ${properties.reports_photo || 0}, с описанием: ${properties.reports_tech || 0}`; } else { - reports = '<br>Отчетов нет' + reports = '<br>Отчетов нет'; } let description = ` <table class="pass-details"> diff --git a/src/lib/leaflet.layer.wikimapia/index.js b/src/lib/leaflet.layer.wikimapia/index.js @@ -109,7 +109,7 @@ L.Wikimapia = L.GridLayer.extend({ canvas._tileData = data.tileData; canvas._adjustment = data.adjustment; this.drawTile(canvas); - this._tileOnLoad(done, canvas) + this._tileOnLoad(done, canvas); } ); diff --git a/src/lib/leaflet.layer.wikimapia/wikimapia-loader.js b/src/lib/leaflet.layer.wikimapia/wikimapia-loader.js @@ -1,5 +1,5 @@ import {TiledDataLoader} from '~/lib/tiled-data-loader'; -import wmUtils from './wm-utils' +import wmUtils from './wm-utils'; import urlViaCorsProxy from '~/lib/CORSProxy'; class WikimapiaLoader extends TiledDataLoader { @@ -43,7 +43,7 @@ class WikimapiaLoader extends TiledDataLoader { x: Math.floor(layerTileCoords.x / multiplier), y: Math.floor(layerTileCoords.y / multiplier), z: z2 - } + }; } else if (z < this.minZoom) { let z2 = this.minZoom, @@ -52,10 +52,10 @@ class WikimapiaLoader extends TiledDataLoader { x: Math.floor(layerTileCoords.x / multiplier), y: Math.floor(layerTileCoords.y / multiplier), z: z2 - } + }; } else { - return {z, x: layerTileCoords.x, y: layerTileCoords.y} + return {z, x: layerTileCoords.x, y: layerTileCoords.y}; } } @@ -65,7 +65,7 @@ class WikimapiaLoader extends TiledDataLoader { return { url, options: {timeout: 20000} - } + }; } processResponse(xhr) { @@ -74,7 +74,7 @@ class WikimapiaLoader extends TiledDataLoader { return { tileData, coords: tileData.coords - } + }; } ); diff --git a/src/lib/leaflet.layer.wikimapia/wm-utils.js b/src/lib/leaflet.layer.wikimapia/wm-utils.js @@ -142,7 +142,7 @@ function simplifyPolygon(latlngs, tileCoords, tileHasChildren, projectObj) { let p = points[i]; latlngs.push([p.x, p.y]); } - return latlngs + return latlngs; } async function parseTile(s, projectObj) { @@ -190,7 +190,7 @@ async function parseTile(s, projectObj) { throw new Error('Invalid place bounds'); } place.boundsWESN = bounds.slice(1).map((x) => { - return parseInt(x, 10) / 1e7 + return parseInt(x, 10) / 1e7; } ); @@ -264,4 +264,4 @@ async function parseTile(s, projectObj) { // } // }, -export default {getTileId, getWikimapiaTileCoords, parseTile, makeTileUrl} -\ No newline at end of file +export default {getTileId, getWikimapiaTileCoords, parseTile, makeTileUrl}; +\ No newline at end of file diff --git a/src/lib/leaflet.layer.yandex/index.js b/src/lib/leaflet.layer.yandex/index.js @@ -1,4 +1,4 @@ -import L from 'leaflet' +import L from 'leaflet'; import './style.css'; const yandexCrs = L.CRS.EPSG3395; @@ -40,7 +40,7 @@ L.Layer.Yandex = L.TileLayer.extend({ const coordsBelow = L.point(coords).add([0, 1]); coordsBelow.z = coords.z; tile._adjustHeight = this._getTilePos(coordsBelow).y - this._getTilePos(coords).y; - return tile + return tile; }, _initTile: function(tile) { diff --git a/src/lib/leaflet.polyline-edit/index.js b/src/lib/leaflet.polyline-edit/index.js @@ -282,9 +282,9 @@ L.Polyline.EditMixin = { const midPoint = L.latLngBounds(latlngs[nodeIndex], latlngs[nodeIndex - 1]).getCenter(); this.addNode(nodeIndex, wrapLatLngToTarget(e.latlng, midPoint)); if (L.Draggable._dragging) { - L.Draggable._dragging.finishDrag() + L.Draggable._dragging.finishDrag(); } - latlngs[nodeIndex]._nodeMarker.dragging._draggable._onDown(e.originalEvent) + latlngs[nodeIndex]._nodeMarker.dragging._draggable._onDown(e.originalEvent); this.fire('nodeschanged'); }, diff --git a/src/lib/logging/index.js b/src/lib/logging/index.js @@ -8,12 +8,12 @@ const sessionId = randId(); function captureException(e, options) { console.log('captureException', e, options); - Raven.captureException(e, options) + Raven.captureException(e, options); } function captureMessage(msg, options) { console.log('captureMessage', msg, options); - Raven.captureMessage(msg, options) + Raven.captureMessage(msg, options); } function captureMessageWithUrl(msg) { @@ -21,11 +21,11 @@ function captureMessageWithUrl(msg) { } function setExtraContext(data) { - Raven.setExtraContext(data) + Raven.setExtraContext(data); } function captureBreadcrumb(crumb) { - Raven.captureBreadcrumb(crumb) + Raven.captureBreadcrumb(crumb); } function captureBreadcrumbWithUrl(crumb) { @@ -58,4 +58,4 @@ function logEvent(eventName, extra) { export default {captureMessage, captureException, setExtraContext, captureBreadcrumbWithUrl, captureBreadcrumb, - captureMessageWithUrl, logEvent, randId} -\ No newline at end of file + captureMessageWithUrl, logEvent, randId}; +\ No newline at end of file diff --git a/src/lib/magnetic-declination/index.js b/src/lib/magnetic-declination/index.js @@ -57,4 +57,4 @@ function getDeclination(lat, lon) { data = loadData(); -export {getDeclination} -\ No newline at end of file +export {getDeclination}; +\ No newline at end of file diff --git a/src/lib/safe-localstorage/index.js b/src/lib/safe-localstorage/index.js @@ -36,7 +36,7 @@ if (localStorageWorks()) { clear: function() { _storage = {}; } - } + }; } export default storage; \ No newline at end of file diff --git a/src/lib/tiled-data-loader/index.js b/src/lib/tiled-data-loader/index.js @@ -48,14 +48,14 @@ class TiledDataLoader { } if (dataTileCoords.z > layerTileCoords.z) { const multiplier = 1 << (dataTileCoords.z - layerTileCoords.z); - return {multiplier: 1 / multiplier, offsetX: 0, offsetY: 0} + return {multiplier: 1 / multiplier, offsetX: 0, offsetY: 0}; } else { const multiplier = 1 << (layerTileCoords.z - dataTileCoords.z); return { multiplier, offsetX: (layerTileCoords.x - dataTileCoords.x * multiplier), offsetY: (layerTileCoords.y - dataTileCoords.y * multiplier) - } + }; } } @@ -72,7 +72,7 @@ class TiledDataLoader { ), abortLoading: () => { } - } + }; } const dataTileKey = this.makeTileKey(dataTileCoords); @@ -118,7 +118,7 @@ class TiledDataLoader { } ), abortLoading: () => pendingRequest.abortLoading() - } + }; } } diff --git a/src/lib/xhr-promise/index.js b/src/lib/xhr-promise/index.js @@ -153,7 +153,7 @@ class XHRQueue { .catch(() => {}) .then(() => this._onRequestReady(promise)); this._activeCount += 1; - promise.send() + promise.send(); } _onRequestReady(promise) { diff --git a/src/vendored/.eslintrc b/src/vendored/.eslintrc @@ -0,0 +1,5 @@ +{ + "rules": { + "semi": "off" + } +} +\ No newline at end of file