航行航迹

main
wengxinlei 9 months ago
parent 451ad6c65d
commit d9d88cf407

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

@ -1,4 +1,4 @@
[
var data = [
{
id: "document",
name: "CZML Point",

File diff suppressed because it is too large Load Diff

@ -143,14 +143,8 @@
</div>
</div>
<script>
var popup = $('#popup');
// 假设你有一个函数来确定弹窗的位置
function showPopupAtPosition(position) {
console.log(111)
$('#popup').show();
};
const czml = [{
const czml = [
{
id: "document",
name: "CZML Point",
version: "1.0",
@ -158,7 +152,7 @@
{
id: "Point 1",
name: "各达山",
position: {
position: {
cartographicDegrees: [105.541667, 23.195833, 10],
},
point: {

File diff suppressed because it is too large Load Diff

@ -0,0 +1,348 @@
<!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>飞行轨迹回放</title>
<script type="text/javascript" cesium="true" src="https://api.tianditu.gov.cn/cdn/demo/sanwei/static/cesium/Cesium.js"></script>
<script type="text/javascript" cesium="true" src="https://api.tianditu.gov.cn/cdn/plugins/cesium/Cesium_ext_min.js"></script>
<link rel="stylesheet" cesium="true" href="https://api.tianditu.gov.cn/cdn/demo/sanwei/static/cesium/Widgets/widgets.css">
<link href="https://services.arcgisonline.com/arcgis/rest/static/jsapi-template-main.css" rel="stylesheet" type="text/css">
<link href="https://js.arcgis.com/4.14/esri/css/main.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="https://js.arcgis.com/4.14/dojo/dojo.js"></script>
<script type="text/javascript" src="/Public/js/datasource.js"></script>
<script src="/Public/js/jquery-1.10.2.min.js"></script>
<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");
// viewer.baseLayerPicker.viewModel.selectedImagery = viewer.baseLayerPicker.viewModel.imageryProviderViewModels[12];
var token = "72e2e7be836401af7e79c232285a552e";
var tdtUrl = 'http://t{s}.tianditu.gov.cn/';
var subdomains = ['0', '1', '2', '3', '4', '5', '6', '7'];
Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI3NzI3MDQwMS05M2MxLTQ1MDAtOWYxOS0wZDg0MmI5Zjc2NTUiLCJpZCI6MjMxNzM1LCJpYXQiOjE3MjIzODk2ODB9.zy6rmwWtDzF2890HZR6XGlDxxMImZ8v_Erfnz3gyti4';
// cesium 初始化
var viewer = new Cesium.Viewer('cesiumContainer', {
shouldAnimate: true, //是否允许动画
selectionIndicator: false,
baseLayerPicker: true,
fullscreenButton: false,
geocoder: false,
homeButton: false,
infoBox: false,
sceneModePicker: false,
timeline: true,
navigationHelpButton: false,
navigationInstructionsInitiallyVisible: false,
showRenderLoopErrors: false,
shadows: false,
});
viewer.baseLayerPicker.viewModel.selectedImagery = viewer.baseLayerPicker.viewModel.imageryProviderViewModels[12];
viewer.baseLayerPicker.container.style.display = "none";
let positionDisplay = addComponent('div', 'absolute', '10px', '10px', '5px', 'white', 1000);
let buttonNorth = addComponent('button', 'absolute', '50px', '10px', '5px', 'white', 1000, '朝北视角');
let buttonEast = addComponent('button', 'absolute', '50px', '80px', '5px', 'white', 1000, '朝东视角');
let buttonSouth = addComponent('button', 'absolute', '50px', '150px', '5px', 'white', 1000, '朝南视角');
let buttonWest = addComponent('button', 'absolute', '50px', '220px', '5px', 'white', 1000, '朝西视角');
let buttonCenter = addComponent('button', 'absolute', '50px', '290px', '5px', 'white', 1000, '座舱视角');
buttonNorth.addEventListener('click', function () {
switchCameraView(0);
})
buttonEast.addEventListener('click', function () {
switchCameraView(90);
})
buttonSouth.addEventListener('click', function () {
switchCameraView(180);
})
buttonWest.addEventListener('click', function () {
switchCameraView(270);
})
let postUpdateEventListener = null;
buttonCenter.addEventListener('click', function () {
viewer.trackedEntity.model.uri = plan;
viewer.trackedEntity.model.scale=2;
let prePoint = null;
viewer.scene.postUpdate.addEventListener(
postUpdateEventListener = () => {
let curPoint = viewer.trackedEntity.position.getValue(viewer.clock.currentTime);
if (prePoint) {
// 计算heading-代表 Z 轴旋转
let heading = getHeading(prePoint, curPoint);
//let heading = - Cesium.Math.PI_OVER_TWO;
// 计算pitch-代表 Y 轴朝向
//let pitch = Cesium.Math.toRadians(-150);
let pitch = Cesium.Math.toRadians(-15);
let range = 20
viewer.scene.camera.lookAt(curPoint, new Cesium.HeadingPitchRange(heading, pitch, range));
}
// 当前点在下一次渲染时为前一个点
prePoint = Cesium.Cartesian3.clone(curPoint)
});
})
//viewer.animation.container.style.display = "none";
// 抗锯齿
viewer.scene.fxaa = true;
viewer.scene.postProcessStages.fxaa.enabled = false;
// 水雾特效
viewer.scene.globe.showGroundAtmosphere = true;
// 设置最大俯仰角,[-90,0]区间内,默认为-30单位弧度
// viewer.scene.screenSpaceCameraController.constrainedPitch = Cesium.Math.toRadians(-20);
// viewer.scene.screenSpaceCameraController.autoResetHeadingPitch = false;
// viewer.scene.screenSpaceCameraController.inertiaZoom = 0.5;
// viewer.scene.screenSpaceCameraController.minimumZoomDistance = 50;
// viewer.scene.screenSpaceCameraController.maximumZoomDistance = 20000000;
// viewer.scene.screenSpaceCameraController.zoomEventTypes = [
// Cesium.CameraEventType.RIGHT_DRAG,
// Cesium.CameraEventType.WHEEL,
// Cesium.CameraEventType.PINCH,
// ];
// viewer.scene.screenSpaceCameraController.tiltEventTypes = [
// Cesium.CameraEventType.MIDDLE_DRAG,
// Cesium.CameraEventType.PINCH,
// {
// eventType: Cesium.CameraEventType.LEFT_DRAG,
// modifier: Cesium.KeyboardEventModifier.CTRL,
// },
// {
// eventType: Cesium.CameraEventType.RIGHT_DRAG,
// modifier: Cesium.KeyboardEventModifier.CTRL,
// },
// ];
// 取消默认的双击事件
viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
var esriImg = new Cesium.ArcGisMapServerImageryProvider({
url: 'https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer',
});
viewer.imageryLayers.addImageryProvider(esriImg);
// 叠加影像服务
// var imgMap = new Cesium.UrlTemplateImageryProvider({
// url: tdtUrl + 'img_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=' + token,
// subdomains: subdomains,
// tilingScheme : new Cesium.WebMercatorTilingScheme(),
// maximumLevel : 18
// });
// viewer.imageryLayers.addImageryProvider(imgMap);
//将三维球定位到中国
// viewer.camera.flyTo({
// destination: Cesium.Cartesian3.fromDegrees(116.40375810947471, 39.908597112062225, 17850000),
// orientation: {
// heading: Cesium.Math.toRadians(348.4202942851978),
// pitch: Cesium.Math.toRadians(-89.74026687972041),
// roll: Cesium.Math.toRadians(0)
// },
// complete: function callback() {
// // 定位完成之后的回调函数
// }
// });
let date = new Date('2024-08-06 13:22:04');
const start = Cesium.JulianDate.fromDate(date);
const end = 7000;
var plan = "../Public/Cesium_Air.glb"
const czml = [
{
id: "document",
version: "1.0",
clock: {
interval: `${Cesium.JulianDate.toIso8601(start, 0)}/${Cesium.JulianDate.toIso8601(Cesium.JulianDate.addSeconds(start, end, new Cesium.JulianDate()), 0)}`,
currentTime: `${Cesium.JulianDate.toIso8601(start, 0)}`,
multiplier: 6,
}
},
{
id: "plane",
availability: `${Cesium.JulianDate.toIso8601(start, 0)}/${Cesium.JulianDate.toIso8601(Cesium.JulianDate.addSeconds(start, end, new Cesium.JulianDate()), 0)}`,
model: {
gltf: plan,
scale: 2.0,
minimumPixelSize: 48,
maximumScale: 2000,
},
// viewFrom: {
// cartesian: [-2080, -1715, 779]
// },
orientation: {velocityReference: "#position"},
path: {
material: {
solidColor: {
color: {
interval: `${Cesium.JulianDate.toIso8601(start, 0)}/${Cesium.JulianDate.toIso8601(Cesium.JulianDate.addSeconds(start, end, new Cesium.JulianDate()), 0)}`,
rgba: [0, 205, 255, 255]
}
}
},
width: [
{
interval: `${Cesium.JulianDate.toIso8601(start, 0)}/${Cesium.JulianDate.toIso8601(Cesium.JulianDate.addSeconds(start, end, new Cesium.JulianDate()), 0)}`,
number: 3
}
],
show: [
{
interval: `${Cesium.JulianDate.toIso8601(start, 0)}/${Cesium.JulianDate.toIso8601(Cesium.JulianDate.addSeconds(start, end, new Cesium.JulianDate()), 0)}`,
boolean: true
}
]
},
position: {
interpolationAlgorithm: "LAGRANGE",
interpolationDegree: 5,
epoch: `${Cesium.JulianDate.toIso8601(start, 0)}`,
cartographicDegrees:ds
}
}
];
let dataSource = viewer.dataSources.add(Cesium.CzmlDataSource.load(czml));
viewer.zoomTo(dataSource);
dataSource.then(part => {
// 根据id获取czml中的模型
let e = part.entities.getById("plane");
// 相机跟随模型
viewer.trackedEntity = e;
//++++++++++++++// 视角跟随模型
let prePoint = null;
// 前一个点
viewer.scene.postRender.addEventListener(() => {
if (e && viewer.clock.shouldAnimate) {
// 获取当前时间的位置
let curPoint = e.position.getValue(viewer.clock.currentTime);
if (prePoint) {
// 计算heading-代表 Z 轴旋转
let heading = getHeading(prePoint, curPoint);
//let heading = - Cesium.Math.PI_OVER_TWO;
// 计算pitch-代表 Y 轴朝向
//let pitch = Cesium.Math.toRadians(-150);
let pitch = Cesium.Math.toRadians(-10);
let range = 10;
//viewer.camera.lookAt(curPoint, new Cesium.HeadingPitchRange(heading, pitch, range));
let cartographicPosition = Cesium.Cartographic.fromCartesian(curPoint);
let longitude = Cesium.Math.toDegrees(cartographicPosition.longitude);
let latitude = Cesium.Math.toDegrees(cartographicPosition.latitude);
let headingDegrees = Cesium.Math.toDegrees(heading);
let height = cartographicPosition.height;
positionDisplay.textContent =
//"Longitude: " + longitude + "\u00B0" + "\n" +
//"Latitude: " + latitude + "\u00B0" + "\n" +
"Height: " + height.toFixed(2) + "M" + "\n" +
"航向:" + headingDegrees.toFixed(2) + "\u00B0";
}
// 当前点在下一次渲染时为前一个点
prePoint = Cesium.Cartesian3.clone(curPoint)
}
})
});
function getHeading(pointA, pointB) {
//建立以点A为原点X轴为east,Y轴为north,Z轴朝上的坐标系
const transform = Cesium.Transforms.eastNorthUpToFixedFrame(pointA);
//向量AB
const positionvector = Cesium.Cartesian3.subtract(pointB, pointA, new Cesium.Cartesian3());
//因transform是将A为原点的eastNorthUp坐标系中的点转换到世界坐标系的矩阵
//AB为世界坐标中的向量
//因此将AB向量转换为A原点坐标系中的向量需乘以transform的逆矩阵。
const vector = Cesium.Matrix4.multiplyByPointAsVector(Cesium.Matrix4.inverse(transform, new Cesium.Matrix4()), positionvector, new Cesium.Cartesian3());
//归一化
const direction = Cesium.Cartesian3.normalize(vector, new Cesium.Cartesian3());
//heading
const heading = Math.atan2(direction.y, direction.x) - Cesium.Math.PI_OVER_TWO;
//console.log(direction.y, direction.x,Math.atan2(direction.y, direction.x),heading,Cesium.Math.TWO_PI - Cesium.Math.zeroToTwoPi(heading));
//return Cesium.Math.TWO_PI - Cesium.Math.zeroToTwoPi(heading) - Cesium.Math.PI_OVER_TWO;
return Cesium.Math.TWO_PI - Cesium.Math.zeroToTwoPi(heading);
}
function updatePosition() {
var camera = viewer.scene.camera;
var ellipsoid = viewer.scene.globe.ellipsoid;
var cartesian = camera.position;
var height = ellipsoid.cartesianToCartographic(cartesian).height;
var text = "Latitude: " + camera.positionCartographic.latitude.toDegrees() + "\u00B0" + "\n" +
"Longitude: " + camera.positionCartographic.longitude.toDegrees() + "\u00B0" + "\n" +
"Height: " + height + "m";
positionDisplay.textContent = text;
}
function addComponent(name, position, top, left, padding, backgroundColor, zindex, text = '') {
let component = document.createElement(name);
component.style.position = position;
if (text !== undefined || text !== '') {
component.innerHTML = text;
}
component.style.top = top;
component.style.left = left;
component.style.zIndex = zindex;
component.style.backgroundColor = backgroundColor;
component.style.padding = padding;
document.body.appendChild(component);
return component;
}
function switchCameraView(heading)
{
viewer.scene.postUpdate.removeEventListener(postUpdateEventListener);
viewer.trackedEntity.model.uri = plan;
viewer.trackedEntity.model.scale=3;
heading = Cesium.Math.toRadians(heading);
// 计算pitch-代表 Y 轴朝向
//let pitch = Cesium.Math.toRadians(-150);
let pitch = Cesium.Math.toRadians(-10);
let range = 200;
let point = viewer.scene.camera.position
viewer.scene.camera.lookAt(point, new Cesium.HeadingPitchRange(heading, pitch, range));
}
</script>
</body>
</html>

@ -315,7 +315,8 @@
</div>
</div>
<script>
const czml = [{
const czml = [
{
id: "document",
name: "CZML Point",
version: "1.0",
@ -323,7 +324,7 @@
{
id: "Point 1",
name: "各达山",
position: {
position: {
cartographicDegrees: [105.541667, 23.195833, 10],
},
point: {
@ -333,6 +334,19 @@
pixelSize: 6,
zIndex: 10,
},
label: {
text: "各达山",
font: "24px Helvetica",
fillColor: Cesium.Color.BLACK, //字体颜色
showBackground: true, //是否显示背景颜色
backgroundColor: Cesium.Color.AQUA, //背景颜色
backgroundPadding: new Cesium.Cartesian2(25, 75),
style: Cesium.LabelStyle.FILL_AND_OUTLINE, //label样式
verticalOrigin: Cesium.VerticalOrigin.TOP, //垂直位置
horizontalOrigin: Cesium.HorizontalOrigin.LEFT, //水平位置
pixelOffset: new Cesium.Cartesian2(25, 75), //偏移
zIndex: 10,
},
},
{
id: "Point 2",
@ -626,6 +640,17 @@
position: {
cartographicDegrees: [108.2086111, 21.20972222, 0],
},
label: {
text: "Point 24",
font: "24px Helvetica",
color: {
rgba: [0, 0, 0, 255],
},
fillColor: Cesium.Color.SKYBLUE,
outlineColor: Cesium.Color.BLACK,
outlineWidth: 2,
style: Cesium.LabelStyle.FILL_AND_OUTLINE,
},
point: {
color: {
rgba: [0, 0, 0, 255],
@ -633,7 +658,417 @@
pixelSize: 6,
},
},
{
id: "document",
name: "CZML Geometries: Polyline",
version: "1.0"
},
{
id: "polyline01",
name: "travel to and fro between TEBON and 杏林;",
polyline: {
positions: {
cartographicDegrees: [
117.5002778, 24.13416667, 0,
118.0166667,24.56666667, 0
]
},
width: 2,
material: {
solidColor: {
color: {
rgba: [36,73,117, 255],
},
},
},
zIndex: 10,
// distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 50000),
show: true
}
},
{
id: "polyline02",
name: "travel to and fro between TEBON and P51;",
polyline: {
positions: {
cartographicDegrees: [
117.5002778, 24.13416667, 0,
116.8019444, 24.56916667, 0
]
},
width: 2,
material: {
solidColor: {
color: {
rgba: [36,73,117, 255],
},
},
},
zIndex: 10,
// distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 50000),
show: true
}
},
{
id: "polyline03",
name: "travel to and fro between TEBON and NUSPA;",
polyline: {
positions: {
cartographicDegrees: [
117.5002778, 24.13416667, 0,
117.6191667, 24.05055556, 0
]
},
width: 2,
material: {
solidColor: {
color: {
rgba: [36,73,117, 255],
},
},
},
zIndex: 10,
// distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 50000),
show: true
}
},
{
id: "polyline04",
name: "travel to and fro between TEBON and DABER;",
polyline: {
positions: {
cartographicDegrees: [
117.5002778, 24.13416667, 0,
116.8519444, 24.135, 0
]
},
width: 2,
material: {
solidColor: {
color: {
rgba: [36,73,117, 255],
},
},
},
zIndex: 10,
// distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 50000),
show: true
}
},
{
id: "polyline05",
name: "travel to and fro between TEBON and SAPUT;",
polyline: {
positions: {
cartographicDegrees: [
117.5002778, 24.13416667, 0,
117.0333333, 23.90111111, 0
]
},
width: 2,
material: {
solidColor: {
color: {
rgba: [36,73,117, 255],
},
},
},
zIndex: 10,
// distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 50000),
show: true
}
},
{
id: "polyline06",
name: "travel to and fro between TEBON and IKATA;",
polyline: {
positions: {
cartographicDegrees: [
117.5002778, 24.13416667, 0,
117.1338889,23.7525, 0
]
},
width: 2,
material: {
solidColor: {
color: {
rgba: [36,73,117, 255],
},
},
},
zIndex: 10,
// distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 50000),
show: true
}
},
{
id: "polyline07",
name: "From NUSPA to BINUS;",
polyline: {
positions: {
cartographicDegrees: [
117.6191667, 24.05055556, 0,
117.4005556, 23.83472222, 0
]
},
width: 2,
material: {
solidColor: {
color: {
rgba: [36,73,117, 255],
},
},
},
zIndex: 10,
// distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 50000),
show: true
}
},
{
id: "polyline08",
name: "From BINUS to IKATA;",
polyline: {
positions: {
cartographicDegrees: [
117.4005556, 23.83472222, 0,
117.1338889, 23.7525, 0
]
},
width: 2,
material: {
solidColor: {
color: {
rgba: [36,73,117, 255],
},
},
},
zIndex: 10,
// distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 50000),
show: true
}
},
{
id: "polyline09",
name: "travel to and fro between IKATA and SAPUT;",
polyline: {
positions: {
cartographicDegrees: [
117.1338889, 23.7525, 0,
117.0333333, 23.90111111,0
]
},
width: 2,
material: {
solidColor: {
color: {
rgba: [36,73,117, 255],
},
},
},
zIndex: 10,
// distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 50000),
show: true
}
},
{
id: "polyline10",
name: "travel to and fro between SAPUT and DABER;",
polyline: {
positions: {
cartographicDegrees: [
117.0333333, 23.90111111,0,
116.8519444, 24.135, 0
]
},
width: 2,
material: {
solidColor: {
color: {
rgba: [36,73,117, 255],
},
},
},
zIndex: 10,
// distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 50000),
show: true
}
},
{
id: "polyline11",
name: "travel to and fro between DABER and P51;",
polyline: {
positions: {
cartographicDegrees: [
116.8519444, 24.135, 0,
116.8019444, 24.56916667, 0
]
},
width: 2,
material: {
solidColor: {
color: {
rgba: [36,73,117, 255],
},
},
},
zIndex: 10,
// distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 50000),
show: true
}
},
{
id: "polyline12",
name: "From NUSPA to DABER;",
description:
"<p>这是注释从NUSPA 到 DABER单向航线</p>",
polyline: {
positions: {
cartographicDegrees: [
117.6191667, 24.05055556, 0,
116.8519444, 24.135, 0
]
},
width: 2,
material: {
solidColor: {
color: {
rgba: [36,73,117, 255],
},
},
},
zIndex: 10,
// distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 50000),
show: true
}
},
{
id: "billboard01",
name: "TEBON",
description:
"<p><a href='#' target='_blank'>注释可加链接跳转.</a> (AGI) 注释.</p>",
billboard: {
image:"../Public/img/icon01.png",
scale: 0.5,
width: 30,
height: 26
},
label: {
fillColor: {
rgba: [36, 73, 117, 255]
},
font: "18px Helvetica",
verticalOrigin: "BOTTOM",//垂直位置
horizontalOrigin: "CENTER",//水平位置
pixelOffset: {
cartesian2: [32, 0]
},
style: "FILL_AND_OUTLINE",
text: "TEBON",
showBackground: false,
backgroundColor: {
rgba: [112, 89, 57, 200]
}
},
position: {
cartographicDegrees: [117.5002778, 24.13416667, 0]
}
},
{
id: "billboard02",
name: "杏林",
description:
"<p> 注释.</p>",
billboard: {
image:"../Public/img/icon02.png",
scale: 0.5,
width: 36,
height: 28
},
label: {
fillColor: {
rgba: [36, 73, 117, 255]
},
font: "18px Helvetica",
verticalOrigin: "CENTER",//垂直位置
horizontalOrigin: "RIGHT",//水平位置
pixelOffset: {
cartesian2: [-12, 0]
},
style: "FILL_AND_OUTLINE",
text: "杏林",
showBackground: false,
backgroundColor: {
rgba: [112, 89, 57, 200]
}
},
position: {
cartographicDegrees: [118.0166667, 24.56666667, 0]
}
},
{
id: "billboard03",
name: "漳州机场",
description:
"<p>注释.</p>",
billboard: {
image:"../Public/img/icon03.png",
scale: 0.5,
width: 30,
height: 30,
},
label: {
fillColor: {
rgba: [36, 73, 117, 255]
},
font: "18px Helvetica",
verticalOrigin: "CENTER",//垂直位置
horizontalOrigin: "RIGHT",//水平位置
pixelOffset: {
cartesian2: [-10, 0]
},
style: "FILL_AND_OUTLINE",
text: "漳州",
showBackground: false,
backgroundColor: {
rgba: [112, 89, 57, 200]
}
},
position: {
cartographicDegrees: [117.65469408873497, 24.561665899584984, 0]
}
},
{
id: "billboard04",
name: "厦门/高崎",
description:
"<p>注释.</p>",
billboard: {
image:"../Public/img/icon04.png",
scale: 0.5,
width: 36,
height: 36
},
label: {
fillColor: {
rgba: [36, 73, 117, 255]
},
font: "18px Helvetica",
verticalOrigin: "CENTER",//垂直位置
horizontalOrigin: "RIGHT",//水平位置
pixelOffset: {
cartesian2: [-12, 0]
},
style: "FILL_AND_OUTLINE",
text: "厦门/高崎",
showBackground: false,
backgroundColor: {
rgba: [112, 89, 57, 200]
}
},
position: {
cartographicDegrees: [118.11783109396191, 24.53852070726468, 0]
}
},
];
var viewer = new Cesium.Viewer("cesiumContainer");
@ -1051,12 +1486,11 @@
});
// 如果需要可以通过以下代码将Entity置于最顶层
viewer.zoomTo(billboard);
viewer.zoomTo(polyline01);
const dataSourcePromise = Cesium.CzmlDataSource.load(czml);
viewer.dataSources.add(dataSourcePromise);
viewer.zoomTo(dataSourcePromise);
viewer.zoomTo(viewer.entities);
// viewer.zoomTo(viewer.entities);
viewer.baseLayerPicker.viewModel.selectedImagery = viewer.baseLayerPicker.viewModel.imageryProviderViewModels[4];
</script>
</body>

Loading…
Cancel
Save