fix(map): زوماوت آزاد در نقشهٔ صفحهٔ پروژه — حذف maxBounds که جابهجایی را به محدودهٔ پروژه میبست
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { useMemo } from 'react'
|
||||
import { createPortal } from 'react-dom'
|
||||
import { MdOpenInNew } from 'react-icons/md'
|
||||
import { boundsForProjects, buildGoogleMapsUrl, type MapProject } from '../data/mapProjects'
|
||||
import { buildGoogleMapsUrl, type MapProject } from '../data/mapProjects'
|
||||
import { useLang } from '../i18n/lang'
|
||||
import { MapViewport } from './MapViewport'
|
||||
import { POPUP_PRIMARY_CLASS, ProjectPopupCard } from './ProjectPopupCard'
|
||||
@@ -25,11 +25,11 @@ export type ProjectsMapSingleProps = {
|
||||
export function ProjectsMapSingle({ location, images = [], className = '' }: ProjectsMapSingleProps) {
|
||||
const { t } = useLang()
|
||||
const projects = useMemo(() => [location], [location])
|
||||
const bounds = useMemo(() => boundsForProjects(projects, 0.008), [projects])
|
||||
// بدون maxBounds — زوماوت آزاد تا دید کشوری (همرفتار با نقشهٔ صفحهٔ پروژهها)
|
||||
const { containerRef, map, status, retry } = useMapLibre({
|
||||
center: [location.lng, location.lat],
|
||||
zoom: 15,
|
||||
maxBounds: bounds,
|
||||
minZoom: 5,
|
||||
})
|
||||
const { popupHost, activeProject, closePopup } = useProjectMarkers(map, projects)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user