From c975752e9f0a2b0abfb3d714bec12879579e2a95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Duhen?= <45125768+HoloTheDrunk@users.noreply.github.com> Date: Tue, 17 Dec 2024 17:31:47 +0100 Subject: [PATCH] chore: remove istanbul and editor comments (#2479) --- src/Controls/GlobeControls.js | 8 ++++---- src/Converter/convertToTile.js | 5 ----- src/Core/Deprecated/Undeprecator.js | 1 - src/Core/Prefab/Globe/Atmosphere.js | 7 ------- src/Layer/OrientedImageLayer.js | 13 ++++++------- src/Renderer/SphereHelper.js | 7 ------- src/Source/FileSource.js | 2 -- src/Source/Source.js | 4 +--- src/Source/VectorTilesSource.js | 1 - src/Utils/placeObjectOnGround.js | 1 - 10 files changed, 11 insertions(+), 38 deletions(-) diff --git a/src/Controls/GlobeControls.js b/src/Controls/GlobeControls.js index 12f021b49f..76b5901a2a 100644 --- a/src/Controls/GlobeControls.js +++ b/src/Controls/GlobeControls.js @@ -1083,7 +1083,7 @@ class GlobeControls extends THREE.EventDispatcher { * * @deprecated Use View#getScale instead. */ - getScale(pitch) /* istanbul ignore next */ { + getScale(pitch) { console.warn('Deprecated, use View#getScale instead.'); return this.view.getScale(pitch); } @@ -1096,7 +1096,7 @@ class GlobeControls extends THREE.EventDispatcher { * * @deprecated Use `View#getPixelsToMeters` instead. */ - pixelsToMeters(pixels, pixelPitch = 0.28) /* istanbul ignore next */ { + pixelsToMeters(pixels, pixelPitch = 0.28) { console.warn('Deprecated use View#getPixelsToMeters instead.'); const scaled = this.getScale(pixelPitch); const size = pixels * pixelPitch; @@ -1112,7 +1112,7 @@ class GlobeControls extends THREE.EventDispatcher { * @deprecated Use `View#getPixelsToMeters` and `GlobeControls#metersToDegrees` * instead. */ - pixelsToDegrees(pixels, pixelPitch = 0.28) /* istanbul ignore next */ { + pixelsToDegrees(pixels, pixelPitch = 0.28) { console.warn('Deprecated, use View#getPixelsToMeters and GlobeControls#getMetersToDegrees instead.'); const chord = this.pixelsToMeters(pixels, pixelPitch); return THREE.MathUtils.radToDeg(2 * Math.asin(chord / (2 * ellipsoidSizes.x))); @@ -1126,7 +1126,7 @@ class GlobeControls extends THREE.EventDispatcher { * * @deprecated Use `View#getMetersToPixels` instead. */ - metersToPixels(value, pixelPitch = 0.28) /* istanbul ignore next */ { + metersToPixels(value, pixelPitch = 0.28) { console.warn('Deprecated, use View#getMetersToPixels instead.'); const scaled = this.getScale(pixelPitch); pixelPitch /= 1000; diff --git a/src/Converter/convertToTile.js b/src/Converter/convertToTile.js index 56fd6420a6..6028fed174 100644 --- a/src/Converter/convertToTile.js +++ b/src/Converter/convertToTile.js @@ -1,8 +1,3 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ import * as THREE from 'three'; import TileMesh from 'Core/TileMesh'; import LayeredMaterial from 'Renderer/LayeredMaterial'; diff --git a/src/Core/Deprecated/Undeprecator.js b/src/Core/Deprecated/Undeprecator.js index 33a36804dd..5ad371a9c6 100644 --- a/src/Core/Deprecated/Undeprecator.js +++ b/src/Core/Deprecated/Undeprecator.js @@ -15,7 +15,6 @@ export const deprecatedColorLayerOptions = (options) => { }; export const deprecatedParsingOptionsToNewOne = (options) => { - /* istanbul ignore next */ if (options.crsOut || options.crsIn) { console.warn('Parsing options with crsIn and crsOut are deprecated, use { in, out } structure.'); const newOptions = { in: {}, out: {} }; diff --git a/src/Core/Prefab/Globe/Atmosphere.js b/src/Core/Prefab/Globe/Atmosphere.js index f5df486ec1..6da14081ee 100644 --- a/src/Core/Prefab/Globe/Atmosphere.js +++ b/src/Core/Prefab/Globe/Atmosphere.js @@ -1,10 +1,3 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ - - import * as THREE from 'three'; import GeometryLayer from 'Layer/GeometryLayer'; import Coordinates from 'Core/Geographic/Coordinates'; diff --git a/src/Layer/OrientedImageLayer.js b/src/Layer/OrientedImageLayer.js index 39a5229e49..1327886d68 100644 --- a/src/Layer/OrientedImageLayer.js +++ b/src/Layer/OrientedImageLayer.js @@ -28,7 +28,7 @@ function updatePano(context, camera, layer) { const imagesInfo = layer.cameras.map(cam => ({ cameraId: cam.name, panoId: newPano.id, - as: () => {}, + as: () => { }, })).filter(info => !panoCameras || panoCameras.includes(info.cameraId)); const command = { @@ -48,7 +48,7 @@ function updatePano(context, camera, layer) { layer.material.updateUniforms(context.camera.camera3D); context.view.notifyChange(layer, true); } - }, () => {}); + }, () => { }); } } @@ -103,12 +103,11 @@ class OrientedImageLayer extends GeometryLayer { const { backgroundDistance, background = createBackground(backgroundDistance), - onPanoChanged = () => {}, - getCamerasNameFromFeature = () => {}, + onPanoChanged = () => { }, + getCamerasNameFromFeature = () => { }, ...geometryOptions } = config; - /* istanbul ignore next */ if (config.projection) { console.warn('OrientedImageLayer projection parameter is deprecated, use crs instead.'); config.crs = config.crs || config.projection; @@ -144,7 +143,7 @@ class OrientedImageLayer extends GeometryLayer { // panos is an array of feature point, representing many panoramics. // for each point, there is a position and a quaternion attribute. - this.source.whenReady.then(metadata => GeoJsonParser.parse(config.orientation || metadata.orientation, options).then((orientation) => { + this.source.whenReady.then(metadata => GeoJsonParser.parse(config.orientation || metadata.orientation, options).then((orientation) => { this.panos = orientation.features; // the crs input is parsed in geojson parser @@ -171,7 +170,7 @@ class OrientedImageLayer extends GeometryLayer { } }).then(() => { // array of cameras, represent the projective texture configuration for each panoramic. - CameraCalibrationParser.parse(config.calibration || metadata.calibration, config).then((cameras) => { + CameraCalibrationParser.parse(config.calibration || metadata.calibration, config).then((cameras) => { this.cameras = cameras; // create the material this.material = new OrientedImageMaterial(this.cameras, config); diff --git a/src/Renderer/SphereHelper.js b/src/Renderer/SphereHelper.js index 887b0982d5..d291f9c907 100644 --- a/src/Renderer/SphereHelper.js +++ b/src/Renderer/SphereHelper.js @@ -1,10 +1,3 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ - - import * as THREE from 'three'; function SphereHelper(radius) { diff --git a/src/Source/FileSource.js b/src/Source/FileSource.js index a65ce63271..b10538b06e 100644 --- a/src/Source/FileSource.js +++ b/src/Source/FileSource.js @@ -103,12 +103,10 @@ class FileSource extends Source { * presents in `features` under the property `crs`, it is fine. */ constructor(source) { - /* istanbul ignore next */ if (source.parsedData) { console.warn('FileSource parsedData parameter is deprecated, use features instead of.'); source.features = source.features || source.parsedData; } - /* istanbul ignore next */ if (source.projection) { console.warn('FileSource projection parameter is deprecated, use crs instead.'); source.crs = source.crs || source.projection; diff --git a/src/Source/Source.js b/src/Source/Source.js index 491e2de0c6..11c54b5f20 100644 --- a/src/Source/Source.js +++ b/src/Source/Source.js @@ -22,7 +22,7 @@ export const supportedParsers = new Map([ ['application/gdf', GDFParser.parse], ]); -const noCache = { getByArray: () => {}, setByArray: a => a, clear: () => {} }; +const noCache = { getByArray: () => { }, setByArray: a => a, clear: () => { } }; /** * @property {string} crs - data crs projection. @@ -36,7 +36,6 @@ const noCache = { getByArray: () => {}, setByArray: a => a, clear: () => {} }; */ class InformationsData { constructor(options) { - /* istanbul ignore next */ if (options.projection) { console.warn('Source projection parameter is deprecated, use crs instead.'); options.crs = options.crs || options.projection; @@ -174,7 +173,6 @@ class Source extends InformationsData { .catch(err => this.handlingError(err)), key); - /* istanbul ignore next */ if (this.onParsedFile) { features.then((feat) => { this.onParsedFile(feat); diff --git a/src/Source/VectorTilesSource.js b/src/Source/VectorTilesSource.js index d0f4fd4241..ed5b9562ed 100644 --- a/src/Source/VectorTilesSource.js +++ b/src/Source/VectorTilesSource.js @@ -171,7 +171,6 @@ class VectorTilesSource extends TMSSource { .catch(err => this.handlingError(err)), key); - /* istanbul ignore next */ if (this.onParsedFile) { features.then((feat) => { this.onParsedFile(feat); diff --git a/src/Utils/placeObjectOnGround.js b/src/Utils/placeObjectOnGround.js index 887d183cb0..e6e9e5ede8 100644 --- a/src/Utils/placeObjectOnGround.js +++ b/src/Utils/placeObjectOnGround.js @@ -51,7 +51,6 @@ function _updateVector3(layer, method, nodes, vecCRS, vec, offset, matrices = {} * * @return {boolean} true if successful, false if we couldn't lookup the elevation at the given coords */ -/* istanbul ignore next */ function placeObjectOnGround(layer, crs, obj, options = {}, tileHint) { console.warn('placeObjectOnGround has been deprecated because it needs review and test'); let tiles;