@vcmap/core 6.3.0-rc.2 → 6.3.0-rc.3
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 +24 -23
- package/dist/src/layer/i3sLayer.d.ts +2 -10
- package/dist/src/layer/i3sLayer.js +9 -8
- package/dist/src/layer/i3sLayer.js.map +1 -1
- package/package.json +1 -1
- package/src/layer/i3sLayer.ts +12 -14
package/README.md
CHANGED
|
@@ -16,10 +16,10 @@ them redundantly and based on different technologies.
|
|
|
16
16
|
Allows rendering content on three different maps. This allows to select the best technology for a specific usecase, but
|
|
17
17
|
still work with the same API.
|
|
18
18
|
|
|
19
|
-
- 2D Map using
|
|
20
|
-
- 3D Map using
|
|
21
|
-
- Oblique Map using
|
|
22
|
-
- Panorama Map using
|
|
19
|
+
- 2D Map using OpenLayers
|
|
20
|
+
- 3D Map using CesiumJS
|
|
21
|
+
- Oblique Map using OpenLayers
|
|
22
|
+
- Panorama Map using CesiumJS
|
|
23
23
|
|
|
24
24
|
## [VcsApp](./documentation/vcsApp.md)
|
|
25
25
|
|
|
@@ -37,6 +37,7 @@ Some layer are map specific and only work for example in 3D. Layers can be creat
|
|
|
37
37
|
|
|
38
38
|
- CesiumTilesetLayer (3D Tiles OGC Community Standard)
|
|
39
39
|
- CzmlLayer Cesium Czml (https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/CZML-Guide)
|
|
40
|
+
- I3SLayer Indexed 3D Scene Layers (https://www.ogc.org/standards/i3s/)
|
|
40
41
|
- PointCloudLayer (using CesiumTilesetLayer)
|
|
41
42
|
- TerrainLayer Cesium Quantized-Mesh (https://github.com/CesiumGS/quantized-mesh)
|
|
42
43
|
|
|
@@ -49,26 +50,26 @@ Some layer are map specific and only work for example in 3D. Layers can be creat
|
|
|
49
50
|
- SingleImageryLayer
|
|
50
51
|
- Vector Tile Layer
|
|
51
52
|
- FlatGeobuf Layer
|
|
52
|
-
-
|
|
53
|
+
- OpenStreetMap Layer
|
|
53
54
|
- PanoramaDataset Layer (shows positions in 2D/3D and the Panorama in the PanoramaMap)
|
|
54
55
|
|
|
55
56
|
#### Supported in 2D, 3D and Oblique
|
|
56
57
|
|
|
57
58
|
- WFS Layer
|
|
58
59
|
- GeoJSON Layer
|
|
59
|
-
- Vector Layer (allows adding Features via API
|
|
60
|
+
- Vector Layer (allows adding Features via API: `layer.addFeature(new Feature({ geometry: new Polygon({...}) }))`)
|
|
60
61
|
|
|
61
|
-
#### FeatureLayer `Vector`, `WFSLayer`, `GeoJSONLayer`, `VectorLayer`, `CesiumTileset`,
|
|
62
|
+
#### FeatureLayer `Vector`, `WFSLayer`, `GeoJSONLayer`, `VectorLayer`, `CesiumTileset`, `FlatGeobufLayer`, `PanoramaDatasetLayer`
|
|
62
63
|
|
|
63
64
|
Layers which provide Features have a common API to hide/highlight/style/access Features.
|
|
64
65
|
|
|
65
66
|
## [Styles](./documentation/style.md)
|
|
66
67
|
|
|
67
68
|
The Core supports two style types. A `DeclarativeStyleItem` using the Cesium [3D Tiles Styling](https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling) language
|
|
68
|
-
and a `VectorStyleItem` which is based on
|
|
69
|
+
and a `VectorStyleItem` which is based on OpenLayers Styling.
|
|
69
70
|
Both Style Items can be serialized to JSON and work for `VectorLayer`, `GeoJSONLayer`, `CesiumTilesetLayer`, `VectorTileLayer`.
|
|
70
71
|
`DeclarativeStyleItem` can be used to style each Feature in a dataset based on attribute values or rules depending on attributes.
|
|
71
|
-
`VectorStyleItem` are best
|
|
72
|
+
`VectorStyleItem` are best for static styling of a complete dataset.
|
|
72
73
|
|
|
73
74
|
## [Configuration Management](./documentation/vcsModule.md)
|
|
74
75
|
|
|
@@ -77,7 +78,7 @@ The core provides a flexible and fully customizable configuration management. It
|
|
|
77
78
|
|
|
78
79
|
## [Interactions API](./documentation/interaction.md)
|
|
79
80
|
|
|
80
|
-
The Interactions API is an abstraction layer to handle map events
|
|
81
|
+
The Interactions API is an abstraction layer to handle map events, for example a click event on the Map.
|
|
81
82
|
This allows for developing applications which work in 2D/3D or oblique.
|
|
82
83
|
|
|
83
84
|
## Workers
|
|
@@ -89,41 +90,41 @@ hosted in the same structure and a relative URL to the workers directory is used
|
|
|
89
90
|
|
|
90
91
|
## Feature Editor API
|
|
91
92
|
|
|
92
|
-
Based on the Interactions API the Feature Editor provides functionality to `create`, `select`, and `transform` Features.
|
|
93
|
+
Based on the Interactions API, the Feature Editor provides functionality to `create`, `select`, and `transform` Features.
|
|
93
94
|
|
|
94
95
|
## Parametrized Features API
|
|
95
96
|
|
|
96
|
-
Vector Features can be shown in a `VectorLayer` or `GeoJSONLayer`. GeoJSON
|
|
97
|
-
will just be rendered. In 3D a Feature can be rendered differently depending on the VectorLayer settings or the properties
|
|
97
|
+
Vector Features can be shown in a `VectorLayer` or `GeoJSONLayer`. GeoJSON Features are just 2D, and in a 2D Map the Features
|
|
98
|
+
will just be rendered. In 3D, a Feature can be rendered differently depending on the VectorLayer settings or the properties
|
|
98
99
|
of the Feature.
|
|
99
100
|
|
|
100
101
|
- Render a Feature as a Solid via `extrusion` Parameter.
|
|
101
|
-
- Render a Point Feature as a
|
|
102
|
+
- Render a Point Feature as a glTF Model.
|
|
102
103
|
- Render a Feature as a Classification Primitive to classifiy other content.
|
|
103
104
|
|
|
104
|
-
|
|
105
|
+
For more options, see [VectorProperties](./src/layer/vectorProperties.ts).
|
|
105
106
|
|
|
106
107
|
## Categories
|
|
107
108
|
|
|
108
109
|
Categories is a concept to serialize and parse arbitrary JSON Objects from a Module.
|
|
109
110
|
|
|
110
|
-
##
|
|
111
|
+
## OpenLayers/CesiumJS
|
|
111
112
|
|
|
112
|
-
The full
|
|
113
|
+
The full capabilities of OpenLayers and CesiumJS are available. In 3D for example, a map has an accessor to get the corresponding
|
|
113
114
|
Cesium Scene.
|
|
114
115
|
|
|
115
116
|
## Extensibility
|
|
116
117
|
|
|
117
|
-
With the ClassRegistry concept and API
|
|
118
|
-
For example with `app.layerClassRegistry.registerClass('myLayer', MyLayerClass)`
|
|
119
|
-
while following the Layer Interface. This allows to reuse the Module serialization/parsing
|
|
118
|
+
With the ClassRegistry concept and API, it is possible to register your own Item Types to the Framework.
|
|
119
|
+
For example with `app.layerClassRegistry.registerClass('myLayer', MyLayerClass)` it is possible to implement a custom layer
|
|
120
|
+
while following the Layer Interface. This allows to reuse the Module serialization/parsing concept with custom Items.
|
|
120
121
|
|
|
121
122
|
# Coding Conventions
|
|
122
123
|
|
|
123
124
|
### Exporting from a module
|
|
124
125
|
|
|
125
|
-
- You should export all variables, functions, class etc
|
|
126
|
+
- You should export all variables, functions, class, etc., from a module
|
|
126
127
|
which are required to use the API.
|
|
127
128
|
- Part of your module which should be part of the library must be added to the index.ts file manually
|
|
128
|
-
- Make sure the names of exports have _meaning outside of their module_. E.g
|
|
129
|
-
function
|
|
129
|
+
- Make sure the names of exports have _meaning outside of their module_. E.g., a
|
|
130
|
+
function named `extend(destination: extent3D, source: extend3D):void` would need to be rephrased to `extend3DExtent`.
|
|
@@ -16,11 +16,7 @@ export type I3SOptions = LayerOptions & {
|
|
|
16
16
|
calculateNormals?: boolean;
|
|
17
17
|
showFeatures?: boolean;
|
|
18
18
|
cesium3dTilesetOptions?: Cesium3DTileset.ConstructorOptions;
|
|
19
|
-
lightColor?:
|
|
20
|
-
x: number;
|
|
21
|
-
y: number;
|
|
22
|
-
z: number;
|
|
23
|
-
};
|
|
19
|
+
lightColor?: string;
|
|
24
20
|
outlineColor?: string;
|
|
25
21
|
screenSpaceError?: number;
|
|
26
22
|
screenSpaceErrorMobile?: number;
|
|
@@ -49,11 +45,7 @@ declare class I3SLayer extends FeatureLayer<I3SCesiumImpl> {
|
|
|
49
45
|
calculateNormals: boolean;
|
|
50
46
|
showFeatures: boolean;
|
|
51
47
|
cesium3dTilesetOptions: Partial<Cesium3DTileset.ConstructorOptions> | undefined;
|
|
52
|
-
lightColor:
|
|
53
|
-
x: number;
|
|
54
|
-
y: number;
|
|
55
|
-
z: number;
|
|
56
|
-
} | undefined;
|
|
48
|
+
lightColor: string | undefined;
|
|
57
49
|
outlineColor: string | undefined;
|
|
58
50
|
screenSpaceError: number;
|
|
59
51
|
screenSpaceErrorMobile: number;
|
|
@@ -68,14 +68,17 @@ class I3SLayer extends FeatureLayer {
|
|
|
68
68
|
: new VectorStyleItem(options.highlightStyle);
|
|
69
69
|
}
|
|
70
70
|
const cesium3dTilesetOptions = options.cesium3dTilesetOptions || defaultOptions.cesium3dTilesetOptions;
|
|
71
|
+
let lightColor;
|
|
72
|
+
if (options.lightColor) {
|
|
73
|
+
const color = Color.fromCssColorString(options.lightColor);
|
|
74
|
+
lightColor = new Cartesian3(...color.toBytes());
|
|
75
|
+
}
|
|
71
76
|
this.cesium3dTilesetOptions = {
|
|
72
77
|
maximumScreenSpaceError: isMobile()
|
|
73
78
|
? this.screenSpaceErrorMobile
|
|
74
79
|
: this.screenSpaceError,
|
|
75
80
|
...cesium3dTilesetOptions,
|
|
76
|
-
|
|
77
|
-
lightColor: new Cartesian3(options.lightColor.x, options.lightColor.y, options.lightColor.z),
|
|
78
|
-
}),
|
|
81
|
+
lightColor,
|
|
79
82
|
...(options.outlineColor && {
|
|
80
83
|
outlineColor: Color.fromCssColorString(options.outlineColor),
|
|
81
84
|
}),
|
|
@@ -196,11 +199,9 @@ class I3SLayer extends FeatureLayer {
|
|
|
196
199
|
}
|
|
197
200
|
delete tilesetOptions.outlineColor;
|
|
198
201
|
if (tilesetOptions.lightColor) {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
z: tilesetOptions.lightColor.z,
|
|
203
|
-
};
|
|
202
|
+
const { x, y, z } = tilesetOptions.lightColor;
|
|
203
|
+
const color = Color.fromBytes(x, y, z);
|
|
204
|
+
config.lightColor = color.toCssHexString();
|
|
204
205
|
}
|
|
205
206
|
delete tilesetOptions.lightColor;
|
|
206
207
|
const usedScreenSpaceError = isMobile()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file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,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,OAAO;QACL,IAAI,CAAC,iBAAiB,EAAE,OAAO,EAAE,CAAC;QAClC,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC;CACF;AAED,kBAAkB,CAAC,aAAa,CAAC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAC/D,eAAe,QAAQ,CAAC"}
|
package/package.json
CHANGED
package/src/layer/i3sLayer.ts
CHANGED
|
@@ -33,7 +33,7 @@ export type I3SOptions = LayerOptions & {
|
|
|
33
33
|
calculateNormals?: boolean;
|
|
34
34
|
showFeatures?: boolean;
|
|
35
35
|
cesium3dTilesetOptions?: Cesium3DTileset.ConstructorOptions;
|
|
36
|
-
lightColor?:
|
|
36
|
+
lightColor?: string;
|
|
37
37
|
outlineColor?: string;
|
|
38
38
|
screenSpaceError?: number;
|
|
39
39
|
screenSpaceErrorMobile?: number;
|
|
@@ -85,7 +85,7 @@ class I3SLayer extends FeatureLayer<I3SCesiumImpl> {
|
|
|
85
85
|
cesium3dTilesetOptions:
|
|
86
86
|
| Partial<Cesium3DTileset.ConstructorOptions>
|
|
87
87
|
| undefined;
|
|
88
|
-
lightColor:
|
|
88
|
+
lightColor: string | undefined;
|
|
89
89
|
outlineColor: string | undefined;
|
|
90
90
|
screenSpaceError: number;
|
|
91
91
|
screenSpaceErrorMobile: number;
|
|
@@ -135,18 +135,18 @@ class I3SLayer extends FeatureLayer<I3SCesiumImpl> {
|
|
|
135
135
|
const cesium3dTilesetOptions =
|
|
136
136
|
options.cesium3dTilesetOptions || defaultOptions.cesium3dTilesetOptions;
|
|
137
137
|
|
|
138
|
+
let lightColor: Cartesian3 | undefined;
|
|
139
|
+
if (options.lightColor) {
|
|
140
|
+
const color = Color.fromCssColorString(options.lightColor);
|
|
141
|
+
lightColor = new Cartesian3(...color.toBytes());
|
|
142
|
+
}
|
|
143
|
+
|
|
138
144
|
this.cesium3dTilesetOptions = {
|
|
139
145
|
maximumScreenSpaceError: isMobile()
|
|
140
146
|
? this.screenSpaceErrorMobile
|
|
141
147
|
: this.screenSpaceError,
|
|
142
148
|
...cesium3dTilesetOptions,
|
|
143
|
-
|
|
144
|
-
lightColor: new Cartesian3(
|
|
145
|
-
options.lightColor.x,
|
|
146
|
-
options.lightColor.y,
|
|
147
|
-
options.lightColor.z,
|
|
148
|
-
),
|
|
149
|
-
}),
|
|
149
|
+
lightColor,
|
|
150
150
|
...(options.outlineColor && {
|
|
151
151
|
outlineColor: Color.fromCssColorString(options.outlineColor),
|
|
152
152
|
}),
|
|
@@ -290,11 +290,9 @@ class I3SLayer extends FeatureLayer<I3SCesiumImpl> {
|
|
|
290
290
|
delete tilesetOptions.outlineColor;
|
|
291
291
|
|
|
292
292
|
if (tilesetOptions.lightColor) {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
z: tilesetOptions.lightColor.z,
|
|
297
|
-
};
|
|
293
|
+
const { x, y, z } = tilesetOptions.lightColor;
|
|
294
|
+
const color = Color.fromBytes(x, y, z);
|
|
295
|
+
config.lightColor = color.toCssHexString();
|
|
298
296
|
}
|
|
299
297
|
delete tilesetOptions.lightColor;
|
|
300
298
|
|