@reearth/core 0.0.7-alpha.39 → 0.0.7-alpha.40
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/dist/core.js +2 -9
- package/dist/core.umd.cjs +2 -2
- package/package.json +1 -1
- package/src/engines/Cesium/Feature/Tileset/hooks.ts +28 -22
package/package.json
CHANGED
|
@@ -92,14 +92,15 @@ const makeFeatureId = (
|
|
|
92
92
|
}
|
|
93
93
|
const featureId = getBuiltinFeatureId(tileFeature);
|
|
94
94
|
return generateIDWithMD5(
|
|
95
|
-
`${coordinates.x}-${coordinates.y}-${coordinates.z}-${featureId}-${
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
95
|
+
`${coordinates.x}-${coordinates.y}-${coordinates.z}-${featureId}-${
|
|
96
|
+
!(tileFeature instanceof Model)
|
|
97
|
+
? JSON.stringify(
|
|
98
|
+
// Read only root properties.
|
|
99
|
+
Object.entries(convertCesium3DTileFeatureProperties(tileFeature))
|
|
100
|
+
.filter((_k, v) => typeof v === "string" || typeof v === "number")
|
|
101
|
+
.map(([k, v]) => `${k}${v}`),
|
|
102
|
+
)
|
|
103
|
+
: ""
|
|
103
104
|
}`,
|
|
104
105
|
);
|
|
105
106
|
};
|
|
@@ -222,20 +223,25 @@ const useFeature = ({
|
|
|
222
223
|
const style = computedFeature?.["3dtiles"];
|
|
223
224
|
|
|
224
225
|
COMMON_STYLE_PROPERTIES.forEach(({ name, convert }) => {
|
|
226
|
+
const val = convertStyle(style?.[name], convert);
|
|
227
|
+
|
|
225
228
|
if (name === "color") {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
229
|
+
// Reset color to default so that new style could update all.
|
|
230
|
+
raw.color = DEFAULT_FEATURE_COLOR;
|
|
231
|
+
|
|
232
|
+
// Apply color from style.
|
|
233
|
+
if (val !== undefined) {
|
|
234
|
+
raw.color = val;
|
|
232
235
|
}
|
|
233
236
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
237
|
+
// Apply color for selected feature.
|
|
238
|
+
if (isFeatureSelected && typeof layer["3dtiles"]?.selectedFeatureColor === "string") {
|
|
239
|
+
raw.color = toColor(layer["3dtiles"]?.selectedFeatureColor) ?? val;
|
|
240
|
+
}
|
|
241
|
+
} else {
|
|
242
|
+
if (val !== undefined) {
|
|
243
|
+
raw[name] = val;
|
|
244
|
+
}
|
|
239
245
|
}
|
|
240
246
|
});
|
|
241
247
|
|
|
@@ -752,8 +758,8 @@ export const useHooks = ({
|
|
|
752
758
|
const tilesetUrl = useMemo(() => {
|
|
753
759
|
return type === "osm-buildings" && isVisible
|
|
754
760
|
? IonResource.fromAssetId(96188, {
|
|
755
|
-
|
|
756
|
-
|
|
761
|
+
accessToken: meta?.cesiumIonAccessToken as string | undefined,
|
|
762
|
+
}) // https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Scene/createOsmBuildings.js#L53
|
|
757
763
|
: googleMapPhotorealisticResource && isVisible
|
|
758
764
|
? googleMapPhotorealisticResource
|
|
759
765
|
: type === "3dtiles" && isVisible
|
|
@@ -778,7 +784,7 @@ export const useHooks = ({
|
|
|
778
784
|
property?.imageBasedLightIntensity ?? viewerProperty?.scene?.imageBasedLighting?.intensity;
|
|
779
785
|
const sphericalHarmonicCoefficients = arrayToCartecian3(
|
|
780
786
|
property?.sphericalHarmonicCoefficients ??
|
|
781
|
-
|
|
787
|
+
viewerProperty?.scene?.imageBasedLighting?.sphericalHarmonicCoefficients,
|
|
782
788
|
imageBasedLightIntensity,
|
|
783
789
|
);
|
|
784
790
|
|