@terra.gl/core 0.0.1-alpha.20 โ†’ 0.0.1-alpha.22

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,218 @@
1
+ # Terra-GL Core
2
+
3
+ <div align="center">
4
+
5
+ **High-Performance WebGL 3D Map Engine Based on Three.js ๐ŸŒ**
6
+
7
+ [![npm version](https://img.shields.io/npm/v/@terra.gl/core.svg)](https://www.npmjs.com/package/@terra.gl/core)
8
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
9
+
10
+ English | [็ฎ€ไฝ“ไธญๆ–‡](./README_CN.md)
11
+
12
+ </div>
13
+
14
+ ---
15
+
16
+ ## ๐Ÿ“– Introduction
17
+
18
+ Terra-GL Core is a modern WebGL 3D map engine built on Three.js. It provides complete GIS visualization capabilities, supporting tile map loading, vector feature rendering, 3D model display, and more. Perfect for building smart cities, digital twins, geographic information systems, and other applications.
19
+
20
+ ### โœจ Core Features
21
+
22
+ - ๐Ÿš€ **High-Performance Rendering** - Built on Three.js WebGL engine, supports large-scale data visualization
23
+ - ๐Ÿ—บ๏ธ **Multi-Source Tile Support** - Compatible with WMTS, ArcGIS, MapBox, Tianditu, and other mainstream tile services
24
+ - ๐Ÿ“ **Rich Feature Types** - Supports points, lines, polygons, labels, models, and other geographic features
25
+ - ๐ŸŽจ **Flexible Style System** - Dynamic style configuration and theme switching
26
+ - ๐ŸŽฏ **Complete Event System** - Rich event mechanisms for map interaction and feature events
27
+ - ๐Ÿ› ๏ธ **Powerful Drawing Tools** - Built-in drawing tools for interactive creation of points, lines, polygons, etc.
28
+ - ๐ŸŒˆ **3D Effect Enhancement** - Supports skybox, shadows, HDR, clouds, and other visual effects
29
+ - ๐Ÿ“ฑ **UI Component System** - Provides info windows, tooltips, and other common UI components
30
+ - ๐Ÿ”ง **Collision Detection** - Smart label avoidance for optimized dense feature display
31
+ - ๐Ÿ“ฆ **Modular Design** - Clear code structure, easy to extend and maintain
32
+
33
+ ---
34
+
35
+ ## ๐ŸŒŸ Why Choose Terra-GL
36
+
37
+ ### ๐Ÿ’ช Technical Advantages
38
+
39
+ **1. Native Three.js Architecture**
40
+ - Fully built on Three.js with no additional rendering layer abstraction
41
+ - Direct access to Three.js scene objects for free extension
42
+ - Full utilization of WebGL performance advantages
43
+ - Seamless integration with Three.js ecosystem
44
+
45
+ **2. Professional GIS Capabilities**
46
+ - Support for multiple coordinate systems and projection transformations (Web Mercator, WGS84, etc.)
47
+ - Complete tile map system supporting massive data loading
48
+ - Compatible with mainstream map services (WMTS, ArcGIS, MapBox, Tianditu)
49
+ - Vector tile (MVT) rendering support
50
+
51
+ **3. Rich Visualization Capabilities**
52
+ - Unified management of 2D vector features (points, lines, polygons) and 3D models
53
+ - GLTF/GLB model loading with Draco compression
54
+ - Real-time shadows, HDR environment lighting, post-processing effects
55
+ - Particle clouds, water ripples, and other special effects support
56
+
57
+ **4. Flexible Interactive Experience**
58
+ - Complete event system (map events, feature events)
59
+ - Built-in drawing tools supporting points, lines, polygons, circles, etc.
60
+ - Smart collision detection and label avoidance
61
+ - Info windows, tooltips, and other UI components
62
+
63
+ **5. Developer Friendly**
64
+ - Written in TypeScript with complete type definitions
65
+ - Clear modular design, easy to understand and extend
66
+ - Rich examples and documentation
67
+ - Supports both ES Module and UMD module formats
68
+
69
+ ### ๐Ÿ’ก Use Cases
70
+
71
+ | Category | Typical Applications | Core Capabilities |
72
+ |---------|---------|----------|
73
+ | **๐Ÿ™๏ธ Smart City** | Urban 3D modeling, BIM display, planning comparison | Large-scale model rendering, LOD control, layer management |
74
+ | **๐Ÿ”ฎ Digital Twin** | Industrial parks, smart buildings, equipment monitoring | Real-time data binding, dynamic updates, state visualization |
75
+ | **๐Ÿ—บ๏ธ GIS** | Terrain analysis, resource distribution, pipeline management | Coordinate conversion, spatial query, buffer analysis |
76
+ | **๐Ÿšจ Emergency Command** | Situation display, resource scheduling, route planning | Real-time tracking, heatmaps, dynamic plotting |
77
+
78
+ ### โšก Performance Features
79
+
80
+ - **On-Demand Tile Loading** - Dynamically loads tiles based on viewport, supports tens of thousands of square kilometers of data
81
+ - **LOD Level Control** - Automatically switches model detail based on distance, optimizing rendering performance
82
+ - **Quadtree Spatial Indexing** - Fast query of visible features, improving interaction response speed
83
+ - **WebGL Instanced Rendering** - Batch drawing of identical geometries, reducing draw calls
84
+ - **Collision Avoidance Optimization** - Intelligently hides overlapping labels, keeping interface clean
85
+
86
+ ---
87
+
88
+ ## ๐Ÿ“š Core Module Overview
89
+
90
+ ### ๐Ÿ—๏ธ Core Architecture
91
+ - **๐Ÿ—บ๏ธ Map** - Map container, unified management of layers, views, events
92
+ - **๐Ÿ‘๏ธ Viewer** - Three.js-based rendering engine, manages scenes, cameras, lighting
93
+ - **๐Ÿ“š Layer System** - Layered management of tiles, vectors, models, and other data
94
+ - **๐Ÿ“ Feature** - Abstraction of geographic elements such as points, lines, polygons, models
95
+ - **๐Ÿ”ฒ TileSystem** - Dynamic loading system supporting multi-source tiles like WMTS, ArcGIS
96
+
97
+ ### ๐Ÿ”‘ Key Features
98
+ - **โšก Event System** - Complete map/feature-level event mechanism
99
+ - **โœ๏ธ Drawing Tools** - Built-in interactive drawing (points, lines, polygons, circles, etc.)
100
+ - **๐ŸŽจ UI Components** - InfoWindow, ToolTip, and other common components
101
+ - **๐ŸŽฏ Collision Detection** - Smart label avoidance, optimized dense scene display
102
+ - **๐ŸŽญ Style System** - Unified vector/model style configuration
103
+
104
+ [View Detailed API Documentation โ†’](link-to-detailed-docs)
105
+
106
+ ---
107
+ ## ๐Ÿš€ Quick Start
108
+
109
+ ### ๐Ÿ“ฆ Installation
110
+
111
+ ```bash
112
+ npm install @terra.gl/core three@^0.171.0
113
+ ```
114
+
115
+ ### โšก 5-Minute Guide
116
+
117
+ ```javascript
118
+ import * as terra from '@terra.gl/core';
119
+
120
+ // Create map
121
+ const map = new terra.Map('#map', {
122
+ center: [116.397428, 39.90923, 1000], // [longitude, latitude, camera height]
123
+ basemap: {
124
+ Baselayers: [
125
+ new terra.WMTSTileLayer('base', {
126
+ source: new terra.WMTSSource({
127
+ urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png'
128
+ }),
129
+ projection: terra.ProjectFactory.createFromID('3857', 0)
130
+ })
131
+ ],
132
+ minLevel: 1,
133
+ maxLevel: 18
134
+ }
135
+ });
136
+
137
+ // Add label
138
+ const label = new terra.Label({
139
+ geometry: { type: 'Point', coordinates: [116.397428, 39.90923, 0] },
140
+ style: { text: 'Tiananmen Square', fontSize: 16, fontColor: '#ffffff' }
141
+ });
142
+
143
+ const pointLayer = new terra.PointLayer('points');
144
+ map.addLayer(pointLayer);
145
+ label.addTo(pointLayer);
146
+ ```
147
+
148
+ See the `example/` directory for more examples.
149
+
150
+
151
+
152
+ ---
153
+
154
+ ## ๐Ÿ”ง Development
155
+
156
+ ### ๐Ÿ”จ Build
157
+
158
+ ```bash
159
+ # Development mode (watch file changes)
160
+ npm run dev
161
+
162
+ # Production build
163
+ npm run build
164
+
165
+ # Generate API documentation
166
+ npm run doc
167
+ ```
168
+
169
+ ### ๐Ÿ“‚ Project Structure
170
+
171
+ ```
172
+ packages/core/
173
+ โ”œโ”€โ”€ src/ # Source code
174
+ โ”œโ”€โ”€ dist/ # Compiled output
175
+ โ”œโ”€โ”€ docs/ # API documentation
176
+ โ”œโ”€โ”€ assets/ # Asset files
177
+ โ”œโ”€โ”€ package.json # Package configuration
178
+ โ”œโ”€โ”€ tsconfig.json # TypeScript configuration
179
+ โ”œโ”€โ”€ vite.config.ts # Vite build configuration
180
+ โ””โ”€โ”€ typedoc.json # Documentation generation configuration
181
+ ```
182
+
183
+ ---
184
+
185
+ ## ๐Ÿ“ Examples
186
+
187
+ See the `example/` directory for more complete examples:
188
+
189
+ - **1.้ƒ‘ๅทžๅคœๆ™ฏ.html** - City night scene effects
190
+ - **2.ๅœฐๅ›พไบ‹ไปถ.html** - Map interaction events
191
+ - **3.่ฆ็ด ไบ‹ไปถ.html** - Feature event handling
192
+ - **4.็›ธๆœบ้ฃž่กŒ.html** - Camera animation flight
193
+ - **5.็ป˜ๅˆถๅทฅๅ…ท.html** - Interactive drawing tools
194
+ - **6.ๅœฐๅ›พไฟกๆฏๆก†.html** - Map info window
195
+ - **7.่ฆ็ด ไฟกๆฏๆก†.html** - Feature info display
196
+ - **8.่‡ชๅฎšไน‰็š„ไฟกๆฏๆก†.html** - Custom UI components
197
+
198
+ ---
199
+
200
+ ## ๐Ÿค Contributing
201
+
202
+ Issues and Pull Requests are welcome!
203
+
204
+ ---
205
+
206
+ ## ๐Ÿ”— Related Links
207
+
208
+ - [Three.js Official Website](https://threejs.org/)\
209
+ - [GeoJSON Specification](https://geojson.org/)
210
+ - [WMTS Standard](https://www.ogc.org/standards/wmts)
211
+ <!-- - [three-tile Website](https://sxguojf.github.io/three-tile-doc/1.introduce/01.whatIs/) -->
212
+ ---
213
+
214
+ <div align="center">
215
+
216
+ **If this project helps you, please give it a โญ๏ธ Star!**
217
+
218
+ </div>
package/dist/index.d.ts CHANGED
@@ -1696,6 +1696,7 @@ export declare interface IconLabelStyle extends BaseStyle {
1696
1696
  fontSize?: number;
1697
1697
  /** ๅญ—ไฝ“ๅฎถๆ— */
1698
1698
  fontFamily?: string;
1699
+ fontWeight?: number;
1699
1700
  /** ๆ–‡ๅญ—้ขœ่‰ฒ */
1700
1701
  textColor?: string;
1701
1702
  /** ๆ่พน้ขœ่‰ฒ */