@reearth/core 0.0.7-alpha.47 → 0.0.7-alpha.49

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reearth/core",
3
- "version": "0.0.7-alpha.47",
3
+ "version": "0.0.7-alpha.49",
4
4
  "author": "Re:Earth contributors <community@reearth.io>",
5
5
  "license": "Apache-2.0",
6
6
  "description": "A library that abstracts a map engine as one common API.",
@@ -42,7 +42,7 @@
42
42
  "@radix-ui/react-slot": "1.1.0",
43
43
  "@radix-ui/react-switch": "1.1.0",
44
44
  "@radix-ui/react-toggle": "1.1.0",
45
- "@reearth/cesium-mvt-imagery-provider": "1.6.0",
45
+ "@reearth/cesium-mvt-imagery-provider": "1.6.1",
46
46
  "@reearth/spatial-id-sdk": "0.0.0",
47
47
  "@rot1024/use-transition": "1.0.0",
48
48
  "@seznam/compose-react-refs": "1.0.6",
@@ -60,7 +60,7 @@
60
60
  "jotai": "1.12.1",
61
61
  "js-md5": "0.7.3",
62
62
  "jsep": "1.3.8",
63
- "jsonpath-plus": "7.2.0",
63
+ "jsonpath-plus": "10.3.0",
64
64
  "jszip": "3.10.1",
65
65
  "lodash-es": "4.17.21",
66
66
  "lru-cache": "8.0.4",
@@ -17,7 +17,7 @@ import {
17
17
  GroundPrimitive,
18
18
  } from "cesium";
19
19
  import md5 from "js-md5";
20
- import { pick } from "lodash-es";
20
+ import { cloneDeep, pick } from "lodash-es";
21
21
  import {
22
22
  ComponentProps,
23
23
  ComponentType,
@@ -236,13 +236,20 @@ export const extractSimpleLayer = (
236
236
  if (l?.type !== "simple") {
237
237
  return;
238
238
  }
239
- return l;
239
+ // Proxy object lead to issues when creating mvt imagery provider, so convert to plain object
240
+ // Not sure for other types, but to keep consistency, convert all simple layers here
241
+ // It should be okey since simple layer data is supposed to be simple enough and computed data should not be included
242
+ return toPlainObject(l);
240
243
  };
241
244
 
242
245
  export const extractSimpleLayerData = (layer: ComputedLayer | undefined): Data | undefined => {
243
246
  return extractSimpleLayer(layer)?.data;
244
247
  };
245
248
 
249
+ export const toPlainObject = <T,>(obj: T): T => {
250
+ return cloneDeep(obj);
251
+ };
252
+
246
253
  export const toColor = (c?: string) => {
247
254
  if (!c || typeof c !== "string") return undefined;
248
255