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 { 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 = ({
|
||||
}
|
||||
|
||||
<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'>
|
||||
{!!selectedRegion && !selectedYear &&
|
||||
<DrawerHeader style={{ flexDirection: 'row' }}>
|
||||
|
||||
Reference in New Issue
Block a user