@metagl/sdk-render 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,172 @@
1
+ # 地图SDK - 三维地球渲染引擎
2
+
3
+ ![渲染引擎预览](./RenderPreview.png)
4
+
5
+ ## 项目简介
6
+
7
+ 地图SDK是一个基于Cesium的三维地球渲染引擎,提供了丰富的地图操作和数据分析功能。它采用模块化架构,包含多个功能系统,支持地图加载、图层管理、建筑模型展示、测量工具、3D Tiles搜索等功能。
8
+
9
+ ## 核心特性
10
+
11
+ ### 地图渲染
12
+ - 支持多种地图数据源
13
+ - 提供丰富的地图渲染配置选项
14
+ - 支持地图切换和底图控制
15
+
16
+ ### 图层管理
17
+ - 支持影像图层、地形图层、3D Tiles图层等多种类型
18
+ - 提供图层可见性、透明度控制
19
+ - 支持图层添加、移除和查找
20
+
21
+ ### 建筑模型展示
22
+ - 支持加载城市建筑模型
23
+ - 提供城市数据搜索功能
24
+ - 显示生产区域和建筑边界
25
+
26
+ ### 测量工具
27
+ - 直线距离测量
28
+ - 贴地距离测量
29
+ - 面积测量
30
+ - 高度测量
31
+ - 方位测量
32
+
33
+ ### 3D Tiles搜索
34
+ - 属性查询功能
35
+ - 对象高亮显示
36
+ - 3D Tiles模型加载和操作
37
+
38
+ ### 场景控制
39
+ - 地图定位和飞行
40
+ - 场景状态管理
41
+ - 环境特效控制
42
+
43
+ ## 快速开始
44
+
45
+ ### 安装
46
+
47
+ ```bash
48
+ npm install @metagl/sdk-render
49
+ ```
50
+
51
+ ### 初始化
52
+
53
+ ```typescript
54
+ import { Render, RenderConfig } from '@metagl/sdk-render';
55
+ import { Viewer } from 'cesium';
56
+
57
+ // 初始化 Cesium Viewer
58
+ const container = document.getElementById('cesiumContainer');
59
+ const viewer = new Viewer(container);
60
+
61
+ // 配置渲染引擎
62
+ const config: RenderConfig = {
63
+ viewer: viewer,
64
+ token: 'your-access-token' // 访问 LACDT 资源的 token(必填)
65
+ };
66
+
67
+ // 初始化渲染引擎
68
+ const render = new Render(config);
69
+ ```
70
+
71
+ **Token 说明**:
72
+ - `token` 是访问 LACDT 资源的必填参数
73
+
74
+ ### 基本使用
75
+
76
+ ```typescript
77
+ // 更新系统配置
78
+ render.updateSystemConfig('lighting', {
79
+ intensity: 1.2,
80
+ color: Cesium.Color.YELLOW
81
+ });
82
+
83
+ // 启用系统
84
+ render.enableSystem('lighting');
85
+
86
+ // 禁用系统
87
+ render.disableSystem('lighting');
88
+
89
+ // 切换系统状态
90
+ render.toggleSystem('volumetricClouds');
91
+
92
+ // 获取系统配置
93
+ const lightingConfig = render.getSystemConfig('lighting');
94
+ console.log('Lighting config:', lightingConfig);
95
+
96
+ // 获取系统状态
97
+ const shadowStatus = render.getSystemStatus('shadow');
98
+ console.log('Shadow status:', shadowStatus);
99
+
100
+ // 应用环境预设配置
101
+ render.applyPresetConfig({
102
+ time: { hour: 12, minute: 0 },
103
+ lighting: {
104
+ enabled: true,
105
+ intensity: 1.5,
106
+ ambientIntensity: 0.3,
107
+ followSun: true
108
+ },
109
+ shadow: {
110
+ enabled: true,
111
+ darkness: 0.3,
112
+ softShadows: true
113
+ },
114
+ atmosphere: {
115
+ enabled: true,
116
+ intensity: 1.0,
117
+ rayleighIntensity: 1.0,
118
+ mieIntensity: 0.5,
119
+ absorptionIntensity: 0.5
120
+ },
121
+ clouds: {
122
+ enabled: true,
123
+ cover: 0.5,
124
+ base: 2000,
125
+ top: 6000,
126
+ lightIntensity: 5.3,
127
+ windSpeed: 5
128
+ },
129
+ fog: {
130
+ enabled: true,
131
+ type: 'distance' // 'distance' | 'height' | 'both'
132
+ },
133
+ postProcessing: {
134
+ enabled: true,
135
+ brightness: 1.0,
136
+ contrast: 1.0,
137
+ saturation: 1.0,
138
+ gamma: 1.0
139
+ }
140
+ });
141
+
142
+ // 获取调试信息
143
+ const debugInfo = render.getDebugInfo();
144
+ console.log('Debug info:', debugInfo);
145
+ ```
146
+
147
+ ## 系统架构
148
+
149
+ SDK渲染引擎采用模块化架构,包含以下系统:
150
+
151
+ ### 渲染系统
152
+ - **光照系统**:负责管理场景的光照
153
+ - **阴影系统**:负责管理场景的阴影
154
+ - **大气散射系统**:负责管理大气散射效果
155
+ - **距离雾系统**:负责管理距离雾效果
156
+ - **高度雾系统**:负责管理高度雾效果
157
+ - **体积云系统**:负责管理体积云效果
158
+ - **后处理系统**:负责管理后处理效果
159
+ - **水体系统**:负责管理水体效果
160
+
161
+ ### 业务系统
162
+ - **场景系统**:处理地名搜索和瓦片号查询定位的业务逻辑
163
+ - **建筑系统**:负责管理和加载城市建筑模型
164
+ - **图层系统**:负责管理Cesium场景中的各种图层以及实体和图元对象
165
+ - **工具箱系统**:管理和执行各种工具,包含测量工具、地理数据处理工具等
166
+ - **测量系统**:用于在三维场景中进行各种测量操作
167
+ - **3DTiles搜索系统**:处理3D Tiles模型搜索和信息展示
168
+
169
+ ## 联系方式
170
+
171
+ - **官方文档**:https://sdk.geovisearth.com/
172
+ - **邮箱支持**:sunyc@geovis.com.cn
package/README_EN.md ADDED
@@ -0,0 +1,172 @@
1
+ # Map SDK - 3D Earth Rendering Engine
2
+
3
+ ![Rendering Engine Preview](./RenderPreview.png)
4
+
5
+ ## Project Introduction
6
+
7
+ The Map SDK is a 3D Earth rendering engine based on Cesium, providing rich map operations and data analysis capabilities. It adopts a modular architecture with multiple functional systems, supporting map loading, layer management, building model display, measurement tools, 3D Tiles search, and more.
8
+
9
+ ## Core Features
10
+
11
+ ### Map Rendering
12
+ - Support for multiple map data sources
13
+ - Rich map rendering configuration options
14
+ - Map switching and base map control
15
+
16
+ ### Layer Management
17
+ - Support for image layers, terrain layers, 3D Tiles layers, and more
18
+ - Layer visibility and transparency control
19
+ - Layer addition, removal, and search
20
+
21
+ ### Building Model Display
22
+ - Support for loading city building models
23
+ - City data search functionality
24
+ - Display of production areas and building boundaries
25
+
26
+ ### Measurement Tools
27
+ - Straight-line distance measurement
28
+ - Ground-adhering distance measurement
29
+ - Area measurement
30
+ - Height measurement
31
+ - Azimuth measurement
32
+
33
+ ### 3D Tiles Search
34
+ - Attribute query functionality
35
+ - Object highlighting display
36
+ - 3D Tiles model loading and operation
37
+
38
+ ### Scene Control
39
+ - Map positioning and flight
40
+ - Scene state management
41
+ - Environmental effect control
42
+
43
+ ## Quick Start
44
+
45
+ ### Installation
46
+
47
+ ```bash
48
+ npm install @metagl/sdk-render
49
+ ```
50
+
51
+ ### Initialization
52
+
53
+ ```typescript
54
+ import { Render, RenderConfig } from '@metagl/sdk-render';
55
+ import { Viewer } from 'cesium';
56
+
57
+ // Initialize Cesium Viewer
58
+ const container = document.getElementById('cesiumContainer');
59
+ const viewer = new Viewer(container);
60
+
61
+ // Configure rendering engine
62
+ const config: RenderConfig = {
63
+ viewer: viewer,
64
+ token: 'your-access-token' // Token for accessing LACDT resources (required)
65
+ };
66
+
67
+ // Initialize rendering engine
68
+ const render = new Render(config);
69
+ ```
70
+
71
+ **Token Description**:
72
+ - `token` is a required parameter for accessing LACDT resources
73
+
74
+ ### Basic Usage
75
+
76
+ ```typescript
77
+ // Update system configuration
78
+ render.updateSystemConfig('lighting', {
79
+ intensity: 1.2,
80
+ color: Cesium.Color.YELLOW
81
+ });
82
+
83
+ // Enable system
84
+ render.enableSystem('lighting');
85
+
86
+ // Disable system
87
+ render.disableSystem('lighting');
88
+
89
+ // Toggle system state
90
+ render.toggleSystem('volumetricClouds');
91
+
92
+ // Get system configuration
93
+ const lightingConfig = render.getSystemConfig('lighting');
94
+ console.log('Lighting config:', lightingConfig);
95
+
96
+ // Get system status
97
+ const shadowStatus = render.getSystemStatus('shadow');
98
+ console.log('Shadow status:', shadowStatus);
99
+
100
+ // Apply environment preset configuration
101
+ render.applyPresetConfig({
102
+ time: { hour: 12, minute: 0 },
103
+ lighting: {
104
+ enabled: true,
105
+ intensity: 1.5,
106
+ ambientIntensity: 0.3,
107
+ followSun: true
108
+ },
109
+ shadow: {
110
+ enabled: true,
111
+ darkness: 0.3,
112
+ softShadows: true
113
+ },
114
+ atmosphere: {
115
+ enabled: true,
116
+ intensity: 1.0,
117
+ rayleighIntensity: 1.0,
118
+ mieIntensity: 0.5,
119
+ absorptionIntensity: 0.5
120
+ },
121
+ clouds: {
122
+ enabled: true,
123
+ cover: 0.5,
124
+ base: 2000,
125
+ top: 6000,
126
+ lightIntensity: 5.3,
127
+ windSpeed: 5
128
+ },
129
+ fog: {
130
+ enabled: true,
131
+ type: 'distance' // 'distance' | 'height' | 'both'
132
+ },
133
+ postProcessing: {
134
+ enabled: true,
135
+ brightness: 1.0,
136
+ contrast: 1.0,
137
+ saturation: 1.0,
138
+ gamma: 1.0
139
+ }
140
+ });
141
+
142
+ // Get debug information
143
+ const debugInfo = render.getDebugInfo();
144
+ console.log('Debug info:', debugInfo);
145
+ ```
146
+
147
+ ## System Architecture
148
+
149
+ The SDK rendering engine adopts a modular architecture, including the following systems:
150
+
151
+ ### Rendering Systems
152
+ - **Lighting System**: Manages scene lighting
153
+ - **Shadow System**: Manages scene shadows
154
+ - **Atmospheric Scattering System**: Manages atmospheric scattering effects
155
+ - **Distance Fog System**: Manages distance fog effects
156
+ - **Height Fog System**: Manages height fog effects
157
+ - **Volumetric Clouds System**: Manages volumetric cloud effects
158
+ - **Post-Processing System**: Manages post-processing effects
159
+ - **Water System**: Manages water body effects
160
+
161
+ ### Business Systems
162
+ - **Scene System**: Handles place name search and tile number query positioning business logic
163
+ - **Building System**: Manages and loads city building models
164
+ - **Layer System**: Manages various layers, entities, and primitives in the Cesium scene
165
+ - **Toolbox System**: Manages and executes various tools, including measurement tools, geographic data processing tools, etc.
166
+ - **Measurement System**: Performs various measurement operations in 3D scenes
167
+ - **3DTiles Search System**: Handles 3D Tiles model search and information display
168
+
169
+ ## Contact Information
170
+
171
+ - **Official Documentation**: https://sdk.geovisearth.com/
172
+ - **Email Support**: sunyc@geovis.com.cn
Binary file