|
|
@ -11,14 +11,15 @@ onMounted(async () => {
|
|
|
|
// Cesium.Ion.defaultAccessToken =
|
|
|
|
// Cesium.Ion.defaultAccessToken =
|
|
|
|
// "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkMDEzNTg3OC00NDhmLTRiMjktYmIzZS00ZGNjMzRmYmM4NTgiLCJpZCI6MjA0NjA3LCJpYXQiOjE3MTE0NjYwODJ9.lAjK7xqmNhIcvkkfSdQEGPeKxtHYh_Q8jqB3bEJ5cGI";
|
|
|
|
// "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkMDEzNTg3OC00NDhmLTRiMjktYmIzZS00ZGNjMzRmYmM4NTgiLCJpZCI6MjA0NjA3LCJpYXQiOjE3MTE0NjYwODJ9.lAjK7xqmNhIcvkkfSdQEGPeKxtHYh_Q8jqB3bEJ5cGI";
|
|
|
|
|
|
|
|
|
|
|
|
const viewer = new Cesium.CesiumWidget("cesiumContainer", {
|
|
|
|
const viewer = new Cesium.Viewer("cesiumContainer", {
|
|
|
|
homeButton: false,
|
|
|
|
homeButton: false,
|
|
|
|
baseLayerPicker: false,
|
|
|
|
baseLayerPicker: false,
|
|
|
|
geocoder: false,
|
|
|
|
geocoder: false,
|
|
|
|
|
|
|
|
infoBox: false,
|
|
|
|
|
|
|
|
navigationHelpButton: false,
|
|
|
|
terrainProvider: await Cesium.CesiumTerrainProvider.fromUrl(
|
|
|
|
terrainProvider: await Cesium.CesiumTerrainProvider.fromUrl(
|
|
|
|
"http://localhost/Share/Map/terrain/"
|
|
|
|
"http://127.0.0.1:8080/terrain"
|
|
|
|
),
|
|
|
|
),
|
|
|
|
infoBox: false,
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// 去除其他图层
|
|
|
|
// 去除其他图层
|
|
|
@ -30,8 +31,7 @@ onMounted(async () => {
|
|
|
|
|
|
|
|
|
|
|
|
// 加载本地地图
|
|
|
|
// 加载本地地图
|
|
|
|
new Cesium.UrlTemplateImageryProvider({
|
|
|
|
new Cesium.UrlTemplateImageryProvider({
|
|
|
|
// url: "http://127.0.0.1:12344/satellite-google-gcj02-zxy-all-9-sc-15-cd-18-3h-21/{z}/{x}/{y}.png",
|
|
|
|
url: "http://127.0.0.1:8080/tile/{z}/{x}/{y}.png",
|
|
|
|
url: "http://127.0.0.1:12344/中国4-10层卫星地图(G)/{z}/{x}/{y}.png",
|
|
|
|
|
|
|
|
maximumLevel: 10,
|
|
|
|
maximumLevel: 10,
|
|
|
|
minimumLevel: 4,
|
|
|
|
minimumLevel: 4,
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -39,16 +39,27 @@ onMounted(async () => {
|
|
|
|
|
|
|
|
|
|
|
|
// 定位相机
|
|
|
|
// 定位相机
|
|
|
|
viewer.camera.flyTo({
|
|
|
|
viewer.camera.flyTo({
|
|
|
|
destination: Cesium.Cartesian3.fromDegrees(118.38, 29.7, 40),
|
|
|
|
destination: Cesium.Cartesian3.fromDegrees(118.38, 29.7, 400000),
|
|
|
|
orientation: {
|
|
|
|
orientation: {
|
|
|
|
heading: Cesium.Math.toRadians(0.0),
|
|
|
|
heading: Cesium.Math.toRadians(0.0),
|
|
|
|
pitch: Cesium.Math.toRadians(-15.0),
|
|
|
|
pitch: Cesium.Math.toRadians(-15.0),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
//隐藏logo
|
|
|
|
viewer.entities.add({
|
|
|
|
console.log(viewer);
|
|
|
|
name: "plane",
|
|
|
|
viewer.cesiumWidget.creditContainer.style.display = "none";
|
|
|
|
position: Cesium.Cartesian3.fromDegrees(118.38, 29.7, 40000),
|
|
|
|
|
|
|
|
model: {
|
|
|
|
|
|
|
|
uri: "./feiji.glb",
|
|
|
|
|
|
|
|
scale: 2,
|
|
|
|
|
|
|
|
minimumPixelSize: 200, // 最小的模型像素
|
|
|
|
|
|
|
|
maximumScale: 20000, // 最大的模型像素
|
|
|
|
|
|
|
|
runAnimations: true, // 是否显示动画
|
|
|
|
|
|
|
|
clampAnimations: true, // 是否保持最后一针的动画
|
|
|
|
|
|
|
|
// color: Cesium.Color.RED, // 模型加颜色
|
|
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// var iframe = document.getElementsByClassName("cesium-infoBox-iframe")[0];
|
|
|
|
// var iframe = document.getElementsByClassName("cesium-infoBox-iframe")[0];
|
|
|
|
// iframe.setAttribute(
|
|
|
|
// iframe.setAttribute(
|
|
|
|