Compare commits
No commits in common. "dev" and "v1.1.29" have entirely different histories.
2 changed files with 50 additions and 94 deletions
|
|
@ -163,19 +163,8 @@ function reattachAndResizeMap(retry = 0) {
|
|||
mapView.value.container = activeContainer
|
||||
}
|
||||
|
||||
// เรียก resize() อย่างปลอดภัยด้วยการตรวจสอบว่ามี method นี้หรือไม่
|
||||
try {
|
||||
if (typeof mapView.value.resize === 'function') {
|
||||
mapView.value.resize()
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn('Map resize failed:', error)
|
||||
}
|
||||
|
||||
if (typeof mapView.value.requestRender === 'function') {
|
||||
mapView.value.requestRender?.()
|
||||
}
|
||||
|
||||
mapView.value.resize()
|
||||
mapView.value.requestRender?.()
|
||||
mapView.value
|
||||
.goTo(
|
||||
{
|
||||
|
|
@ -296,11 +285,7 @@ async function initializeMap() {
|
|||
geometry: userPoint,
|
||||
symbol: userSymbol,
|
||||
})
|
||||
|
||||
// เพิ่มการตรวจสอบความปลอดภัยก่อนเข้าถึง graphics
|
||||
if (mapView.value && mapView.value.graphics && !mapView.value.destroyed) {
|
||||
mapView.value.graphics.add(userGraphic)
|
||||
}
|
||||
mapView.value.graphics.add(userGraphic)
|
||||
// Get POI place ยิงไปขอที่ server ของกทม.ก่อน
|
||||
// await axios
|
||||
// .get(
|
||||
|
|
@ -396,22 +381,12 @@ async function initializeMap() {
|
|||
geometry: poiPoint,
|
||||
symbol: poiSymbol,
|
||||
})
|
||||
|
||||
// เพิ่มการตรวจสอบความปลอดภัยก่อนเข้าถึง graphics และ goTo
|
||||
if (mapView.value && !mapView.value.destroyed) {
|
||||
if (mapView.value.graphics) {
|
||||
mapView.value.graphics.add(poiGraphic)
|
||||
}
|
||||
// อัปเดตการแสดงผลให้แสดงทั้งตำแหน่งของผู้ใช้และ POI
|
||||
if (typeof mapView.value.goTo === 'function') {
|
||||
mapView.value.goTo({
|
||||
target: [userPoint, poiPoint],
|
||||
zoom: zoomMap.value,
|
||||
}).catch(() => {
|
||||
// Ignore goTo errors
|
||||
})
|
||||
}
|
||||
}
|
||||
mapView.value.graphics.add(poiGraphic)
|
||||
// อัปเดตการแสดงผลให้แสดงทั้งตำแหน่งของผู้ใช้และ POI
|
||||
mapView.value.goTo({
|
||||
target: [userPoint, poiPoint],
|
||||
zoom: zoomMap.value,
|
||||
})
|
||||
|
||||
updateLocation(latitude, longitude, poiPlaceName.value)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -638,18 +638,19 @@ async function fetchCheckStatus() {
|
|||
/** inQueue เป็น true */
|
||||
isDisabledCheckTime.value = true
|
||||
msgCheckTime.value = 'ระบบกำลังประมวลผล'
|
||||
// if (intervalId.value === undefined) {
|
||||
// intervalId.value = setInterval(async () => {
|
||||
// try {
|
||||
// await fetchCheckStatus()
|
||||
// } catch (error) {
|
||||
// console.error('Error in interval fetchCheckStatus:', error)
|
||||
// // หยุด interval ถ้าเกิด error
|
||||
// stopChecking()
|
||||
// }
|
||||
// }, 3000)
|
||||
// console.log('startChecking called, intervalId:', intervalId.value)
|
||||
// }
|
||||
if (intervalId.value === undefined) {
|
||||
intervalId.value = setInterval(async () => {
|
||||
try {
|
||||
await fetchCheckStatus()
|
||||
} catch (error) {
|
||||
console.error('Error in interval fetchCheckStatus:', error)
|
||||
// หยุด interval ถ้าเกิด error
|
||||
stopChecking()
|
||||
}
|
||||
}, 3000)
|
||||
console.log('startChecking called, intervalId:', intervalId.value)
|
||||
}
|
||||
// hideLoader()
|
||||
} else {
|
||||
/** inQueue เป็น false */
|
||||
isDisabledCheckTime.value = false
|
||||
|
|
@ -1413,13 +1414,13 @@ watch(notificationCounter, () => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="cameraIsOn && img == null">
|
||||
<div v-if="cameraIsOn">
|
||||
<div
|
||||
v-if="$q.screen.gt.xs"
|
||||
class="absolute-bottom-right q-ma-md"
|
||||
>
|
||||
<q-btn
|
||||
v-if="availableCameras.length > 1"
|
||||
v-if="availableCameras.length > 1 && img == null"
|
||||
round
|
||||
push
|
||||
icon="flip_camera_ios"
|
||||
|
|
@ -1429,6 +1430,7 @@ watch(notificationCounter, () => {
|
|||
@click="switchCamera"
|
||||
/>
|
||||
<q-btn
|
||||
v-if="img == null"
|
||||
round
|
||||
push
|
||||
icon="photo_camera"
|
||||
|
|
@ -1436,41 +1438,8 @@ watch(notificationCounter, () => {
|
|||
color="positive"
|
||||
@click="capturePhoto"
|
||||
/>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div
|
||||
class="absolute-bottom text-subtitle2 text-center q-py-sm"
|
||||
style="background: #00000021"
|
||||
>
|
||||
<q-btn
|
||||
v-if="availableCameras.length > 1"
|
||||
round
|
||||
icon="flip_camera_ios"
|
||||
size="16px"
|
||||
style="background: #424242; color: white"
|
||||
@click="switchCamera"
|
||||
unelevated
|
||||
class="q-mr-xs"
|
||||
/>
|
||||
<q-btn
|
||||
round
|
||||
icon="photo_camera"
|
||||
size="18px"
|
||||
style="background: #263238; color: white"
|
||||
@click="capturePhoto"
|
||||
unelevated
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Refresh button - shows when photo is captured regardless of camera state -->
|
||||
<div v-if="img != null && !useNativePhotoCapture">
|
||||
<div
|
||||
v-if="$q.screen.gt.xs"
|
||||
class="absolute-bottom-right q-ma-md"
|
||||
>
|
||||
<q-btn
|
||||
v-else
|
||||
round
|
||||
push
|
||||
icon="refresh"
|
||||
|
|
@ -1485,12 +1454,31 @@ watch(notificationCounter, () => {
|
|||
style="background: #00000021"
|
||||
>
|
||||
<q-btn
|
||||
v-if="availableCameras.length > 1 && img == null"
|
||||
round
|
||||
icon="flip_camera_ios"
|
||||
size="16px"
|
||||
style="background: #424242; color: white"
|
||||
@click="switchCamera"
|
||||
unelevated
|
||||
class="q-mr-xs"
|
||||
/>
|
||||
<q-btn
|
||||
round
|
||||
v-if="img == null"
|
||||
icon="photo_camera"
|
||||
size="18px"
|
||||
style="background: #263238; color: white"
|
||||
@click="capturePhoto"
|
||||
unelevated
|
||||
/>
|
||||
<q-btn
|
||||
v-else
|
||||
round
|
||||
icon="refresh"
|
||||
size="18px"
|
||||
style="background: #263238; color: white"
|
||||
@click="refreshPhoto"
|
||||
unelevated
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1562,13 +1550,13 @@ watch(notificationCounter, () => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="cameraIsOn && img == null">
|
||||
<div v-if="cameraIsOn">
|
||||
<div
|
||||
class="absolute-bottom text-subtitle2 text-center q-py-sm"
|
||||
style="background: #00000021"
|
||||
>
|
||||
<q-btn
|
||||
v-if="availableCameras.length > 1"
|
||||
v-if="availableCameras.length > 1 && img == null"
|
||||
round
|
||||
icon="flip_camera_ios"
|
||||
size="16px"
|
||||
|
|
@ -1579,22 +1567,15 @@ watch(notificationCounter, () => {
|
|||
/>
|
||||
<q-btn
|
||||
round
|
||||
v-if="img == null"
|
||||
icon="photo_camera"
|
||||
size="18px"
|
||||
style="background: #263238; color: white"
|
||||
@click="capturePhoto"
|
||||
unelevated
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Refresh button - shows when photo is captured regardless of camera state -->
|
||||
<div v-if="img != null && !useNativePhotoCapture">
|
||||
<div
|
||||
class="absolute-bottom text-subtitle2 text-center q-py-sm"
|
||||
style="background: #00000021"
|
||||
>
|
||||
<q-btn
|
||||
v-else
|
||||
round
|
||||
icon="refresh"
|
||||
size="18px"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue