Skip to content

Commit

Permalink
fix: use computed feature on resource on reearth/core (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
keiya01 committed Mar 17, 2023
1 parent 541f301 commit 006f40a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/core/engines/Cesium/Feature/Resource/utils.ts
Expand Up @@ -146,9 +146,8 @@ export const attachStyle = (
if (!computedFeature) {
return;
}
const simpleLayer = extractSimpleLayer(layer);
if (point) {
const isPointStyle = simpleLayer?.marker?.style === "point";
const isPointStyle = computedFeature?.marker?.style === "point";
if (isPointStyle && !entity.point) {
entity.point = new PointGraphics();
entity.billboard = undefined;
Expand All @@ -157,10 +156,11 @@ export const attachStyle = (
attachProperties(entity, computedFeature, ["marker", "point"], {
show: {
name: "show",
...(simpleLayer?.marker?.style
...(computedFeature?.marker?.style
? {
override:
simpleLayer?.marker?.style === "point" && (simpleLayer?.marker.show ?? true),
computedFeature?.marker?.style === "point" &&
(computedFeature?.marker.show ?? true),
}
: {}),
},
Expand All @@ -186,7 +186,7 @@ export const attachStyle = (
}

if (billboard) {
const isImageStyle = simpleLayer?.marker?.style === "image";
const isImageStyle = computedFeature?.marker?.style === "image";
if (isImageStyle && !entity.billboard) {
entity.billboard = new BillboardGraphics();
entity.point = undefined;
Expand All @@ -195,10 +195,11 @@ export const attachStyle = (
attachProperties(entity, computedFeature, ["marker", "billboard"], {
show: {
name: "show",
...(simpleLayer?.marker?.style
...(computedFeature?.marker?.style
? {
override:
simpleLayer?.marker?.style === "image" && (simpleLayer?.marker.show ?? true),
computedFeature?.marker?.style === "image" &&
(computedFeature?.marker.show ?? true),
}
: {}),
},
Expand Down

0 comments on commit 006f40a

Please sign in to comment.