remove unused nodeLayer
This commit is contained in:
@ -19,9 +19,8 @@ import axios from 'axios'
|
|||||||
import MapToolbar from './MapToolbar/MapToolbar'
|
import MapToolbar from './MapToolbar/MapToolbar'
|
||||||
import MapStatusbar from './MapStatusbar/MapStatusbar'
|
import MapStatusbar from './MapStatusbar/MapStatusbar'
|
||||||
import { setAlignMode, setTypeRoles, useMapStore, setMapLabel, } from '../../store/map'
|
import { setAlignMode, setTypeRoles, useMapStore, setMapLabel, } from '../../store/map'
|
||||||
import { useThrottle } from '@uidotdev/usehooks'
|
|
||||||
import ObjectTree from '../Tree/ObjectTree'
|
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 ObjectParameters from './ObjectParameters/ObjectParameters'
|
||||||
import TabsPane, { ITabsPane } from './TabsPane/TabsPane'
|
import TabsPane, { ITabsPane } from './TabsPane/TabsPane'
|
||||||
//import { useSearchParams } from 'react-router-dom'
|
//import { useSearchParams } from 'react-router-dom'
|
||||||
@ -29,7 +28,7 @@ import GeoJSON from 'ol/format/GeoJSON'
|
|||||||
import MapLegend from './MapLegend/MapLegend'
|
import MapLegend from './MapLegend/MapLegend'
|
||||||
import MapMode from './MapMode'
|
import MapMode from './MapMode'
|
||||||
import MapPrint from './MapPrint/MapPrint'
|
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 { useAppStore } from '../../store/app'
|
||||||
import { setDistrictsData, setRegionsData } from '../../store/regions'
|
import { setDistrictsData, setRegionsData } from '../../store/regions'
|
||||||
import View from 'ol/View'
|
import View from 'ol/View'
|
||||||
@ -271,27 +270,6 @@ const MapComponent = ({
|
|||||||
}
|
}
|
||||||
}, [satMapsProvider, satLayer])
|
}, [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(() => {
|
useEffect(() => {
|
||||||
if (!selectedObjectType || !map) return
|
if (!selectedObjectType || !map) return
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@ import { googleMapsSatelliteSource } from '../components/map/MapSources';
|
|||||||
import VectorLayer from 'ol/layer/Vector';
|
import VectorLayer from 'ol/layer/Vector';
|
||||||
import { ImageStatic, OSM } from 'ol/source';
|
import { ImageStatic, OSM } from 'ol/source';
|
||||||
import ImageLayer from 'ol/layer/Image';
|
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 { Fill, Stroke, Style } from 'ol/style';
|
||||||
import { VectorImage } from 'ol/layer';
|
import { VectorImage } from 'ol/layer';
|
||||||
import { click, noModifierKeys, pointerMove } from 'ol/events/condition';
|
import { click, noModifierKeys, pointerMove } from 'ol/events/condition';
|
||||||
@ -68,8 +68,6 @@ interface MapState {
|
|||||||
translate: Translate | null;
|
translate: Translate | null;
|
||||||
overlayLayerSource: VectorSource;
|
overlayLayerSource: VectorSource;
|
||||||
satLayer: TileLayer;
|
satLayer: TileLayer;
|
||||||
nodeLayer: VectorLayer;
|
|
||||||
nodeLayerSource: VectorSource;
|
|
||||||
staticMapLayer: ImageLayer<ImageStatic>;
|
staticMapLayer: ImageLayer<ImageStatic>;
|
||||||
figuresLayer: VectorLayer<VectorSource>;
|
figuresLayer: VectorLayer<VectorSource>;
|
||||||
linesLayer: VectorLayer<VectorSource>;
|
linesLayer: VectorLayer<VectorSource>;
|
||||||
@ -154,16 +152,6 @@ export const initializeMapState = (
|
|||||||
style: modifyStyle
|
style: modifyStyle
|
||||||
})
|
})
|
||||||
|
|
||||||
const nodeLayerSource = new VectorSource()
|
|
||||||
const nodeLayer = new VectorLayer({
|
|
||||||
source: nodeLayerSource,
|
|
||||||
style: drawingLayerStyle,
|
|
||||||
properties: {
|
|
||||||
id: uuidv4(),
|
|
||||||
name: 'Узлы'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const overlayLayerSource = new VectorSource()
|
const overlayLayerSource = new VectorSource()
|
||||||
const overlayLayer = new VectorLayer({
|
const overlayLayer = new VectorLayer({
|
||||||
source: overlayLayerSource,
|
source: overlayLayerSource,
|
||||||
@ -298,7 +286,6 @@ export const initializeMapState = (
|
|||||||
drawingLayer,
|
drawingLayer,
|
||||||
imageLayer,
|
imageLayer,
|
||||||
overlayLayer,
|
overlayLayer,
|
||||||
nodeLayer,
|
|
||||||
measureLayer,
|
measureLayer,
|
||||||
alignModeLayer,
|
alignModeLayer,
|
||||||
printLayer
|
printLayer
|
||||||
@ -473,7 +460,6 @@ export const initializeMapState = (
|
|||||||
translate: null,
|
translate: null,
|
||||||
overlayLayerSource: overlayLayerSource,
|
overlayLayerSource: overlayLayerSource,
|
||||||
satLayer: satLayer,
|
satLayer: satLayer,
|
||||||
nodeLayerSource: nodeLayerSource,
|
|
||||||
staticMapLayer: staticMapLayer,
|
staticMapLayer: staticMapLayer,
|
||||||
figuresLayer: figuresLayer,
|
figuresLayer: figuresLayer,
|
||||||
linesLayer: linesLayer,
|
linesLayer: linesLayer,
|
||||||
@ -485,7 +471,6 @@ export const initializeMapState = (
|
|||||||
baseLayer: baseLayer,
|
baseLayer: baseLayer,
|
||||||
measureLayer: measureLayer,
|
measureLayer: measureLayer,
|
||||||
measureModify: measureModify,
|
measureModify: measureModify,
|
||||||
nodeLayer: nodeLayer,
|
|
||||||
overlayLayer: overlayLayer,
|
overlayLayer: overlayLayer,
|
||||||
districtSelect: districtSelect,
|
districtSelect: districtSelect,
|
||||||
regionSelect: regionSelect,
|
regionSelect: regionSelect,
|
||||||
|
|||||||
Reference in New Issue
Block a user