cesium-plot-js/examples/index.ts

33 lines
897 B
TypeScript
Raw Normal View History

2023-08-08 07:41:52 +00:00
import CesiumPlot from "../src";
2023-08-08 11:45:54 +00:00
import * as Cesium from "./cesium/index";
2023-08-08 07:41:52 +00:00
2023-08-08 11:45:54 +00:00
let raster = new Cesium.ArcGisMapServerImageryProvider({
url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",
});
const viewer = new Cesium.Viewer("cesiumContainer", {
animation: false,
shouldAnimate: true,
geocoder: false,
homeButton: false,
infoBox: false,
fullscreenButton: false,
sceneModePicker: false,
selectionIndicator: false,
timeline: false,
navigationHelpButton: false,
baseLayerPicker: false,
imageryProvider: raster,
contextOptions: {
requestWebgl2: true,
},
});
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),
});
document.getElementById("drawStraightArrow").onclick = () => {
2023-08-09 09:55:29 +00:00
new CesiumPlot.FineArrow(Cesium, viewer, {});
2023-08-08 11:45:54 +00:00
};