Cesium integration helpers for OGC GeoPose.
npm install cesium-geoposeCesium integration helpers for OGC GeoPose. This package is the home for a
lightweight adapter API and a GeoPoseController wrapper for Cesium. It also
re-exports GeoPose types from geopose-lib so downstream projects can share
common types.
``bash`
npm install cesium geopose-lib cesium-geopose
`ts`
import type { GeoPose, GeoPoseBYPR } from "cesium-geopose";
`ts
import {
getCameraGeoPose,
setCameraGeoPose,
getEntityGeoPose,
setEntityGeoPose,
createEntityFromGeoPose
} from "cesium-geopose";
const pose = getCameraGeoPose(viewer.camera);
setCameraGeoPose(viewer.camera, pose);
const entityPose = getEntityGeoPose(entity);
if (entityPose) {
setEntityGeoPose(entity, entityPose);
}
const { position, orientation } = createEntityFromGeoPose(pose);
viewer.entities.add({ position, orientation });
`
`ts
import { GeoPoseController } from "cesium-geopose";
const geo = new GeoPoseController(viewer);
const cameraPose = geo.getCameraPose();
geo.flyCameraToPose(cameraPose, 2);
``
MIT