remove unused nodeLayer

This commit is contained in:
2025-10-24 11:26:10 +09:00
parent a53fbc7912
commit 99bce93c86
2 changed files with 3 additions and 40 deletions

View File

@ -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

View File

@ -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<ImageStatic>;
figuresLayer: VectorLayer<VectorSource>;
linesLayer: VectorLayer<VectorSource>;
@ -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,