load json5 project files

This commit is contained in:
Markus Schütz 2022-06-16 17:44:54 +02:00
parent f39174f910
commit f084eac44e

View File

@ -1349,14 +1349,14 @@ export class Viewer extends EventDispatcher{
const file = item.getAsFile(); const file = item.getAsFile();
const isJson = file.name.toLowerCase().endsWith(".json"); const isJson5 = file.name.toLowerCase().endsWith(".json5");
const isGeoPackage = file.name.toLowerCase().endsWith(".gpkg"); const isGeoPackage = file.name.toLowerCase().endsWith(".gpkg");
if(isJson){ if(isJson5){
try{ try{
const text = await file.text(); const text = await file.text();
const json = JSON.parse(text); const json = JSON5.parse(text);
if(json.type === "Potree"){ if(json.type === "Potree"){
Potree.loadProject(viewer, json); Potree.loadProject(viewer, json);