From 880e54f7bf8a7ee4bf34c6c5f5a667ede723904f Mon Sep 17 00:00:00 2001 From: mkumbobeaty Date: Tue, 22 Oct 2024 12:45:59 +0300 Subject: [PATCH 1/4] remove layersInViewport --- .../Visualizer/Crust/Plugins/hooks/index.ts | 97 +------------------ .../Crust/Plugins/hooks/useLayers.ts | 6 -- .../Crust/Plugins/pluginAPI/commonReearth.ts | 5 - .../Plugins/pluginAPI/pluginAPIv1Types.ts | 1 - .../Crust/Plugins/pluginAPI/types/layers.ts | 2 - .../Visualizer/Crust/Plugins/storybook.tsx | 1 - 6 files changed, 1 insertion(+), 111 deletions(-) diff --git a/web/src/beta/features/Visualizer/Crust/Plugins/hooks/index.ts b/web/src/beta/features/Visualizer/Crust/Plugins/hooks/index.ts index 3f508f637e..3d527de5db 100644 --- a/web/src/beta/features/Visualizer/Crust/Plugins/hooks/index.ts +++ b/web/src/beta/features/Visualizer/Crust/Plugins/hooks/index.ts @@ -111,7 +111,6 @@ export default function ({ addLayer, findFeatureById, findFeaturesByIds, - layersInViewport, selectLayer, selectFeature, selectFeatures, @@ -218,7 +217,6 @@ export default function ({ addLayer, findFeatureById, findFeaturesByIds, - layersInViewport, selectLayer, selectFeature, selectFeatures, @@ -257,100 +255,7 @@ export default function ({ layersEvents, sketchEvents }), - [ - engineName, - // viewer - getViewerProperty, - overrideViewerPropertyCommon, - getViewport, - captureScreen, - getInteractionMode, - getInEditor, - getIsBuilt, - // viewer tools - getLocationFromScreenCoordinate, - getScreenCoordinateFromPosition, - getTerrainHeightAsync, - getGlobeHeight, - getGlobeHeightByCamera, - cartographicToCartesian, - cartesianToCartographic, - transformByOffsetOnScreen, - isPositionVisibleOnGlobe, - // viewer events - viewerEventsOn, - viewerEventsOff, - // camera - getCameraPosition, - getCameraFov, - getCameraAspectRatio, - getCameraViewport, - zoomIn, - zoomOut, - setView, - flyTo, - flyToBoundingBox, - getGlobeIntersection, - enableScreenSpaceCameraController, - overrideScreenSpaceCameraController, - lookAt, - rotateAround, - rotateRight, - orbit, - move, - moveOverTerrain, - enableForceHorizontalRoll, - // camera events - cameraEventsOn, - cameraEventsOff, - // timeline - getTimeline, - // layers - getLayers, - hideLayer, - showLayer, - addLayer, - findFeatureById, - findFeaturesByIds, - layersInViewport, - selectLayer, - selectFeature, - selectFeatures, - getSelectedLayer, - getSelectedFeature, - getFeaturesInScreenRect, - bringToFront, - sendToBack, - // layers events - layersEventsOn, - layersEventsOff, - // sketch - getSketchTool, - setSketchTool, - getSketchOptions, - overrideSketchOptions, - // sketch events - sketchEventsOn, - sketchEventsOff, - // extension - getExtensionList, - // deprecated - deprecated, - cameraDeprecated, - layersDeprecated, - sketchDeprecated, - // others - overrideViewerProperty, - pluginInstances, - clientStorage, - timelineManagerRef, - viewerEvents, - selectionModeEvents, - cameraEvents, - timelineEvents, - layersEvents, - sketchEvents - ] + [engineName, getViewerProperty, overrideViewerPropertyCommon, getViewport, captureScreen, getInteractionMode, getInEditor, getIsBuilt, getLocationFromScreenCoordinate, getScreenCoordinateFromPosition, getTerrainHeightAsync, getGlobeHeight, getGlobeHeightByCamera, cartographicToCartesian, cartesianToCartographic, transformByOffsetOnScreen, isPositionVisibleOnGlobe, viewerEventsOn, viewerEventsOff, getCameraPosition, getCameraFov, getCameraAspectRatio, getCameraViewport, zoomIn, zoomOut, setView, flyTo, flyToBoundingBox, getGlobeIntersection, enableScreenSpaceCameraController, overrideScreenSpaceCameraController, lookAt, rotateAround, rotateRight, orbit, move, moveOverTerrain, enableForceHorizontalRoll, cameraEventsOn, cameraEventsOff, getTimeline, getLayers, hideLayer, showLayer, addLayer, findFeatureById, findFeaturesByIds, selectLayer, selectFeature, selectFeatures, getSelectedLayer, getSelectedFeature, getFeaturesInScreenRect, bringToFront, sendToBack, layersEventsOn, layersEventsOff, getSketchTool, setSketchTool, getSketchOptions, overrideSketchOptions, sketchEventsOn, sketchEventsOff, getExtensionList, deprecated, cameraDeprecated, layersDeprecated, sketchDeprecated, overrideViewerProperty, pluginInstances, clientStorage, timelineManagerRef, viewerEvents, selectionModeEvents, cameraEvents, timelineEvents, layersEvents, sketchEvents] ); // expose plugin API for developers diff --git a/web/src/beta/features/Visualizer/Crust/Plugins/hooks/useLayers.ts b/web/src/beta/features/Visualizer/Crust/Plugins/hooks/useLayers.ts index 289bf4733e..d4625dfe12 100644 --- a/web/src/beta/features/Visualizer/Crust/Plugins/hooks/useLayers.ts +++ b/web/src/beta/features/Visualizer/Crust/Plugins/hooks/useLayers.ts @@ -64,11 +64,6 @@ export default ({ [engineRef] ); - const layersInViewport = useCallback(() => { - return layersRef?.findAll( - (layer) => !!engineRef?.inViewport(layer?.property?.default?.location) - ); - }, [engineRef, layersRef]); const selectLayer = useCallback( (layerId: string | undefined) => { @@ -189,7 +184,6 @@ export default ({ addLayer, findFeatureById, findFeaturesByIds, - layersInViewport, selectLayer, selectFeature, selectFeatures, diff --git a/web/src/beta/features/Visualizer/Crust/Plugins/pluginAPI/commonReearth.ts b/web/src/beta/features/Visualizer/Crust/Plugins/pluginAPI/commonReearth.ts index b8f8adbd40..66d05962bb 100644 --- a/web/src/beta/features/Visualizer/Crust/Plugins/pluginAPI/commonReearth.ts +++ b/web/src/beta/features/Visualizer/Crust/Plugins/pluginAPI/commonReearth.ts @@ -66,7 +66,6 @@ export function commonReearth({ addLayer, findFeatureById, findFeaturesByIds, - layersInViewport, selectLayer, selectFeature, selectFeatures, @@ -148,7 +147,6 @@ export function commonReearth({ addLayer: GlobalThis["reearth"]["layers"]["add"]; findFeatureById: GlobalThis["reearth"]["layers"]["findFeatureById"]; findFeaturesByIds: GlobalThis["reearth"]["layers"]["findFeaturesByIds"]; - layersInViewport: GlobalThis["reearth"]["layers"]["layersInViewport"]; selectLayer: GlobalThis["reearth"]["layers"]["select"]; selectFeature: GlobalThis["reearth"]["layers"]["selectFeature"]; selectFeatures: GlobalThis["reearth"]["layers"]["selectFeatures"]; @@ -300,9 +298,6 @@ export function commonReearth({ get findFeaturesByIds() { return findFeaturesByIds; }, - get layersInViewport() { - return layersInViewport; - }, get select() { return selectLayer; }, diff --git a/web/src/beta/features/Visualizer/Crust/Plugins/pluginAPI/pluginAPIv1Types.ts b/web/src/beta/features/Visualizer/Crust/Plugins/pluginAPI/pluginAPIv1Types.ts index 1bc080a4a0..cf43b6b676 100644 --- a/web/src/beta/features/Visualizer/Crust/Plugins/pluginAPI/pluginAPIv1Types.ts +++ b/web/src/beta/features/Visualizer/Crust/Plugins/pluginAPI/pluginAPIv1Types.ts @@ -84,7 +84,6 @@ export type Reearth = { | "selectedFeature" | "overriddenLayers" > & { - readonly layersInViewport?: () => LazyLayer[] | undefined; readonly overriddenProperties?: Record; readonly overrideProperty?: ( properties: LayerSimple["properties"] | undefined diff --git a/web/src/beta/features/Visualizer/Crust/Plugins/pluginAPI/types/layers.ts b/web/src/beta/features/Visualizer/Crust/Plugins/pluginAPI/types/layers.ts index ec61ec8755..55d8aee3e0 100644 --- a/web/src/beta/features/Visualizer/Crust/Plugins/pluginAPI/types/layers.ts +++ b/web/src/beta/features/Visualizer/Crust/Plugins/pluginAPI/types/layers.ts @@ -46,7 +46,6 @@ export declare type Layers = { layerId: string, featureId: string[] ) => Feature[] | undefined; - readonly layersInViewport?: () => LazyLayer[] | undefined; readonly select?: (layerId: string | undefined) => void; readonly selectFeature?: (layerId?: string, featureId?: string) => void; readonly selectFeatures?: ( @@ -56,7 +55,6 @@ export declare type Layers = { readonly selectedFeature?: ComputedFeature; readonly bringToFront?: (layerId: string) => void; readonly sendToBack?: (layerId: string) => void; - readonly getLayersInViewport?: () => LazyLayer[] | undefined; readonly getFeaturesInScreenRect: ( rect: [x: number, y: number, width: number, height: number], // TODO: Get condition as expression for plugin diff --git a/web/src/beta/features/Visualizer/Crust/Plugins/storybook.tsx b/web/src/beta/features/Visualizer/Crust/Plugins/storybook.tsx index cdfb8a81a9..d1668b34a9 100644 --- a/web/src/beta/features/Visualizer/Crust/Plugins/storybook.tsx +++ b/web/src/beta/features/Visualizer/Crust/Plugins/storybook.tsx @@ -199,7 +199,6 @@ export const context: Context = { selectedFeature: undefined, bringToFront: act("layers.bringToFront"), sendToBack: act("layers.sendToBack"), - getLayersInViewport: act("layers.getLayersInViewport"), getFeaturesInScreenRect: act("layers.getFeaturesInScreenRect"), on: act("layers.on"), off: act("layers.off") From 4f81f5671cde65a3872916a5c2381eeea0f8a79b Mon Sep 17 00:00:00 2001 From: mkumbobeaty Date: Tue, 22 Oct 2024 13:09:23 +0300 Subject: [PATCH 2/4] remove underline --- .../StyleInterface/StyleNode/Field/TypographyInput.tsx | 6 ------ .../Editor/StyleInterface/appearanceNodes/marker.ts | 2 +- .../Map/LayerStylePanel/Editor/StyleInterface/types.ts | 1 - 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/StyleNode/Field/TypographyInput.tsx b/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/StyleNode/Field/TypographyInput.tsx index 0690e314fd..4232e15e2f 100644 --- a/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/StyleNode/Field/TypographyInput.tsx +++ b/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/StyleNode/Field/TypographyInput.tsx @@ -80,12 +80,6 @@ const TypographyInput: FC = ({ value, onChange }) => { onChange={(v) => onChange?.({ ...value, italic: v })} /> - - onChange?.({ ...value, underline: v })} - /> - ); }; diff --git a/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/appearanceNodes/marker.ts b/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/appearanceNodes/marker.ts index bf6926e4c4..0e2dafdfb1 100644 --- a/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/appearanceNodes/marker.ts +++ b/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/appearanceNodes/marker.ts @@ -97,7 +97,7 @@ export const markerNodes: AppearanceNode[] = [ title: "Image Crop", field: "select", defaultValue: "none", - valueOptions: ["none", "rounded", "circle"] + valueOptions: ["none", "circle"] }, { id: "imageShadow", diff --git a/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/types.ts b/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/types.ts index c22fa434b6..6a532c1b9a 100644 --- a/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/types.ts +++ b/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/types.ts @@ -73,7 +73,6 @@ export type Typography = { fontWeight?: FontWeight; color?: string; italic?: boolean; - underline?: boolean; }; export type Expression = { From a5bd5179fce158287700b1b8981a41ba9e1c45eb Mon Sep 17 00:00:00 2001 From: mkumbobeaty Date: Tue, 22 Oct 2024 13:38:40 +0300 Subject: [PATCH 3/4] update translation --- web/src/services/i18n/translations/en.yml | 1 - web/src/services/i18n/translations/ja.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/web/src/services/i18n/translations/en.yml b/web/src/services/i18n/translations/en.yml index 2651717e37..555010e995 100644 --- a/web/src/services/i18n/translations/en.yml +++ b/web/src/services/i18n/translations/en.yml @@ -123,7 +123,6 @@ font size: '' font weight: '' font color: '' italic: '' -underline: '' New node: '' Style: '' Empty: '' diff --git a/web/src/services/i18n/translations/ja.yml b/web/src/services/i18n/translations/ja.yml index 3703bc59be..d4554c55b5 100644 --- a/web/src/services/i18n/translations/ja.yml +++ b/web/src/services/i18n/translations/ja.yml @@ -123,7 +123,6 @@ font size: '' font weight: '' font color: '' italic: '' -underline: '' New node: '' Style: '' Empty: '' From 57c9cfb874b0c6e2332fb92554608e8514a27970 Mon Sep 17 00:00:00 2001 From: airslice Date: Wed, 23 Oct 2024 09:29:23 +0800 Subject: [PATCH 4/4] chore: format --- .../Visualizer/Crust/Plugins/hooks/index.ts | 81 ++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) diff --git a/web/src/beta/features/Visualizer/Crust/Plugins/hooks/index.ts b/web/src/beta/features/Visualizer/Crust/Plugins/hooks/index.ts index 3d527de5db..0d135741f2 100644 --- a/web/src/beta/features/Visualizer/Crust/Plugins/hooks/index.ts +++ b/web/src/beta/features/Visualizer/Crust/Plugins/hooks/index.ts @@ -255,7 +255,86 @@ export default function ({ layersEvents, sketchEvents }), - [engineName, getViewerProperty, overrideViewerPropertyCommon, getViewport, captureScreen, getInteractionMode, getInEditor, getIsBuilt, getLocationFromScreenCoordinate, getScreenCoordinateFromPosition, getTerrainHeightAsync, getGlobeHeight, getGlobeHeightByCamera, cartographicToCartesian, cartesianToCartographic, transformByOffsetOnScreen, isPositionVisibleOnGlobe, viewerEventsOn, viewerEventsOff, getCameraPosition, getCameraFov, getCameraAspectRatio, getCameraViewport, zoomIn, zoomOut, setView, flyTo, flyToBoundingBox, getGlobeIntersection, enableScreenSpaceCameraController, overrideScreenSpaceCameraController, lookAt, rotateAround, rotateRight, orbit, move, moveOverTerrain, enableForceHorizontalRoll, cameraEventsOn, cameraEventsOff, getTimeline, getLayers, hideLayer, showLayer, addLayer, findFeatureById, findFeaturesByIds, selectLayer, selectFeature, selectFeatures, getSelectedLayer, getSelectedFeature, getFeaturesInScreenRect, bringToFront, sendToBack, layersEventsOn, layersEventsOff, getSketchTool, setSketchTool, getSketchOptions, overrideSketchOptions, sketchEventsOn, sketchEventsOff, getExtensionList, deprecated, cameraDeprecated, layersDeprecated, sketchDeprecated, overrideViewerProperty, pluginInstances, clientStorage, timelineManagerRef, viewerEvents, selectionModeEvents, cameraEvents, timelineEvents, layersEvents, sketchEvents] + [ + engineName, + getViewerProperty, + overrideViewerPropertyCommon, + getViewport, + captureScreen, + getInteractionMode, + getInEditor, + getIsBuilt, + getLocationFromScreenCoordinate, + getScreenCoordinateFromPosition, + getTerrainHeightAsync, + getGlobeHeight, + getGlobeHeightByCamera, + cartographicToCartesian, + cartesianToCartographic, + transformByOffsetOnScreen, + isPositionVisibleOnGlobe, + viewerEventsOn, + viewerEventsOff, + getCameraPosition, + getCameraFov, + getCameraAspectRatio, + getCameraViewport, + zoomIn, + zoomOut, + setView, + flyTo, + flyToBoundingBox, + getGlobeIntersection, + enableScreenSpaceCameraController, + overrideScreenSpaceCameraController, + lookAt, + rotateAround, + rotateRight, + orbit, + move, + moveOverTerrain, + enableForceHorizontalRoll, + cameraEventsOn, + cameraEventsOff, + getTimeline, + getLayers, + hideLayer, + showLayer, + addLayer, + findFeatureById, + findFeaturesByIds, + selectLayer, + selectFeature, + selectFeatures, + getSelectedLayer, + getSelectedFeature, + getFeaturesInScreenRect, + bringToFront, + sendToBack, + layersEventsOn, + layersEventsOff, + getSketchTool, + setSketchTool, + getSketchOptions, + overrideSketchOptions, + sketchEventsOn, + sketchEventsOff, + getExtensionList, + deprecated, + cameraDeprecated, + layersDeprecated, + sketchDeprecated, + overrideViewerProperty, + pluginInstances, + clientStorage, + timelineManagerRef, + viewerEvents, + selectionModeEvents, + cameraEvents, + timelineEvents, + layersEvents, + sketchEvents + ] ); // expose plugin API for developers