cesium-expert
9
总安装量
4
周安装量
#32720
全站排名
安装命令
npx skills add https://github.com/pluxity/pf-frontend --skill cesium-expert
Agent 安装分布
opencode
3
gemini-cli
3
github-copilot
3
codex
3
antigravity
2
kimi-cli
2
Skill 文档
Cesium ì 문ê°
$ARGUMENTS CesiumJS ê´ë ¨ ì§ë¬¸ì ëµë³íê³ êµ¬íì ëìë립ëë¤.
@pf-dev/map í¨í¤ì§ 구조
packages/map/src/
âââ components/
â âââ MapViewer.tsx # ë©ì¸ ë·°ì´ ì»´í¬ëí¸
â âââ Imagery.tsx # ì´ë¯¸ì§ ë ì´ì´
â âââ Terrain.tsx # ì§í
â âââ Tiles3D.tsx # 3D íì¼ì
âââ stores/
â âââ useMapStore.ts # ì§ë ìí
â âââ useCameraStore.ts # ì¹´ë©ë¼ ìí
â âââ useFeatureStore.ts # Feature ê´ë¦¬
âââ hooks/
â âââ useCamera.ts # ì¹´ë©ë¼ ì ì´
âââ types/
âââ index.ts
주ì í¨í´
MapViewer ì¬ì©
import { MapViewer, Imagery, Terrain } from "@pf-dev/map";
function Map() {
return (
<MapViewer
options={{
baseLayerPicker: false,
geocoder: false,
}}
>
<Imagery provider="vworld" />
<Terrain provider="cesium-world" />
</MapViewer>
);
}
ì¹´ë©ë¼ ì ì´
import { useCameraStore } from "@pf-dev/map";
function Controls() {
const { flyTo, lookAt, zoomTo } = useCameraStore();
const handleFlyToSeoul = () => {
flyTo({
destination: Cesium.Cartesian3.fromDegrees(126.978, 37.5665, 10000),
duration: 2,
});
};
return <button onClick={handleFlyToSeoul}>ìì¸ë¡ ì´ë</button>;
}
Feature ê´ë¦¬
import { useFeatureStore } from "@pf-dev/map";
function FeatureManager() {
const { addEntity, removeEntity, findByProperty } = useFeatureStore();
const addMarker = (position: Cesium.Cartesian3) => {
addEntity({
id: `marker-${Date.now()}`,
position,
billboard: {
image: "/marker.png",
scale: 1,
},
properties: {
type: "cctv",
name: "CCTV 1",
},
});
};
const findCCTVs = () => {
return findByProperty("type", "cctv");
};
}
ì주 묻ë ì§ë¬¸
Q: ì±ë¥ì´ ëë ¤ì
A: ìµì í ë°©ë²
requestRenderMode: trueì¤ì (íìí ëë§ ë ë)- 3D íì¼ì LOD ì¤ì
- ìí°í° ì ì í (1000ê° ì´ìì´ë©´ Primitive ì¬ì©)
show: falseë¡ ì¨ê¸´ ìí°í° ì 리
<MapViewer
options={{
requestRenderMode: true,
maximumRenderTimeChange: Infinity,
}}
/>
Q: ì´ë¯¸ì§ ë ì´ì´ ì ë³´ì¬ì
A: í í° íì¸
VITE_ION_CESIUM_ACCESS_TOKEN=your-token
VITE_VWORLD_API_KEY=your-key
Q: ì¹´ë©ë¼ê° ì§íë¡ ë¤ì´ê°ì
A: ì§í ì¶©ë ì¤ì
viewer.scene.globe.depthTestAgainstTerrain = true;
viewer.scene.screenSpaceCameraController.enableCollisionDetection = true;
Q: í´ë¦ ì´ë²¤í¸ ì²ë¦¬
import { useMapStore } from "@pf-dev/map";
function ClickHandler() {
const viewer = useMapStore((state) => state.viewer);
useEffect(() => {
if (!viewer) return;
const handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
handler.setInputAction((click: { position: Cesium.Cartesian2 }) => {
const picked = viewer.scene.pick(click.position);
if (Cesium.defined(picked)) {
console.log("Picked:", picked.id);
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
return () => handler.destroy();
}, [viewer]);
}
ì¢í ë³í
// ìê²½ë â Cartesian3
const position = Cesium.Cartesian3.fromDegrees(126.978, 37.5665, 100);
// Cartesian3 â ìê²½ë
const cartographic = Cesium.Cartographic.fromCartesian(position);
const lng = Cesium.Math.toDegrees(cartographic.longitude);
const lat = Cesium.Math.toDegrees(cartographic.latitude);
const height = cartographic.height;
// íë©´ ì¢í â Cartesian3
const cartesian = viewer.camera.pickEllipsoid(screenPosition, viewer.scene.globe.ellipsoid);
3D íì¼ì ë¡ë©
import { Tiles3D } from "@pf-dev/map";
<Tiles3D
url="/tiles/building/tileset.json"
onReady={(tileset) => {
viewer.zoomTo(tileset);
}}
style={{
color: {
conditions: [
["${height} > 100", "color('red')"],
["true", "color('white')"],
],
},
}}
/>;
Context7 ì°¸ê³
CesiumJS ìµì APIê° íìíë©´ Context7ë¡ ì¡°ííì¸ì.