Home > Mobile >  potree point cloud viewer shows blank page
potree point cloud viewer shows blank page

Time:09-30

I'm trying to get potree viewer to display one of the example html files in the potree npm library. I'm using npm version 8.19.2 and according to the package.json file, the potree version that I installed, using 'npm install potree', is '0.1.0' (though I see that the latest version on github is 1.8?) To test if the installation works, I've been using node express (called using 'node app.js'). The express server seem to work as it should. It finds the html file, and displays it, but the page is blank. The tab says 'Potree Viewer' though, so apparently it's able to launch the viewer but not much more than that. Have anybody else encountered this problem, or is it only me? I've tried to un-install and install again, but to no luck.

My 'app.js' file looks like this:

const express = require('express');
const app = express();
const path = require('path');
const router = express.Router();
router.get('/',function(req,res){
  res.sendFile(path.join(__dirname '/node_modules/potree/examples/shapefiles.html'));
});
 
app.use('/', router);
app.listen(process.env.port || 1234);
console.log('Running at Port 1234');

CodePudding user response:

Just adding some more information to this issue, which I have still not managed to solve. It seem to me that it is this line:

import * as THREE from "../libs/three.js/build/three.module.js";

in the script part of the html file in the potree examples folder that crashes the execution. Because if I comment out everyting after that line and until the tag, as well as adding an alert on the line before that line, like this:

    <script type="module">
    alert("ok");
    import * as THREE from "../libs/three.js/build/three.module.js";
    /*
    ...
    */
    </script>

, the alert will not popup. However, if I also comment out the '... THREE ...' import line, like this:

    <script type="module">
    alert("ok");
    /*
    import * as THREE from "../libs/three.js/build/three.module.js";
    ...
    */
    </script>

, the alert will now popup. That "../libs/three.js/build/three.module.js" file exists though.

This is the console output when I run the web server from my Visual Studio Flask project (and this used to work 6 months ago):

Serving Flask app 'MyPotreeTest' (lazy loading)
Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
Debug mode: off
Running on http://localhost:1234/ (Press CTRL C to quit)
127.0.0.1 - - [28/Sep/2022 17:26:37] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:37] "GET /static/css/s2_bstreeview.min.css HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:37] "GET /static/scripts/modernizr-2.6.2.js HTTP/1.1" 404 -
127.0.0.1 - - [28/Sep/2022 17:26:37] "GET /static/scripts/s2_bstreeview.min.js HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:38] "GET /static/Ico/favicon.ico HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:43] "GET /login HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:43] "GET /static/scripts/modernizr-2.6.2.js HTTP/1.1" 404 -
127.0.0.1 - - [28/Sep/2022 17:26:52] "POST /login HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:52] "GET /static/scripts/modernizr-2.6.2.js HTTP/1.1" 404 -
127.0.0.1 - - [28/Sep/2022 17:26:54] "GET /td_viewer/ HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:54] "GET /static/css/s2_bstreeview.min.css HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:54] "GET /static/scripts/s2_bstreeview.min.js HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:54] "GET /static/scripts/modernizr-2.6.2.js HTTP/1.1" 404 -
127.0.0.1 - - [28/Sep/2022 17:26:55] "GET /static//Potree/examples/geopackage.html HTTP/1.1" 308 -
127.0.0.1 - - [28/Sep/2022 17:26:55] "GET /static/Potree/examples/geopackage.html HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:55] "GET /static/Potree/build/potree/potree.css HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:55] "GET /static/Potree/libs/jquery-ui/jquery-ui.min.css HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:55] "GET /static/Potree/libs/openlayers3/ol.css HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:55] "GET /static/Potree/libs/spectrum/spectrum.css HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:55] "GET /static/Potree/libs/jstree/themes/mixed/style.css HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:55] "GET /static/Potree/libs/jquery/jquery-3.1.1.min.js HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:55] "GET /static/Potree/libs/spectrum/spectrum.js HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:56] "GET /static/Potree/libs/jquery-ui/jquery-ui.min.js HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:56] "GET /static/Potree/libs/other/BinaryHeap.js HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:56] "GET /static/Potree/libs/tween/tween.min.js HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:56] "GET /static/Potree/libs/d3/d3.js HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:56] "GET /static/Potree/libs/proj4/proj4.js HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:56] "GET /static/Potree/libs/openlayers3/ol.js HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:56] "GET /static/Potree/libs/i18next/i18next.js HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:56] "GET /static/Potree/libs/jstree/jstree.js HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:56] "GET /static/Potree/build/potree/potree.js HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:56] "GET /static/Potree/libs/plasio/js/laslaz.js HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:56] "GET /static/Potree/libs/three.js/build/three.module.js HTTP/1.1" 200 -
127.0.0.1 - - [28/Sep/2022 17:26:56] "GET /static/Potree/build/potree/resources/images/background.jpg HTTP/1.1" 200 -

Any help would be greatly appreciated. I have tried to just download and copy version 1.8 to my web server as I did last time I had it running, 6 months ago, as well as the debug version, and I've also tried to install it with node and npm as described on the 'https://github.com/potree/potree' page but that does not change anything either.

I'm sure it must be some dead simple setting or library version issue, though I've tried with the exact same files as last time. I simply don't manage to figure out why it do not run.

CodePudding user response:

For anybody encountering the same issue, simply copying the potree version to the web server and display the html files in the example folder, without building it in node first, do not work for potree version 1.8, while it does work in potree version 1.7.1.

  • Related