From bb51abe620318250c8d32bf514bf0ef065c70c3b Mon Sep 17 00:00:00 2001 From: ctrlw Date: Tue, 29 Oct 2024 17:10:12 +0100 Subject: [PATCH] feat: disable logging messages They are sometimes noisy and may distract in production, apparently enough to cause a downstream change: https://github.com/3DStreet/osm4vr/commit/65b74bf5d2f3ce00748bcad33d61af443c56f8f6 Keeping them in the code to easily enable when needed. Kept the one in logFeature(), as you have to explicitly call logFeatures() to hit it --- osm-geojson.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/osm-geojson.js b/osm-geojson.js index 1b2ac82..5d3dd53 100644 --- a/osm-geojson.js +++ b/osm-geojson.js @@ -193,7 +193,7 @@ AFRAME.registerComponent('osm-geojson', { } lat /= count; lon /= count; - console.log("Geojson center (lat, lon): ", lat, lon); + // console.log("Geojson center (lat, lon): ", lat, lon); return [lat, lon]; }, @@ -220,7 +220,7 @@ AFRAME.registerComponent('osm-geojson', { ); if (response.ok) { let data = await response.json(); - console.log(data); + // console.log(data); return data; } }, @@ -231,7 +231,7 @@ AFRAME.registerComponent('osm-geojson', { // result is a Vector2 array of positions in meters on the plane geojsonCoords2plane: function(coords, baseLat, baseLon) { if (coords.length == 1 && coords[0].length > 2) { - console.log(coords); + // console.log(coords); coords = coords[0]; } let circumference_m = this.EQUATOR_M * Math.cos(baseLat * Math.PI / 180); @@ -439,7 +439,7 @@ AFRAME.registerComponent('osm-geojson', { } } else { if (!this.featuresLoaded[feature.id] && geometry.type != 'Point') { - console.log(feature); + // console.log(feature); } ignored += 1; } @@ -449,7 +449,7 @@ AFRAME.registerComponent('osm-geojson', { // Generally, parts are contained in the building's footprint // If parts are outside, a relation should be used // If a part is on top of a building, both are kept - console.log('Checking building parts'); + // console.log('Checking building parts'); let baseBuildingIds = new Set(); // feature ids of buildings that have building parts let skippedBuildingIds = new Set(); // feature ids of buildings that are fully replaced by parts let baseBuildings2parts = {}; // map building id to part ids @@ -509,7 +509,7 @@ AFRAME.registerComponent('osm-geojson', { let start = performance.now(); let featureIds = this.filterBuildingParts(geojson.features, this.featuresLoaded, this.data.lat, this.data.lon); let end = performance.now(); - console.log("Processed", geojson.features.length, "features in", end - start, "ms"); + // console.log("Processed", geojson.features.length, "features in", end - start, "ms"); start = end; // @@ -552,7 +552,7 @@ AFRAME.registerComponent('osm-geojson', { // merge all geometries and add them as one entity to the scene let geometry = THREE.BufferGeometryUtils.mergeBufferGeometries(geometries, false); - let material = new THREE.MeshStandardMaterial({vertexColors: true}); //THREE.FaceColors}); + let material = new THREE.MeshStandardMaterial({vertexColors: true}); let mesh = new THREE.Mesh(geometry, material); let entity = document.createElement('a-entity'); entity.setObject3D('mesh', mesh); @@ -561,9 +561,9 @@ AFRAME.registerComponent('osm-geojson', { // this.el.appendChild(parent); end = performance.now(); - console.log("Added", count, "buildings in", end - start, "ms"); + // console.log("Added", count, "buildings in", end - start, "ms"); - console.log("Loaded", count, "buildings, ignored", ignored, ", skipped", skipped); + // console.log("Loaded", count, "buildings, ignored", ignored, ", skipped", skipped); }, // Check if all tiles within the default radius around the given position are fully loaded @@ -607,7 +607,7 @@ AFRAME.registerComponent('osm-geojson', { } if (bboxSWNE.length > 0) { - console.log("Bounding box for missing tiles (SWNE): ", bboxSWNE); + // console.log("Bounding box for missing tiles (SWNE): ", bboxSWNE); this.loadOSMbuildingsBbox(bboxSWNE).then((json) => { let geojson = osmtogeojson(json); this.addBuildings(geojson);