{"_id":"@agent-earth/smart-earth","_rev":"6-0c573f79d5c723642baeab9cfab84ffe","name":"@agent-earth/smart-earth","dist-tags":{"latest":"0.0.7"},"versions":{"0.0.4":{"name":"@agent-earth/smart-earth","version":"0.0.4","_id":"@agent-earth/smart-earth@0.0.4","maintainers":[{"name":"asun01","email":"452212601@qq.com"}],"dist":{"shasum":"08d081836f5602ef615f9f9d3cec599359473b3b","tarball":"https://registry.npmjs.org/@agent-earth/smart-earth/-/smart-earth-0.0.4.tgz","fileCount":42,"integrity":"sha512-z6ZEQpzTv30Dh5wpFuirXfKcVreI9TtCofJ6iHCX6hGeeewIJ9ojaPV5R5JusExXsPuZa6txVwjPjFzAaJWqJw==","signatures":[{"sig":"MEYCIQDtw4gQ8YWg0zKwhewkV7rQciPJR9YsA6DYq4Unes2MngIhAPqs1LQDaWCB4EiqUuldg3heTZDdh+LjXw99gzSSJ8bP","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":176022},"main":"./dist/index.js","type":"module","_from":"file:agent-earth-smart-earth-0.0.4.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc --watch","build":"pnpm clean && tsc && node ../../scripts/minify-dist-js.mjs dist","clean":"rimraf dist tsconfig.tsbuildinfo","typecheck":"tsc --noEmit"},"_npmUser":{"name":"asun01","email":"452212601@qq.com"},"_resolved":"C:\\Users\\Lenovo\\AppData\\Local\\Temp\\4417b8b9d583a95bde7b5dfbb555160b\\agent-earth-smart-earth-0.0.4.tgz","_integrity":"sha512-z6ZEQpzTv30Dh5wpFuirXfKcVreI9TtCofJ6iHCX6hGeeewIJ9ojaPV5R5JusExXsPuZa6txVwjPjFzAaJWqJw==","_npmVersion":"10.9.4","description":"智能地球交互插件 - 可被任意Web系统引用的Cesium控制插件。","directories":{},"_nodeVersion":"22.22.0","dependencies":{"ws":"^8.18.0","cesium":"^1.123.0","heatmap.js":"^2.0.5","@agent-earth/shared":"0.0.4"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.0","@types/ws":"^8.5.0","typescript":"^5.8.0","@types/node":"^22.0.0","@vitejs/plugin-react":"^4.3.0"},"_npmOperationalInternal":{"tmp":"tmp/smart-earth_0.0.4_1782906505080_0.5639615673530187","host":"s3://npm-registry-packages-npm-production"}},"0.0.7":{"name":"@agent-earth/smart-earth","version":"0.0.7","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","publishConfig":{"registry":"https://geocode.geovisearth.com/api/v4/projects/633/packages/npm/"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./ui":{"types":"./dist/ui/index.d.ts","import":"./dist/ui/index.js"},"./ui/style.css":"./dist/ui/style.css"},"dependencies":{"cesium":"^1.123.0","heatmap.js":"^2.0.5","ws":"^8.18.0","@agent-earth/shared":"0.0.7"},"devDependencies":{"typescript":"^5.8.0","@types/node":"^22.0.0","@types/ws":"^8.5.0","vite":"^6.0.0","@vitejs/plugin-vue":"^5.2.0","@metagl/sdk-render":"https://geocode.geovisearth.com/api/v4/projects/633/packages/npm/@metagl/sdk-render/-/@metagl/sdk-render-3.0.0.tgz","vue":"^3.5.0","vue-tsc":"^2.2.0"},"peerDependencies":{"@metagl/sdk-render":"^3.0.0","vue":"^3.5.0"},"peerDependenciesMeta":{"@metagl/sdk-render":{"optional":true},"vue":{"optional":true}},"scripts":{"build":"pnpm clean && pnpm build:server && pnpm build:ui","build:server":"tsc","build:ui":"rimraf dist/ui && vue-tsc -p tsconfig.ui.json --declaration --emitDeclarationOnly --noEmit false && vite build","dev":"tsc --watch","clean":"rimraf dist tsconfig.tsbuildinfo","typecheck":"vue-tsc -p tsconfig.typecheck.json"},"_id":"@agent-earth/smart-earth@0.0.7","description":"智能地球交互插件 - 可被任意Web系统引用的Cesium控制插件。","_integrity":"sha512-TAOL5/xkIHSrRW3neQh6CR9E+ujd4HJbRwHDM5Vuu6iWTx01kKWrYMk10jte8jL4DNfFY2Df7lnh36AHLx+CRw==","_resolved":"C:\\Users\\Lenovo\\AppData\\Local\\Temp\\agent-earth-npm-publish-1786446964\\agent-earth-smart-earth-0.0.7.tgz","_from":"file:C:/Users/Lenovo/AppData/Local/Temp/agent-earth-npm-publish-1786446964/agent-earth-smart-earth-0.0.7.tgz","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-TAOL5/xkIHSrRW3neQh6CR9E+ujd4HJbRwHDM5Vuu6iWTx01kKWrYMk10jte8jL4DNfFY2Df7lnh36AHLx+CRw==","shasum":"7fd74c1e826834316d2eeb03b3ade4674d88de0c","tarball":"https://registry.npmjs.org/@agent-earth/smart-earth/-/smart-earth-0.0.7.tgz","fileCount":114,"unpackedSize":400827,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCGu8igdS6OvgzZBMrJrUUlMkfPt/u5WyGsEd0vuepNWQIhANLokenCTGIQv8Zmux6ibuSmJHv3bs/1Cb7XlE0gFZCJ"}]},"_npmUser":{"name":"asun01","email":"452212601@qq.com"},"directories":{},"maintainers":[{"name":"asun01","email":"452212601@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/smart-earth_0.0.7_1786447369164_0.954573093843252"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-01T09:58:47.346Z","modified":"2026-08-11T11:22:49.467Z","0.0.2":"2026-07-01T09:58:47.742Z","0.0.3":"2026-07-01T11:25:09.481Z","0.0.4":"2026-07-01T11:48:25.244Z","0.0.7":"2026-08-11T11:22:49.312Z"},"description":"智能地球交互插件 - 可被任意Web系统引用的Cesium控制插件。","maintainers":[{"name":"asun01","email":"452212601@qq.com"}],"readme":"# @agent-earth/smart-earth\n\n智能地球交互插件 - 可被任意Web系统引用的Cesium控制插件。\n\n## 安装\n\n```bash\nnpm install @agent-earth/smart-earth\n```\n\n## 快速开始\n\n### 1. 初始化SDK\n\n```typescript\nimport { createSmartEarthSDK } from \"@agent-earth/smart-earth\";\n\nconst sdk = createSmartEarthSDK({\n  container: \"cesium-container\", // DOM元素ID或HTMLElement\n  ionToken: \"your-cesium-ion-token\",\n  logLevel: \"info\",\n});\n\nawait sdk.initialize();\n```\n\n### 2. 添加标注\n\n```typescript\nsdk.addMarker({\n  id: \"marker-1\",\n  position: { longitude: 116.3, latitude: 39.9, altitude: 0 },\n  label: \"北京\",\n  description: \"中国首都\",\n});\n```\n\n### 3. 绘制轨迹\n\n```typescript\nsdk.drawTrajectory({\n  id: \"trajectory-1\",\n  positions: [\n    { longitude: 116.3, latitude: 39.9, altitude: 1000 },\n    { longitude: 121.5, latitude: 31.2, altitude: 1000 },\n  ],\n  style: { color: \"#FF0000\", width: 2 },\n});\n```\n\n### 4. WebSocket命令处理\n\n```typescript\nimport { createWSCommandHandler } from \"@agent-earth/smart-earth\";\n\nconst handler = createWSCommandHandler({\n  sdk,\n  port: 8080,\n  host: \"localhost\",\n  path: \"/cesium\",\n});\n\nawait handler.start();\n```\n\n## API文档\n\n### SmartEarthSDK\n\n主SDK类，提供Cesium地图操作接口。\n\n| 方法 | 说明 |\n|------|------|\n| `initialize()` | 初始化Cesium Viewer |\n| `destroy()` | 销毁SDK |\n| `addMarker(marker)` | 添加标注点 |\n| `removeMarker(id)` | 移除标注点 |\n| `updateMarker(id, updates)` | 更新标注点 |\n| `drawTrajectory(trajectory)` | 绘制轨迹线 |\n| `removeTrajectory(id)` | 移除轨迹线 |\n| `drawRegion(region)` | 绘制区域 |\n| `removeRegion(id)` | 移除区域 |\n| `highlightRegion(id)` | 高亮区域 |\n| `setView(view)` | 设置视角 |\n| `flyTo(view, duration)` | 飞行到视角 |\n| `addLayer(layer)` | 添加图层 |\n| `removeLayer(id)` | 移除图层 |\n| `clearAll()` | 清除所有实体 |\n| `processCommand(command)` | 处理命令 |\n\n### InterfaceAdapter\n\n命令适配器，将标准化指令转换为Cesium API调用。\n\n```typescript\nimport { createInterfaceAdapter } from \"@agent-earth/smart-earth\";\n\nconst adapter = createInterfaceAdapter({ sdk });\nconst result = adapter.execute({\n  type: \"add_marker\",\n  parameters: { id: \"m1\", position: { longitude: 116, latitude: 40 } },\n});\n```\n\n### WSCommandHandler\n\nWebSocket命令处理器，接收远程命令并执行。\n\n支持的命令类型:\n- `cesium_command` - 单条命令\n- `cesium_command_batch` - 批量命令\n\n## 渲染器\n\n### MarkerRenderer\n标注点渲染器，支持自定义图标、标签、颜色。\n\n### TrajectoryRenderer\n轨迹渲染器，支持线宽、颜色、动态效果。\n\n### RegionRenderer\n区域渲染器，支持填充、边框、高亮效果。\n\n## 依赖\n\n- `cesium` >= 1.123.0\n- `@agent-earth/shared` (workspace)\n\n## 许可证\n\nMIT","readmeFilename":"README.md"}