Skip to content

Commit

Permalink
upd semantic
Browse files Browse the repository at this point in the history
Now semantic printed to console
  • Loading branch information
GeorgGrebenyuk committed May 19, 2024
1 parent a33cdcc commit 851753d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
8 changes: 3 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,7 @@

if (osm_feature.TreeJS_Id == INTERSECTED.id)
{
console.log("show semantic");
console.log(osm_feature.Attributes);
console.log(osm_feature.Properties);
osm_loader_handler.PrintSemantic(osm_feature);
}
}
//other
Expand Down Expand Up @@ -276,7 +274,7 @@
}
zoomCameraToSelection(camera, controls, scene.children);
render();
console.log("End!");
console.log("End reading!");
};

var Clear = function () {
Expand All @@ -297,7 +295,7 @@
context1.font = "Bold 25px Arial";
context1.fillStyle = "rgba(150,150,150,1)";
context1.fillText('Move here ', 0, 80);
context1.fillText('yoyr OSM file...', 0, 104);
context1.fillText('your OSM file...', 0, 104);

// canvas contents will be used for a texture
var texture1 = new THREE.Texture(canvas1)
Expand Down
21 changes: 21 additions & 0 deletions js/osm_viewer.three.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,4 +416,25 @@ class OSM_Processing{
}
return null;
}

/**
* Print to browser's console info about ojects's attributes and tags
* @param {*} OSM_Feature_item
*/
PrintSemantic(OSM_Feature_item){
console.clear();
console.log('\n'.repeat('25'));
console.log("Semantic info:");
console.log("Own attributes:");
for (const [key, value] of Object.entries(OSM_Feature_item.Attributes))
{
console.log(key + " : " + value);
}
console.log("Own tags:");
for (const [key, value] of Object.entries(OSM_Feature_item.Properties))
{
console.log(key + " : " + value);
}

}
}

0 comments on commit 851753d

Please sign in to comment.