-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Cesium1.106 is Normal! But Cesium1.107+ is Error? Please Help! #12081
Comments
Locally, you also need to start the Nginx service, and the configuration for GIS in nginx.conf is as follows server {
listen 8190;
location /tiles {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
# 谷歌_全球_卫星_12级 Windows配置
alias D:\\_qyd\\maps\\谷歌_卫星_全球_0-12级\\tiles;
}
} The tilemap directory is as follows
|
1.107改动了很多东西 |
@iamsee 是的,从1.107及之后的版本,再使用以下办法就再也出现不了离线瓦片(包括在线地球也显示不了),很是奇怪,在此之前的版本都是可以的 var viewer = new Cesium.Viewer('cesiumContainer', {
imageryProvider: new Cesium.UrlTemplateImageryProvider({
// 离线地球
url: 'http://127.0.0.1:8190/tiles/{z}/{x}/{y}.png',
fileExtension: 'png',
maximumLevel: 12,
show: true,
// 在线地球
// url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",
}),
// 离线/在线地球
// imageryProvider: google,
baseLayerPicker: false, // 是否显示图层选择控件
homeButton: false, // 返回主视角
fullscreenButton: false, // 是否显示全屏按钮
shadows: true, // 影子
infoBox: false, // 是否显示点击要素之后显示的信息
geocoder: false, // 是否显示地名查找控件
sceneModePicker: false, // 是否显示投影方式控件,是否显示3D/2D选择器
navigationInstructionsInitiallyVisible: false, // 帮助按钮,初始化的时候是否展开
navigationHelpButton: false, // 是否显示帮助信息控件
timeline: false, // 是否显示时间线控件
scene3DOnly: true, // 为 true 时,每个几何实例将仅以3D渲染以节省GPU内存
animation: true, // 是否显示动画控件
shouldAnimate: true, // 当动画控件出现,用来控制是否通过旋转控件,旋转场景
orderIndependentTranslucency: false, // 如果为true,并且配置支持它,则使用顺序无关的半透明性
contextOptions: {
webgl: { alpha: true },
},
});``` |
@jmszwzr 在线可以使用 Cesium.ArcGisMapServerImageryProvider.fromUrl(
'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer'
); 加wx吧,我也有问题可以交流下 aqc151307 |
Please pay attention to these Breaking Changes: https://github.com/CesiumGS/cesium/blob/main/CHANGES.md#1107---2023-07-03 |
CesiumJS is a big project, so we use GitHub for feature requests and bug tracking exclusively. In the future, please take any questions to the Cesium Forum where there are members of the community and developers from the team who can help. Thanks! |
Thank you all! var viewer = new Cesium.Viewer('cesiumContainer', {
baseLayerPicker: false, // 是否显示图层选择控件
homeButton: false, // 返回主视角
fullscreenButton: false, // 是否显示全屏按钮
shadows: false, // 影子
infoBox: false, // 是否显示点击要素之后显示的信息
geocoder: false, // 是否显示地名查找控件
sceneModePicker: false, // 是否显示投影方式控件,是否显示3D/2D选择器
navigationInstructionsInitiallyVisible: false, // 帮助按钮,初始化的时候是否展开
navigationHelpButton: false, // 是否显示帮助信息控件
timeline: false, // 是否显示时间线控件
scene3DOnly: true, // 为 true 时,每个几何实例将仅以3D渲染以节省GPU内存
animation: true, // 是否显示动画控件
shouldAnimate: true, // 当动画控件出现,用来控制是否通过旋转控件,旋转场景
orderIndependentTranslucency: false, // 如果为true,并且配置支持它,则使用顺序无关的半透明性
skyAtmosphere: false, // 光圈
contextOptions: {
webgl: {
alpha: true
}
}
});
viewer.imageryLayers.addImageryProvider(new Cesium.UrlTemplateImageryProvider({
// 离线瓦片服务地址
url: `http://127.0.0.1:8190/tiles/{z}/{x}/{y}.png`,
})); Here's how it looks like in the higher version: Reference Link:Cesium 加载在线天地图瓦片和离线瓦片功能 Thanks again everyone! |
1.107+版本已解决离线瓦片加载问题,微信已加。 |
What happened?
All are normal in this version: Cesium 84~1.106, But it's all abnormal since 1.107, None of the code has changed!
Local file directory
Core code
Cesium_GIS_Show_By_1.106_Normal
![Cesium_GIS_Show_By_1 106_Normal](https://cdn.statically.io/img/private-user-images.githubusercontent.com/22726645/348172897-0468c05d-3a5e-4ce1-909c-bb80ad13c6fc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI3MjUxNTAsIm5iZiI6MTcyMjcyNDg1MCwicGF0aCI6Ii8yMjcyNjY0NS8zNDgxNzI4OTctMDQ2OGMwNWQtM2E1ZS00Y2UxLTkwOWMtYmI4MGFkMTNjNmZjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODAzVDIyNDA1MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQzMWMyNjIyOTRhZWQ3YjY0MDNlODMwOWM2ZGIyNjY1NjVkYTM1YTg4YjVkNzU5OGY1NGZjYmEzZDYwMmRjZDMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.HAxrpK8OUuke_OFD1FP6KLoqkfopDiSmMlI-np2oVbM)
Cesium_GIS_Show_By_1.107_Error
![Cesium_GIS_Show_By_1 107_Error](https://cdn.statically.io/img/private-user-images.githubusercontent.com/22726645/348172979-a5ceb2a7-3f69-4c99-b874-b4b7a901e6a1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI3MjUxNTAsIm5iZiI6MTcyMjcyNDg1MCwicGF0aCI6Ii8yMjcyNjY0NS8zNDgxNzI5NzktYTVjZWIyYTctM2Y2OS00Yzk5LWI4NzQtYjRiN2E5MDFlNmExLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODAzVDIyNDA1MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFkZmM0ZTc1MmUyNTg2NzdiYWRhMzg0MTViMDViOTUyODgyYzVmMjlhZDc2N2ZjN2RiZjllMjVkZTIwOTBkNmYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.uxODkJ1vP1qovC2xaJVCma5nwNoeWYOxBacNK-SysGg)
Reproduction steps
1.Download this packag tj2-web-qyd-20240711.zip
2. install nodejs 21+
3. unzip that package and enter the directory
4. run command "http-server -p 8080"
5. Browser access "http://127.0.0.1:8080",it's working fine at this point
6. The version of Cesium inside the zip package is 1.106, then you can download the 1.107+ installer from the official Github, such as 1.107, and then copy all the directories in this directory
Cesium-1.107/Build/Cesium
and replace the directory in the zip package in thescript/Cesium
, then you can find out that there isCesium_ GIS_Show_By_1.107_Error
Sandcastle example
No response
Environment
Browser: Google Chrome 126.0.6478.127
CesiumJS Version: 1.107+
Operating System: Windows 10 1909
Nodejs: 21.7.3
The text was updated successfully, but these errors were encountered: