Skip to content

Commit

Permalink
fix(components): 🐛 wrapping the hierarchy with reactive causes a crash.
Browse files Browse the repository at this point in the history
link #484
  • Loading branch information
zouyaoji committed Dec 14, 2023
1 parent 4fff786 commit eb8be4c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/utils/cesium-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import type {
import { compare, CompareOperator } from 'compare-versions'
import { hasOwn, isFunction, isArray, isString, isPlainObject, isEmptyObj, getObjClassName, isUndefined } from './util'
import { VcCircleWaveMaterialProperty, VcLineFlowMaterialProperty } from '@vue-cesium/shared/extends/materials'
import { cloneDeep } from 'lodash'

/**
* 将对象或数组转换为 Cesium.Cartesian2
Expand Down Expand Up @@ -273,7 +274,7 @@ export function makePolygonHierarchy(val: VcPolygonHierarchy, ellipsoid?: Cesium
}

if (isPlainObject(val) && hasOwn(val, 'positions')) {
const value = val as PolygonHierarchyOption
const value = cloneDeep(val) as PolygonHierarchyOption
value.positions = makeCartesian3Array(value.positions, ellipsoid) as Array<Cesium.Cartesian3>
value.holes?.length && parsePolygonHierarchyJson(value.holes, ellipsoid)
return value
Expand Down

0 comments on commit eb8be4c

Please sign in to comment.