diff --git a/client/src/components/map/MapComponent.tsx b/client/src/components/map/MapComponent.tsx index 0f8119d..49e6253 100644 --- a/client/src/components/map/MapComponent.tsx +++ b/client/src/components/map/MapComponent.tsx @@ -6,7 +6,7 @@ import Feature from 'ol/Feature' import { IRectCoords, SatelliteMapsProvider } from '../../interfaces/map' import { Extent, getCenter } from 'ol/extent' import { highlightStyleRed, highlightStyleYellow } from './MapStyles' -import { customMapSource, googleMapsSatelliteSource, regionsLayerSource, yandexMapsSatelliteSource } from './MapSources' +import { customMapSource, googleMapsSatelliteSource, yandexMapsSatelliteSource } from './MapSources' import { Geometry, Point } from 'ol/geom' import { fromExtent } from 'ol/geom/Polygon' import { Coordinate } from 'ol/coordinate' @@ -39,7 +39,7 @@ import { useAppStore } from '../../store/app' import { getDistrictData, getRegionData, setDistrictsData, setRegionsData } from '../../store/regions' import { ArrowLeft24Regular } from '@fluentui/react-icons' import View from 'ol/View' -import { Fill, Icon, Stroke, Style } from 'ol/style' +import { Icon, Style } from 'ol/style' import { fromLonLat } from 'ol/proj' const swrOptions: SWRConfiguration = { @@ -227,11 +227,11 @@ const MapComponent = ({ districtBoundLayer.setSource(bounds) // - bounds.on('featuresloadend', function () { - map?.setView(new View({ - extent: bounds.getExtent() - })) - }) + // bounds.on('featuresloadend', function () { + // map?.setView(new View({ + // extent: bounds.getExtent() + // })) + // }) } return () => { @@ -336,7 +336,6 @@ const MapComponent = ({ if (currentObjectId) { if (figuresLayer) { // Reset styles and apply highlight to matching features - console.log(currentObjectId) figuresLayer.getSource()?.getFeatures().forEach((feature: Feature) => { if (Array.isArray(feature.get('object_id')) ? feature.get('object_id')[0] === currentObjectId : currentObjectId === feature.get('object_id')) { feature.setStyle(highlightStyleRed) @@ -583,10 +582,10 @@ const MapComponent = ({ regionsLayer.setOpacity(0) } - map?.setView(new View({ - extent: feature?.getGeometry()?.getExtent(), - showFullExtent: true, - })) + // map?.setView(new View({ + // extent: feature?.getGeometry()?.getExtent(), + // showFullExtent: true, + // })) zoomToFeature(id, feature) } else if (!selectedRegion) { @@ -682,7 +681,7 @@ const MapComponent = ({ }
-
+
{!!selectedRegion && !selectedYear &&