diff --git a/src/api/map.ts b/src/api/map.ts new file mode 100644 index 0000000..220d9f0 --- /dev/null +++ b/src/api/map.ts @@ -0,0 +1,14 @@ +import axios from 'axios' +import useMapStore from '@/store/modules/map' +const mapStore = useMapStore() +// 根据地理信息获取经纬度 +export function getLatlng(address: string) { + // 例 address = 北京市 + return axios.get(`https://restapi.amap.com/v3/geocode/geo?address=${address}&key=${mapStore.key}`) +} +// 根据经纬度获取详细位置信息 +export function getLocation(posotion: string) { + // 例子 posotion = 116.3254,39.1458 + return axios.get(`https://restapi.amap.com/v3/place/around?location=${posotion}&key=${mapStore.key}&offset=1`) +} + diff --git a/src/api/map.ts b/src/api/map.ts new file mode 100644 index 0000000..220d9f0 --- /dev/null +++ b/src/api/map.ts @@ -0,0 +1,14 @@ +import axios from 'axios' +import useMapStore from '@/store/modules/map' +const mapStore = useMapStore() +// 根据地理信息获取经纬度 +export function getLatlng(address: string) { + // 例 address = 北京市 + return axios.get(`https://restapi.amap.com/v3/geocode/geo?address=${address}&key=${mapStore.key}`) +} +// 根据经纬度获取详细位置信息 +export function getLocation(posotion: string) { + // 例子 posotion = 116.3254,39.1458 + return axios.get(`https://restapi.amap.com/v3/place/around?location=${posotion}&key=${mapStore.key}&offset=1`) +} + diff --git a/src/api/page/recognition.ts b/src/api/page/recognition.ts index 6133636..bdc4cb6 100644 --- a/src/api/page/recognition.ts +++ b/src/api/page/recognition.ts @@ -10,3 +10,11 @@ data: params, }) } +// 识别详情 +export function getIdentifyDetail(params: any) { + return request({ + url: '/system/analysisRecognition/detail', + method: 'post', + data: params, + }) +} diff --git a/src/api/map.ts b/src/api/map.ts new file mode 100644 index 0000000..220d9f0 --- /dev/null +++ b/src/api/map.ts @@ -0,0 +1,14 @@ +import axios from 'axios' +import useMapStore from '@/store/modules/map' +const mapStore = useMapStore() +// 根据地理信息获取经纬度 +export function getLatlng(address: string) { + // 例 address = 北京市 + return axios.get(`https://restapi.amap.com/v3/geocode/geo?address=${address}&key=${mapStore.key}`) +} +// 根据经纬度获取详细位置信息 +export function getLocation(posotion: string) { + // 例子 posotion = 116.3254,39.1458 + return axios.get(`https://restapi.amap.com/v3/place/around?location=${posotion}&key=${mapStore.key}&offset=1`) +} + diff --git a/src/api/page/recognition.ts b/src/api/page/recognition.ts index 6133636..bdc4cb6 100644 --- a/src/api/page/recognition.ts +++ b/src/api/page/recognition.ts @@ -10,3 +10,11 @@ data: params, }) } +// 识别详情 +export function getIdentifyDetail(params: any) { + return request({ + url: '/system/analysisRecognition/detail', + method: 'post', + data: params, + }) +} diff --git a/src/components/map/components/car.vue b/src/components/map/components/car.vue index c0af01c..5d21839 100644 --- a/src/components/map/components/car.vue +++ b/src/components/map/components/car.vue @@ -4,6 +4,7 @@ Date: 2023-05-10 --> @@ -51,14 +70,14 @@ 位置: - + - {{ info?.position }} + {{ position }} @@ -66,6 +85,13 @@