Skip to content

Commit

Permalink
Merge branch 'main' of github.com:reearth/reearth-visualizer into fea…
Browse files Browse the repository at this point in the history
…t/project-recylebin
  • Loading branch information
mkumbobeaty committed Oct 23, 2024
2 parents 46edbd8 + bf5e7f8 commit 9c4ee8e
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { IMAGE_TYPES } from "@reearth/beta/features/AssetsManager/constants";
import {
ColorInput,
NumberInput,
Selector,
TextInput
} from "@reearth/beta/lib/reearth-ui";
import { AssetField } from "@reearth/beta/ui/fields";
import { FC } from "react";

import { AppearanceField, StyleSimpleValue, Typography } from "../../types";
Expand Down Expand Up @@ -47,6 +49,14 @@ const fieldComponents = {
value={props.value as Typography}
onChange={props.onUpdate}
/>
),
image: (props: FieldProps) => (
<AssetField
inputMethod="asset"
value={props.value as string}
assetsTypes={IMAGE_TYPES}
onChange={props.onUpdate}
/>
)
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default ValueTab;

const Wrapper = styled("div")(({ theme }) => ({
display: "flex",
flexDirection: "column",
gap: theme.spacing.smallest,
alignItems: "center",
minHeight: 28
}));
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const markerNodes: AppearanceNode[] = [
{
id: "image",
title: "Image",
field: "text",
field: "image",
defaultValue: ""
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export type AppearanceField =
| "number"
| "select"
| "text"
| "typography";
| "typography"
| "image";

export type AppearanceNodes = Record<AppearanceType, AppearanceNode[]>;

Expand Down
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 9c4ee8e

Please sign in to comment.