当前位置:网站首页>Cesium-1.72 learning (earth model creation online offline tile)
Cesium-1.72 learning (earth model creation online offline tile)
2022-06-30 16:17:00 【Eternal wolf tooth】
1、 On-line
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> Quick start cesium</title>
<link rel="stylesheet" href="/Cesium-1.72/Build/Cesium/Widgets/widgets.css">
<script src="/Cesium-1.72/Build/Cesium/Cesium.js"></script>
</head>
<body>
<div style="width:1500px;height:700px;">
<div id="cesiumContainer" style="width:100%;height:100%;"></div>
</div>
</body>
</html>
<script> Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxMTdmMTdmNS00NzZhLTQwOGMtODQwYy1kZjAyMzNiOTg0ZTYiLCJpZCI6MzMwMjQsInNjb3BlcyI6WyJhc3IiLCJnYyJdLCJpYXQiOjE1OTc4OTE3ODl9.yqF540oYBpSme38SIPKUP4t14FA6hXCLFHnvOqPf_Fw'; var viewer = new Cesium.Viewer('cesiumContainer', {
geocoder:false, // A geographic location search tool , Used to display the geographic location accessed by the camera . The default is Microsoft Bing Map . homeButton:true, // Home page location , Click to jump to the default view . sceneModePicker:true, // Switch 2D、3D and Columbus View (CV) Pattern . baseLayerPicker:false, // Select the base map of 3D digital earth (imagery and terrain). navigationHelpButton:true, // Help tips , How to operate digital earth . animation:false,// Control the playback speed of window animation . creditsDisplay:false, // Display trademark copyright and data sources . timeline:false, // Show the current time and allow the user to drag to any specified time on the progress bar . fullscreenButton:true, // Check the full screen button , //terrainProvider: Cesium.createWorldTerrain()// terrain }); viewer.scene.globe.enableLighting = true;// Enable the earth with the sun as the light source </script>
Online loading uses network loading bing Map , Application required Cesium.Ion.defaultAccessToken
Address :cesium Official website , Register login
2、 Offline installation package resources
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> Quick start cesium</title>
<link rel="stylesheet" href="/Cesium-1.72/Build/Cesium/Widgets/widgets.css">
<script src="/Cesium-1.72/Build/Cesium/Cesium.js"></script>
</head>
<body>
<div style="width:1500px;height:700px;">
<div id="cesiumContainer" style="width:100%;height:100%;"></div>
</div>
</body>
</html>
<script> var viewer = new Cesium.Viewer('cesiumContainer', {
imageryProvider:new Cesium.UrlTemplateImageryProvider({
url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII') + '/{z}/{x}/{reverseY}.jpg', credit : ' Analytical Graphics, Inc.', tilingScheme : new Cesium.GeographicTilingScheme(), maximumLevel : 5 }), geocoder:false, // A geographic location search tool , Used to display the geographic location accessed by the camera . The default is Microsoft Bing Map . homeButton:true, // Home page location , Click to jump to the default view . sceneModePicker:true, // Switch 2D、3D and Columbus View (CV) Pattern . baseLayerPicker:false, // Select the base map of 3D digital earth (imagery and terrain). navigationHelpButton:true, // Help tips , How to operate digital earth . animation:false,// Control the playback speed of window animation . creditsDisplay:false, // Display trademark copyright and data sources . timeline:false, // Show the current time and allow the user to drag to any specified time on the progress bar . fullscreenButton:true, // Check the full screen button }); viewer.scene.globe.enableLighting = true;// Enable the earth with the sun as the light source </script>
The offline in the installation package is loaded 3 Level map
3、 Offline Tile Map , Self built map service .
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> Quick start cesium</title>
<link rel="stylesheet" href="/Cesium-1.72/Build/Cesium/Widgets/widgets.css">
<script src="/Cesium-1.72/Build/Cesium/Cesium.js"></script>
</head>
<body>
<div style="width:1500px;height:700px;">
<div id="cesiumContainer" style="width:100%;height:100%;"></div>
</div>
</body>
</html>
<script> var viewer = new Cesium.Viewer('cesiumContainer', {
imageryProvider:new Cesium.UrlTemplateImageryProvider({
url:'http://localhost:8099/basemap_0-10/{z}/{y}/{x}.png', // Native map service //url:'http://localhost:6379/basemap_0-10/{z}/{y}/{x}.png', // Server map service /** * springboot * The server Cross domain configuration * @Configuration public class MyCorsConfig implements WebMvcConfigurer { @Bean public WebMvcConfigurer corsConfigurer() { return new WebMvcConfigurer() { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**").allowedOrigins("*"). // Allow cross domain domain names , It can be used * Indicates that any domain name is allowed to use allowedMethods("*"). // Allow any method (post、get etc. ) allowedHeaders("*"). // Allow any request header allowCredentials(true). // close cookie Information exposedHeaders(HttpHeaders.SET_COOKIE).maxAge(3600L); // maxAge(3600) Show in 3600 Seconds , There is no need to send a pre inspection request , You can cache the result } }; } } */ fileExtension : "png", }), geocoder:false, // A geographic location search tool , Used to display the geographic location accessed by the camera . The default is Microsoft Bing Map . homeButton:true, // Home page location , Click to jump to the default view . sceneModePicker:true, // Switch 2D、3D and Columbus View (CV) Pattern . baseLayerPicker:false, // Select the base map of 3D digital earth (imagery and terrain). navigationHelpButton:true, // Help tips , How to operate digital earth . animation:false,// Control the playback speed of window animation . creditsDisplay:false, // Display trademark copyright and data sources . timeline:false, // Show the current time and allow the user to drag to any specified time on the progress bar . fullscreenButton:true, // Check the full screen button }); viewer.scene.globe.enableLighting = true;// Enable the earth with the sun as the light source </script>
function springboot Set up a map service , Tile Map access across domains , Cross domain configuration is required on the map server .
Case code :https://github.com/zhangxuhui1992/cesium
边栏推荐
- Go-Micro安装
- 数据治理市场:亿信华辰朝左,华傲数据向右
- LeCun指明下一代AI方向:自主机器智能
- Cloud XR, how to help industrial upgrading
- 什么是XR扩展现实,XR云串流平台有哪些
- 构建适合组织的云原生可观测性能力
- KDD 2022 | 我们离通用预训练推荐模型还有多远?推荐系统的通用序列表示学习模型 UniSRec
- '&lt;', Hexadecimal value 0x3c, is an invalid problem solving
- Policy Center > Device and Network Abuse
- Smart wind power: operation and maintenance of digital twin 3D wind turbine intelligent equipment
猜你喜欢
Go-Micro安装
Policy Center-Permissions and APIs that Access Sensitive Information
Policy Center-User Data
Simulation of two-color ball system to judge the winning situation
Swagger's asp Net core web API help page
How cloudxr promotes the future development of XR
linux下修改mysql密码: ERROR 1396 (HY000): Operation ALTER USER failed for ‘root‘@‘localhost‘
map reduce案例超详细讲解
go-zero微服务实战系列(八、如何处理每秒上万次的下单请求)
Which direction should college students choose to find jobs after graduation?
随机推荐
【时序数据库InfluxDB】Windows环境下配置InfluxDB+数据可视化,以及使用 C#进行简单操作的代码实例
Model system: Sword (1)
边缘计算平台如何助力物联网发展
CVPR 2022丨特斯联AI提出:基于图采样深度度量学习的可泛化行人重识别
Go-Micro安装
Interview experience of service end test engineer
今晚19:00知识赋能第2期直播丨OpenHarmony智能家居项目之控制面板界面设计
linux下新建Mysql数据库并导入sql文件
[unity ugui] scrollrect dynamically scales the grid size and automatically locates the middle grid
剑指 Offer II 080. 含有 k 个元素的组合 回溯
ASP. Net core signalr series hub tutorial
Map reduce case super detailed explanation
Asp.NetCore利用缓存使用AOP方式防止重复提交
How to connect the Internet Reading Notes - Summary
消息队列十连问
Unsupported major. minor version 52.0
Open source STM32 USB-CAN project
String common API
云化XR,如何助力产业升级
[download attached] installation and use of penetration test artifact Nessus