From 99bce93c869ddd17eefaaa722f55c240743bb9b6 Mon Sep 17 00:00:00 2001 From: popovspiridon99 Date: Fri, 24 Oct 2025 11:26:10 +0900 Subject: [PATCH] remove unused nodeLayer --- client/src/components/map/MapComponent.tsx | 26 ++-------------------- client/src/store/map.ts | 17 +------------- 2 files changed, 3 insertions(+), 40 deletions(-) diff --git a/client/src/components/map/MapComponent.tsx b/client/src/components/map/MapComponent.tsx index 67fec24..aa208f3 100644 --- a/client/src/components/map/MapComponent.tsx +++ b/client/src/components/map/MapComponent.tsx @@ -19,9 +19,8 @@ import axios from 'axios' import MapToolbar from './MapToolbar/MapToolbar' import MapStatusbar from './MapStatusbar/MapStatusbar' import { setAlignMode, setTypeRoles, useMapStore, setMapLabel, } from '../../store/map' -import { useThrottle } from '@uidotdev/usehooks' import ObjectTree from '../Tree/ObjectTree' -import { setCurrentObjectId, setSelectedDistrict, setSelectedRegion, setSelectedYear, useObjectsStore } from '../../store/objects' +import { setSelectedDistrict, setSelectedRegion, setSelectedYear, useObjectsStore } from '../../store/objects' import ObjectParameters from './ObjectParameters/ObjectParameters' import TabsPane, { ITabsPane } from './TabsPane/TabsPane' //import { useSearchParams } from 'react-router-dom' @@ -29,7 +28,7 @@ import GeoJSON from 'ol/format/GeoJSON' import MapLegend from './MapLegend/MapLegend' import MapMode from './MapMode' import MapPrint from './MapPrint/MapPrint' -import { Combobox, Option, Button, Divider, Spinner, Portal, Tooltip, Drawer } from '@fluentui/react-components' +import { Button, Divider, Spinner, Portal, Tooltip, Drawer } from '@fluentui/react-components' import { useAppStore } from '../../store/app' import { setDistrictsData, setRegionsData } from '../../store/regions' import View from 'ol/View' @@ -271,27 +270,6 @@ const MapComponent = ({ } }, [satMapsProvider, satLayer]) - // const { data: nodes } = useSWR('/nodes/all', () => fetcher('/nodes/all', BASE_URL.ems), { revalidateOnFocus: false }) - - // useEffect(() => { - // // Draw features based on database data - // if (Array.isArray(nodes)) { - // nodes.map(node => { - // if (node.shape_type === 'LINE') { - // const coordinates: Coordinate[] = [] - // if (Array.isArray(node.shape)) { - // node.shape.map((point: { x: number, y: number }) => { - // const coordinate = [point.x as number, point.y as number] as Coordinate - // coordinates.push(coordinate) - // }) - // } - // //console.log(coordinates) - // nodeLayerSource.addFeature(new Feature({ geometry: new LineString(coordinates) })) - // } - // }) - // } - // }, [nodes, nodeLayerSource]) - useEffect(() => { if (!selectedObjectType || !map) return diff --git a/client/src/store/map.ts b/client/src/store/map.ts index 3802084..c9a1ae9 100644 --- a/client/src/store/map.ts +++ b/client/src/store/map.ts @@ -15,7 +15,7 @@ import { googleMapsSatelliteSource } from '../components/map/MapSources'; import VectorLayer from 'ol/layer/Vector'; import { ImageStatic, OSM } from 'ol/source'; import ImageLayer from 'ol/layer/Image'; -import { drawingLayerStyle, figureStyle, highlightStyleRed, highlightStyleYellow, lineStyle, overlayStyle, regionsLayerStyle, selectStyle } from '../components/map/MapStyles'; +import { figureStyle, highlightStyleRed, highlightStyleYellow, lineStyle, overlayStyle, regionsLayerStyle, selectStyle } from '../components/map/MapStyles'; import { Fill, Stroke, Style } from 'ol/style'; import { VectorImage } from 'ol/layer'; import { click, noModifierKeys, pointerMove } from 'ol/events/condition'; @@ -68,8 +68,6 @@ interface MapState { translate: Translate | null; overlayLayerSource: VectorSource; satLayer: TileLayer; - nodeLayer: VectorLayer; - nodeLayerSource: VectorSource; staticMapLayer: ImageLayer; figuresLayer: VectorLayer; linesLayer: VectorLayer; @@ -154,16 +152,6 @@ export const initializeMapState = ( style: modifyStyle }) - const nodeLayerSource = new VectorSource() - const nodeLayer = new VectorLayer({ - source: nodeLayerSource, - style: drawingLayerStyle, - properties: { - id: uuidv4(), - name: 'Узлы' - } - }) - const overlayLayerSource = new VectorSource() const overlayLayer = new VectorLayer({ source: overlayLayerSource, @@ -298,7 +286,6 @@ export const initializeMapState = ( drawingLayer, imageLayer, overlayLayer, - nodeLayer, measureLayer, alignModeLayer, printLayer @@ -473,7 +460,6 @@ export const initializeMapState = ( translate: null, overlayLayerSource: overlayLayerSource, satLayer: satLayer, - nodeLayerSource: nodeLayerSource, staticMapLayer: staticMapLayer, figuresLayer: figuresLayer, linesLayer: linesLayer, @@ -485,7 +471,6 @@ export const initializeMapState = ( baseLayer: baseLayer, measureLayer: measureLayer, measureModify: measureModify, - nodeLayer: nodeLayer, overlayLayer: overlayLayer, districtSelect: districtSelect, regionSelect: regionSelect,