2023-08-16 08:17:33 +00:00
|
|
|
import CesiumPlot from '../src';
|
2023-08-14 09:47:59 +00:00
|
|
|
// import CesiumPlot from "../dist/CesiumPlot";
|
2023-08-16 08:17:33 +00:00
|
|
|
import * as Cesium from './cesium/index';
|
2023-08-08 07:41:52 +00:00
|
|
|
|
2023-08-14 09:47:59 +00:00
|
|
|
// let raster = new Cesium.ArcGisMapServerImageryProvider({
|
|
|
|
// url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",
|
|
|
|
// });
|
|
|
|
|
|
|
|
let keda = new Cesium.UrlTemplateImageryProvider({
|
2023-08-16 08:17:33 +00:00
|
|
|
url: 'https://10.68.8.41:9043/kmap-server/gridMap/tile/{z}/{y}/{x}',
|
2023-08-14 09:47:59 +00:00
|
|
|
// url: 'http://10.68.8.58:8080/3d/dom2/{z}/{x}/{y}.png'
|
2023-08-08 11:45:54 +00:00
|
|
|
});
|
2023-08-16 08:17:33 +00:00
|
|
|
const viewer = new Cesium.Viewer('cesiumContainer', {
|
2023-08-08 11:45:54 +00:00
|
|
|
animation: false,
|
|
|
|
shouldAnimate: true,
|
|
|
|
geocoder: false,
|
|
|
|
homeButton: false,
|
|
|
|
infoBox: false,
|
|
|
|
fullscreenButton: false,
|
|
|
|
sceneModePicker: false,
|
|
|
|
selectionIndicator: false,
|
|
|
|
timeline: false,
|
|
|
|
navigationHelpButton: false,
|
|
|
|
baseLayerPicker: false,
|
2023-08-14 09:47:59 +00:00
|
|
|
// imageryProvider: raster,
|
|
|
|
imageryProvider: keda,
|
2023-08-08 11:45:54 +00:00
|
|
|
contextOptions: {
|
|
|
|
requestWebgl2: true,
|
|
|
|
},
|
2023-08-21 05:47:28 +00:00
|
|
|
// msaaSamples: 4,
|
2023-08-08 11:45:54 +00:00
|
|
|
});
|
2023-08-08 07:41:52 +00:00
|
|
|
|
2023-08-09 09:55:29 +00:00
|
|
|
viewer.scene.postProcessStages.fxaa.enabled = true;
|
2023-08-08 11:45:54 +00:00
|
|
|
viewer.scene.camera.setView({
|
|
|
|
destination: Cesium.Cartesian3.fromDegrees(107.857, 35.594498, 8000000),
|
|
|
|
});
|
|
|
|
|
2023-08-16 08:17:33 +00:00
|
|
|
const fineArrow = document.getElementById('drawFineArrow') as HTMLElement;
|
|
|
|
fineArrow.onclick = () => {
|
2023-08-09 09:55:29 +00:00
|
|
|
new CesiumPlot.FineArrow(Cesium, viewer, {});
|
2023-08-08 11:45:54 +00:00
|
|
|
};
|
2023-08-16 08:17:33 +00:00
|
|
|
|
|
|
|
const attackArrow = document.getElementById('drawAttackArrow') as HTMLElement;
|
|
|
|
attackArrow.onclick = () => {
|
|
|
|
new CesiumPlot.AttackArrow(Cesium, viewer, {});
|
2023-08-18 02:23:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const swallowtailAttackArrow = document.getElementById('drawSwallowtailAttackArrow') as HTMLElement;
|
|
|
|
swallowtailAttackArrow.onclick = () => {
|
|
|
|
new CesiumPlot.SwallowtailAttackArrow(Cesium, viewer, {});
|
|
|
|
};
|
2023-08-18 03:42:30 +00:00
|
|
|
|
|
|
|
const squadCombat = document.getElementById('drawSquadCombat') as HTMLElement;
|
|
|
|
squadCombat.onclick = () => {
|
|
|
|
new CesiumPlot.SquadCombat(Cesium, viewer, {});
|
|
|
|
};
|
2023-08-21 02:35:03 +00:00
|
|
|
|
|
|
|
const swallowtailSquadCombat = document.getElementById('drawSwallowtailSquadCombat') as HTMLElement;
|
|
|
|
swallowtailSquadCombat.onclick = () => {
|
|
|
|
new CesiumPlot.SwallowtailSquadCombat(Cesium, viewer, {});
|
|
|
|
};
|
2023-08-21 05:47:28 +00:00
|
|
|
|
|
|
|
const straightArrow = document.getElementById('drawStraightArrow') as HTMLElement;
|
|
|
|
straightArrow.onclick = () => {
|
|
|
|
new CesiumPlot.StraightArrow(Cesium, viewer, {});
|
|
|
|
};
|
2023-08-21 06:40:37 +00:00
|
|
|
|
|
|
|
const assaultDirection = document.getElementById('drawAssaultDirection') as HTMLElement;
|
|
|
|
assaultDirection.onclick = () => {
|
|
|
|
new CesiumPlot.AssaultDirection(Cesium, viewer, {});
|
|
|
|
};
|
2023-08-21 10:02:00 +00:00
|
|
|
|
|
|
|
const curvedArrow = document.getElementById('drawCurvedArrow') as HTMLElement;
|
|
|
|
curvedArrow.onclick = () => {
|
|
|
|
new CesiumPlot.CurvedArrow(Cesium, viewer, {});
|
|
|
|
};
|