Skip to content

Commit

Permalink
feat: disable logging messages
Browse files Browse the repository at this point in the history
They are sometimes noisy and may distract in production, apparently enough to cause a downstream change:
3DStreet@65b74bf

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
  • Loading branch information
ctrlw committed Oct 29, 2024
1 parent a90f6e1 commit bb51abe
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions osm-geojson.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
},

Expand All @@ -220,7 +220,7 @@ AFRAME.registerComponent('osm-geojson', {
);
if (response.ok) {
let data = await response.json();
console.log(data);
// console.log(data);
return data;
}
},
Expand All @@ -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);
Expand Down Expand Up @@ -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;
}
Expand All @@ -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
Expand Down Expand Up @@ -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;

// <a-entity geometry-merger="preserveOriginal: false" material="color: #AAA">
Expand Down Expand Up @@ -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);
Expand All @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit bb51abe

Please sign in to comment.