【问题标题】:potree point cloud viewer shows blank pagepotree 点云查看器显示空白页
【发布时间】:2023-01-22 20:36:59
【问题描述】:

我试图让 potree 查看器显示 potree npm 库中的示例 html 文件之一。 我使用的是 npm 版本 8.19.2,根据 package.json 文件,我使用“npm install potree”安装的 potree 版本是“0.1.0”(尽管我看到 github 上的最新版本是 1.8 ?) 为了测试安装是否有效,我一直在使用 node express(使用“node app.js”调用)。快递服务器似乎正常工作。它找到 html 文件并显示它,但页面是空白的。虽然该选项卡显示为“Potree Viewer”,但显然它能够启动查看器,但仅此而已。有没有其他人遇到过这个问题,还是只有我遇到过?我试过卸载并重新安装,但没有成功。

我的“app.js”文件如下所示:

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');

【问题讨论】:

    标签: node.js npm


    【解决方案1】:

    只是为这个问题添加了更多信息,我仍然没有设法解决。在我看来,这是这一行:

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

    在导致执行崩溃的 potree 示例文件夹中的 html 文件的脚本部分。因为如果我注释掉该行之后直到标记之前的所有内容,并在该行之前的行中添加一个警告,如下所示:

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

    ,将不会弹出警报。但是,如果我也注释掉 '... TREE ...' 导入行,如下所示:

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

    ,现在将弹出警报。那个“../libs/three.js/build/three.module.js”文件虽然存在。

    这是我从我的 Visual Studio Flask 项目运行 Web 服务器时的控制台输出(这在 6 个月前工作过):

    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 -
    

    任何帮助将不胜感激。我尝试像 6 个月前上次运行它时那样,将 1.8 版以及调试版本下载并复制到我的 Web 服务器,我还尝试使用 node 和 npm 安装它,如所述在“https://github.com/potree/potree”页面上,但这也没有任何改变。

    我确定这一定是一些非常简单的设置或库版本问题,尽管我已经尝试使用与上次完全相同的文件。我根本无法弄清楚为什么它不运行。

    【讨论】:

      【解决方案2】:

      对于遇到相同问题的任何人,只需将 potree 版本复制到 Web 服务器并显示示例文件夹中的 html 文件,而不首先在节点中构建它,不适用于 potree 1.8 版,而它适用于 potree 1.7 版。 1.

      【讨论】:

        【解决方案3】:

        你解决了吗?我面临着同样的情况...

        【讨论】:

          猜你喜欢
          • 2021-12-31
          • 1970-01-01
          • 1970-01-01
          • 2012-10-02
          • 1970-01-01
          • 1970-01-01
          • 2014-07-19
          • 2015-06-06
          • 2020-07-03
          相关资源
          最近更新 更多