af-mobile-client-vue3 1.1.17 → 1.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -15,12 +15,15 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
15
15
|
defaultCenter: () => {
|
|
16
16
|
try {
|
|
17
17
|
mobileUtil.execute({
|
|
18
|
-
param:
|
|
19
|
-
funcName: '
|
|
18
|
+
param: {},
|
|
19
|
+
funcName: 'getLocationResult',
|
|
20
20
|
callbackFunc: (result) => {
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
23
|
-
|
|
21
|
+
const res = result as PhoneLocationStatus
|
|
22
|
+
if (res.status === 'success') {
|
|
23
|
+
const locationResult = JSON.parse(res.data.location)
|
|
24
|
+
if (locationResult.longitude && locationResult.latitude) {
|
|
25
|
+
return [locationResult.longitude, locationResult.latitude]
|
|
26
|
+
}
|
|
24
27
|
}
|
|
25
28
|
},
|
|
26
29
|
})
|
|
@@ -818,16 +818,19 @@ async function handleLocation() {
|
|
|
818
818
|
|
|
819
819
|
try {
|
|
820
820
|
mobileUtil.execute({
|
|
821
|
-
param:
|
|
822
|
-
funcName: '
|
|
821
|
+
param: {},
|
|
822
|
+
funcName: 'getLocationResult',
|
|
823
823
|
callbackFunc: (result) => {
|
|
824
|
-
const
|
|
825
|
-
if (
|
|
826
|
-
const
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
824
|
+
const res = result as PhoneLocationStatus
|
|
825
|
+
if (res.status === 'success') {
|
|
826
|
+
const locationResult = JSON.parse(res.data.location)
|
|
827
|
+
if (locationResult.longitude && locationResult.latitude) {
|
|
828
|
+
const center: [number, number] = [locationResult.longitude, locationResult.latitude]
|
|
829
|
+
setCenterAndZoom(center, getZoom())
|
|
830
|
+
// 更新位置图标
|
|
831
|
+
if (isFollowingLocation.value) {
|
|
832
|
+
updateLocationMarker(center)
|
|
833
|
+
}
|
|
831
834
|
}
|
|
832
835
|
}
|
|
833
836
|
},
|
|
@@ -10,12 +10,12 @@ export interface LocationResult {
|
|
|
10
10
|
|
|
11
11
|
/** 手机状态接口 */
|
|
12
12
|
export interface PhoneLocationStatus {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
|
|
14
|
+
status: string
|
|
15
|
+
|
|
16
|
+
data: {
|
|
17
|
+
location: string;
|
|
18
|
+
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/** 初始化参数接口 */
|