基于CesiumJS 的3D Tiles技术

92e18861d991149a40f715cd4682b43e.png

生活不止眼前的苟且,还有诗和远方的田野

谷歌推出逼真的 3D Tiles(2023 年 5 月)

      这是开放 3D 地理空间世界的重大突破。Google 的 3D 地理空间数据集现在首次向所有人开放,可以在 Google Earth 之外使用。逼真的 3D Tiles 允许开发人员访问 2,500 多个城市,并通过 Cesium 生态系统的功能探索他们的创造力,通过 CesiumJS 创建 Web 应用程序,并通过 Cesium for Game Engine 创建游戏引擎应用程序。Photorealistic 3D Tiles 可通过 Google Maps API 立即使用。此外,你还可以将自己的数据集与 Cesium Ion API 合并。

225ba0a2d4f87855c8f892643292939f.gif

webgis学习,推荐看一下这本书,实操性很强

下面是一个Demo

    注意要更改自己的key。可使用Live Server(一个vscode的插件)运行,也可以使用自己喜欢的 Web 服务器技术,无论是 Python、NodeJS、Apache 还是任何其他技术。

<!DOCTYPE html>
<html lang="en">


<head>
    <meta charset="utf-8">
    <!-- Include the CesiumJS JavaScript and CSS files -->
    <script src="https://cesium.com/downloads/cesiumjs/releases/1.105.1/Build/Cesium/Cesium.js"></script>
    <link href="https://cesium.com/downloads/cesiumjs/releases/1.105.1/Build/Cesium/Widgets/widgets.css"
        rel="stylesheet">
</head>


<body style="margin:0px">
    <div id="cesiumContainer" style="height:100vh;"></div>
    <script>


        Cesium.Ion.defaultAccessToken = '<Your CesiumIon Token>';
        Cesium.GoogleMaps.defaultApiKey = '<Your Google Map API Token>';
        // Initialize the Cesium Viewer in the HTML element with the `cesiumContainer` ID.
        const viewer = new Cesium.Viewer('cesiumContainer', {
            globe: false,
        });
        // add a global layer of Photorealistic 3D Tiles to our scene.
        // Add Photorealistic 3D Tiles
        async function addGoogleP3T() {
            try {
                const tileset = await Cesium.createGooglePhotorealistic3DTileset();
                viewer.scene.primitives.add(tileset);
            } catch (error) {
                console.log(`Error loading Photorealistic 3D Tiles tileset. ${error}`);
            }
        }
        addGoogleP3T();
        // Point the camera at the HFT Stuttgart (Change to yours!)
        viewer.camera.setView({ "destination": { "x": 4157461.4563741013, "y": 671341.0061027076, "z": 4774675.061607998 }, "orientation": { "direction": { "x": -0.9961029219201177, "y": 0.04678777747726383, "z": 0.07476545205468949 }, "up": { "x": 0.08148125542536441, "y": 0.1636911012978059, "z": 0.9831408995511365 } } })
</script>
    </div>
</body>
</htm!l>

key的获取

  • 可以从此处获取的 Google Map API(https://developers.google.com/maps/documentation/embed/get-api-key) 密钥。创建 API 后,确保启用MapTiles API

453b66e92de6022a3a99e2872a4dac6d.png

  • CesiumJS API 密钥,你可以从这里获得:

    扫描二维码关注公众号,回复: 15361216 查看本文章

https://cesium.com/learn/cesiumjs-learn/cesiumjs-quickstart/#step-1-create-an-account-and-get-a-token

efe4eafd37605bf79643ce2cff7bf8f3.png

本公众号只做干货,分享实际项目中的点点滴滴

希望您阅读后有所收获

同时,也希望您能在下方给个赞赏

您的赞赏

是我持续创作的最大动力!

非常感谢!

ef4894aea0e8750485a619192fee68ff.gif

1、ArcGIS Pro 3.0 软件破解版安装及教程

2、中国市级行政区shp(WGS84)【2022 · 最新数据共享】

3、中国县级行政区【2022 · 最新数据共享】‍

4、IntelliJ IDEA 2022.3.1 专业版破解

5、GIS开发者应考虑使用 Edge浏览器的 8 个理由

6、ArcGIS Pro中常用的空间分析功能

7、开源 Web GIS 制作3D建筑

8、ArcGIS Pro 和 ChatGPT集成思路

9、Segment Anything 模型的 3 个地理空间和遥感用例

10、office 软件安装包下载

11、Segment Anything模型用于地理空间数据

12、QGIS软件安装包下载

62335f32210ffa410caffada4fcd9f11.gif

4e0d9fd6a49e99388d0462e7134242d4.gif

点分享

3a2f1abd8216e49b018fcecb730e41ce.gif

点点赞

44ea466e35d50e9e7a2ee5d0cd58b74b.gif

点在看

猜你喜欢

转载自blog.csdn.net/qq_35918970/article/details/131099034
今日推荐