карта ПВЗ
All checks were successful
Deploy / build (push) Successful in 56s

This commit is contained in:
alsaze
2025-10-15 17:01:37 +03:00
parent 9c59939015
commit 9f2a6e5dd2
2 changed files with 67 additions and 6 deletions

View File

@@ -21,6 +21,7 @@ const token = '13f4c06b-cb7e-4eeb-81f1-af52f12587b2'
const mapContainer = ref<HTMLDivElement | null>(null)
const { coords } = useGeolocation()
const coordsReady = ref(false)
const mapInstance = ref<any | null>(null)
const initMap = async (lat: number, lon: number) => {
if (!window.ymaps) {
@@ -38,6 +39,7 @@ const initMap = async (lat: number, lon: number) => {
zoom: 10,
controls: ['zoomControl'],
})
mapInstance.value = map
props.pickupPoints.forEach((point) => {
const placemark = new window.ymaps.Placemark(
@@ -53,6 +55,15 @@ const initMap = async (lat: number, lon: number) => {
})
}
const centerMap = (lat: number, lon: number) => {
if (!mapInstance.value)
return
mapInstance.value.setCenter([lat, lon], 18)
}
defineExpose({ centerMap })
watch(
() => coords.value,
async (val) => {