Skip to content

Commit

Permalink
chore(web): support default built-in layer style (#1183)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkumbobeaty authored Oct 22, 2024
1 parent f25b5db commit bf5e7f8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { LayerAppearanceTypes } from "@reearth/core";
import { LayerStyle } from "@reearth/services/api/layerStyleApi/utils";

export const defaultStyle = {
export const defaultStyle: Partial <LayerAppearanceTypes> = {
marker: {
heightReference: "clamp"
},
Expand Down
8 changes: 3 additions & 5 deletions web/src/beta/features/Editor/Visualizer/convert.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { defaultStyle } from "@reearth/beta/features/Editor/Map/LayerStylePanel/PresetLayerStyle/presetLayerStyles";
import {
type WidgetZone,
type WidgetSection,
Expand All @@ -12,10 +13,7 @@ import {
isBuiltinWidget
} from "@reearth/beta/features/Visualizer/Crust/Widgets";
import { WidgetAreaPadding } from "@reearth/beta/features/Visualizer/Crust/Widgets/WidgetAlignSystem/types";
import {
DEFAULT_LAYER_STYLE,
valueTypeFromGQL
} from "@reearth/beta/utils/value";
import { valueTypeFromGQL } from "@reearth/beta/utils/value";
import { LayerAppearanceTypes } from "@reearth/core";
import type { Layer } from "@reearth/core";
import { NLSLayer } from "@reearth/services/api/layersApi/utils";
Expand Down Expand Up @@ -402,7 +400,7 @@ export function processLayers(
}
}

return DEFAULT_LAYER_STYLE;
return defaultStyle;
};

return newLayers?.map((nlsLayer) => {
Expand Down
4 changes: 2 additions & 2 deletions web/src/beta/features/Published/convert-new-property.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defaultStyle } from "@reearth/beta/features/Editor/Map/LayerStylePanel/PresetLayerStyle/presetLayerStyles";
import { InfoboxBlock } from "@reearth/beta/features/Visualizer/Crust/Infobox/types";
import { DEFAULT_LAYER_STYLE } from "@reearth/beta/utils/value";
import { Layer, LayerAppearanceTypes } from "@reearth/core";
import {
NLSInfobox,
Expand Down Expand Up @@ -70,7 +70,7 @@ export function processLayers(
}
}

return DEFAULT_LAYER_STYLE;
return defaultStyle;
};

return newLayers?.map((nlsLayer) => {
Expand Down
18 changes: 0 additions & 18 deletions web/src/beta/utils/value.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { LayerAppearanceTypes } from "@reearth/core";
import { ValueType as GQLValueType } from "@reearth/services/gql";
import { css } from "@reearth/services/theme";
import { Color } from "cesium";
Expand Down Expand Up @@ -253,20 +252,3 @@ export const zeroValues: { [key in ValueType]?: ValueTypes[ValueType] } = {
string: ""
};

export const DEFAULT_LAYER_STYLE: Partial<LayerAppearanceTypes> = {
"3dtiles": {
show: true
},
resource: {
clampToGround: true
},
marker: {
heightReference: "clamp"
},
polygon: {
heightReference: "clamp"
},
polyline: {
clampToGround: true
}
};

0 comments on commit bf5e7f8

Please sign in to comment.