temporarily disable city extent limit
This commit is contained in:
@ -6,7 +6,7 @@ import Feature from 'ol/Feature'
|
|||||||
import { IRectCoords, SatelliteMapsProvider } from '../../interfaces/map'
|
import { IRectCoords, SatelliteMapsProvider } from '../../interfaces/map'
|
||||||
import { Extent, getCenter } from 'ol/extent'
|
import { Extent, getCenter } from 'ol/extent'
|
||||||
import { highlightStyleRed, highlightStyleYellow } from './MapStyles'
|
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 { Geometry, Point } from 'ol/geom'
|
||||||
import { fromExtent } from 'ol/geom/Polygon'
|
import { fromExtent } from 'ol/geom/Polygon'
|
||||||
import { Coordinate } from 'ol/coordinate'
|
import { Coordinate } from 'ol/coordinate'
|
||||||
@ -39,7 +39,7 @@ import { useAppStore } from '../../store/app'
|
|||||||
import { getDistrictData, getRegionData, setDistrictsData, setRegionsData } from '../../store/regions'
|
import { getDistrictData, getRegionData, setDistrictsData, setRegionsData } from '../../store/regions'
|
||||||
import { ArrowLeft24Regular } from '@fluentui/react-icons'
|
import { ArrowLeft24Regular } from '@fluentui/react-icons'
|
||||||
import View from 'ol/View'
|
import View from 'ol/View'
|
||||||
import { Fill, Icon, Stroke, Style } from 'ol/style'
|
import { Icon, Style } from 'ol/style'
|
||||||
import { fromLonLat } from 'ol/proj'
|
import { fromLonLat } from 'ol/proj'
|
||||||
|
|
||||||
const swrOptions: SWRConfiguration = {
|
const swrOptions: SWRConfiguration = {
|
||||||
@ -227,11 +227,11 @@ const MapComponent = ({
|
|||||||
districtBoundLayer.setSource(bounds)
|
districtBoundLayer.setSource(bounds)
|
||||||
|
|
||||||
//
|
//
|
||||||
bounds.on('featuresloadend', function () {
|
// bounds.on('featuresloadend', function () {
|
||||||
map?.setView(new View({
|
// map?.setView(new View({
|
||||||
extent: bounds.getExtent()
|
// extent: bounds.getExtent()
|
||||||
}))
|
// }))
|
||||||
})
|
// })
|
||||||
}
|
}
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
@ -336,7 +336,6 @@ const MapComponent = ({
|
|||||||
if (currentObjectId) {
|
if (currentObjectId) {
|
||||||
if (figuresLayer) {
|
if (figuresLayer) {
|
||||||
// Reset styles and apply highlight to matching features
|
// Reset styles and apply highlight to matching features
|
||||||
console.log(currentObjectId)
|
|
||||||
figuresLayer.getSource()?.getFeatures().forEach((feature: Feature) => {
|
figuresLayer.getSource()?.getFeatures().forEach((feature: Feature) => {
|
||||||
if (Array.isArray(feature.get('object_id')) ? feature.get('object_id')[0] === currentObjectId : currentObjectId === feature.get('object_id')) {
|
if (Array.isArray(feature.get('object_id')) ? feature.get('object_id')[0] === currentObjectId : currentObjectId === feature.get('object_id')) {
|
||||||
feature.setStyle(highlightStyleRed)
|
feature.setStyle(highlightStyleRed)
|
||||||
@ -583,10 +582,10 @@ const MapComponent = ({
|
|||||||
regionsLayer.setOpacity(0)
|
regionsLayer.setOpacity(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
map?.setView(new View({
|
// map?.setView(new View({
|
||||||
extent: feature?.getGeometry()?.getExtent(),
|
// extent: feature?.getGeometry()?.getExtent(),
|
||||||
showFullExtent: true,
|
// showFullExtent: true,
|
||||||
}))
|
// }))
|
||||||
|
|
||||||
zoomToFeature(id, feature)
|
zoomToFeature(id, feature)
|
||||||
} else if (!selectedRegion) {
|
} else if (!selectedRegion) {
|
||||||
@ -682,7 +681,7 @@ const MapComponent = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
<div style={{ gridRow: '1 / span 1', display: 'grid', gridTemplateColumns: 'min-content auto', position: 'relative' }}>
|
<div style={{ gridRow: '1 / span 1', display: 'grid', gridTemplateColumns: 'min-content auto', position: 'relative' }}>
|
||||||
<div style={{ gridColumn: '1 / span 1', width: 'min-content', height: '100%', position: 'relative', display: 'flex', zIndex: '2' }}>
|
<div style={{ gridColumn: '1 / span 1', width: !selectedRegion || (!!selectedRegion && !selectedYear) ? '300px' : 'min-content', height: '100%', position: 'relative', display: 'flex', zIndex: '2' }}>
|
||||||
<Drawer style={{ position: 'absolute', width: '300px', height: '100%', inset: 0, zIndex: 1 }} open={!selectedRegion || (!!selectedRegion && !selectedYear)} type='inline'>
|
<Drawer style={{ position: 'absolute', width: '300px', height: '100%', inset: 0, zIndex: 1 }} open={!selectedRegion || (!!selectedRegion && !selectedYear)} type='inline'>
|
||||||
{!!selectedRegion && !selectedYear &&
|
{!!selectedRegion && !selectedYear &&
|
||||||
<DrawerHeader style={{ flexDirection: 'row' }}>
|
<DrawerHeader style={{ flexDirection: 'row' }}>
|
||||||
|
|||||||
Reference in New Issue
Block a user