在 apache 上托管铯地图 tomcat

Hosting Cesium Map on apache tomcat

我是 Cesium 3D Map js 的新手。我想将其与我现有的使用 apache tomcat 作为 Web 服务器的应用程序集成。我想用这个而不是 node.js.

来托管铯

在那里 Getting Started tutorial and here,他们写道,您只需解压缩 cesium.zip 文件并将其托管在您的服务器中。

我将 cesium.zip 文件解压缩到名为 CesiumRoot 的文件夹中,然后我将其放入 apache 的 webapps 文件夹并启动我的服务器。但它没有用。 这个问题我搜了一下,没找到。

请告诉一个程序或任何教程,说明如何在 apache 中托管它。

要在 Tomcat 或 node.js 以外的 Web 容器中部署 Cesium,您必须在 Web 应用程序的上下文中解压缩 Cesium 分发,以便 HTML 页面、servlet、 jsps等可以将cesium资源的url解析为相对url

给定一个测试页面 test.html,其中 Cesium 包位于名为 "Cesium" 的文件夹中,test.html 页面将引用 Cesium 资源如下:

  <script src="Cesium/Build/Cesium/Cesium.js"></script>
  <link rel="stylesheet" type="text/css" href="Cesium/Build/Cesium/Widgets/widgets.css">

首先,从一个简单的 hello world 应用开始。 这里是test.html

的全部内容
<!DOCTYPE html>
<html lang="en">
<head>
  <!-- Use correct character set. -->
  <meta charset="utf-8">
  <!-- Tell IE to use the latest, best version. -->
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <!-- Make the application on mobile take up the full browser screen and disable user scaling. -->
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
  <title>Hello World!</title>  
  <script src="Cesium/Build/Cesium/Cesium.js"></script>
  <link rel="stylesheet" type="text/css" href="Cesium/Build/Cesium/Widgets/widgets.css">
  <style>      
      html, body, #cesiumContainer {
          width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden;
      }
  </style>
</head> 
<body>
 <div id="cesiumContainer"></div>
 <script>

 var viewer = new Cesium.Viewer('cesiumContainer'); 

 </script>
</body>
</html>