@reearth/core 0.0.7-alpha.13 → 0.0.7-alpha.14
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 +106 -87
- package/dist/core.umd.cjs +2 -2
- package/dist/index.d.ts +2 -0
- package/package.json +1 -1
- package/src/Map/types/viewerProperty.ts +2 -0
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImagery.tsx +8 -1
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapVectorMapLabel.tsx +14 -2
- package/src/engines/Cesium/core/labels/LabelImageryLayers.tsx +10 -1
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
type Ellipsoid,
|
|
13
13
|
type Label,
|
|
14
14
|
} from "@cesium/engine";
|
|
15
|
+
import { DistanceDisplayCondition } from "cesium";
|
|
15
16
|
import { merge, omit } from "lodash-es";
|
|
16
17
|
import { type Feature } from "protomaps";
|
|
17
18
|
import { memo, useCallback, useEffect, useMemo, useRef, type FC } from "react";
|
|
@@ -170,6 +171,8 @@ export interface JapanGSIOptimalBVmapLabelImageryProps {
|
|
|
170
171
|
height?: number;
|
|
171
172
|
style?: AnnotationStyle;
|
|
172
173
|
labelCollection?: LabelCollection;
|
|
174
|
+
near?: number;
|
|
175
|
+
far?: number;
|
|
173
176
|
}
|
|
174
177
|
|
|
175
178
|
export const JapanGSIOptimalBVmapLabelImagery: FC<JapanGSIOptimalBVmapLabelImageryProps> = memo(
|
|
@@ -180,6 +183,8 @@ export const JapanGSIOptimalBVmapLabelImagery: FC<JapanGSIOptimalBVmapLabelImage
|
|
|
180
183
|
height = 50,
|
|
181
184
|
style = defaultStyle,
|
|
182
185
|
labelCollection,
|
|
186
|
+
near,
|
|
187
|
+
far,
|
|
183
188
|
}) => {
|
|
184
189
|
const cesiumContext = useCesium();
|
|
185
190
|
|
|
@@ -282,6 +287,8 @@ export const JapanGSIOptimalBVmapLabelImagery: FC<JapanGSIOptimalBVmapLabelImage
|
|
|
282
287
|
horizontalOrigin: HorizontalOrigin.CENTER,
|
|
283
288
|
verticalOrigin: VerticalOrigin.BOTTOM,
|
|
284
289
|
heightReference: HeightReference.CLAMP_TO_GROUND,
|
|
290
|
+
distanceDisplayCondition:
|
|
291
|
+
near || far ? new DistanceDisplayCondition(near, far) : undefined,
|
|
285
292
|
disableDepthTestDistance: Infinity,
|
|
286
293
|
...styleOptions,
|
|
287
294
|
};
|
|
@@ -308,7 +315,7 @@ export const JapanGSIOptimalBVmapLabelImagery: FC<JapanGSIOptimalBVmapLabelImage
|
|
|
308
315
|
scene?.postRender.addEventListener(removeLabels);
|
|
309
316
|
}
|
|
310
317
|
};
|
|
311
|
-
}, [style, annotations, scene, labelCollection]);
|
|
318
|
+
}, [style, annotations, scene, labelCollection, near, far]);
|
|
312
319
|
|
|
313
320
|
useEffect(() => {
|
|
314
321
|
updateVisibility();
|
|
@@ -143,7 +143,9 @@ const LabelImageryCollection: FC<{
|
|
|
143
143
|
imageriesAtom: Atom<KeyedImagery[]>;
|
|
144
144
|
style?: AnnotationStyle;
|
|
145
145
|
labelCollection?: LabelCollection;
|
|
146
|
-
|
|
146
|
+
near?: number;
|
|
147
|
+
far?: number;
|
|
148
|
+
}> = ({ imageryProvider, imageriesAtom, style, labelCollection, near, far }) => {
|
|
147
149
|
const imageries = useAtomValue(imageriesAtom);
|
|
148
150
|
return (
|
|
149
151
|
<>
|
|
@@ -155,6 +157,8 @@ const LabelImageryCollection: FC<{
|
|
|
155
157
|
descendants={imagery.descendants}
|
|
156
158
|
style={style}
|
|
157
159
|
labelCollection={labelCollection}
|
|
160
|
+
near={near}
|
|
161
|
+
far={far}
|
|
158
162
|
/>
|
|
159
163
|
</Suspense>
|
|
160
164
|
))}
|
|
@@ -164,9 +168,15 @@ const LabelImageryCollection: FC<{
|
|
|
164
168
|
|
|
165
169
|
export interface VectorMapLabelProps {
|
|
166
170
|
style?: Record<string, any>;
|
|
171
|
+
near?: number;
|
|
172
|
+
far?: number;
|
|
167
173
|
}
|
|
168
174
|
|
|
169
|
-
export const JapanGSIOptimalBVmapVectorMapLabel: FC<VectorMapLabelProps> = ({
|
|
175
|
+
export const JapanGSIOptimalBVmapVectorMapLabel: FC<VectorMapLabelProps> = ({
|
|
176
|
+
style,
|
|
177
|
+
near,
|
|
178
|
+
far,
|
|
179
|
+
}) => {
|
|
170
180
|
const [imageryProvider, setImageryProvider] =
|
|
171
181
|
useState<JapanGSIOptimalBVmapLabelImageryProvider>();
|
|
172
182
|
const setRef = useCallback((handle: CesiumComponentRef<CesiumImageryLayer> | null) => {
|
|
@@ -251,6 +261,8 @@ export const JapanGSIOptimalBVmapVectorMapLabel: FC<VectorMapLabelProps> = ({ st
|
|
|
251
261
|
imageriesAtom={imageriesAtom}
|
|
252
262
|
style={style}
|
|
253
263
|
labelCollection={labels}
|
|
264
|
+
near={near}
|
|
265
|
+
far={far}
|
|
254
266
|
/>
|
|
255
267
|
)}
|
|
256
268
|
</>
|
|
@@ -8,6 +8,8 @@ export interface TileLabelConfig {
|
|
|
8
8
|
labelType: "japan_gsi_optimal_bvmap";
|
|
9
9
|
fillColor?: string;
|
|
10
10
|
outlineColor?: string;
|
|
11
|
+
near?: number;
|
|
12
|
+
far?: number;
|
|
11
13
|
style: Record<string, any>;
|
|
12
14
|
}
|
|
13
15
|
|
|
@@ -23,7 +25,14 @@ const LabelImageryLayers = memo(
|
|
|
23
25
|
if (!label) return null;
|
|
24
26
|
switch (label.labelType) {
|
|
25
27
|
case "japan_gsi_optimal_bvmap":
|
|
26
|
-
return
|
|
28
|
+
return (
|
|
29
|
+
<JapanGSIOptimalBVmapVectorMapLabel
|
|
30
|
+
key={label.id}
|
|
31
|
+
style={label.style}
|
|
32
|
+
near={label.near}
|
|
33
|
+
far={label.far}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
27
36
|
default:
|
|
28
37
|
return null;
|
|
29
38
|
}
|