物业主开发
This commit is contained in:
@@ -150,7 +150,7 @@ const submitForm = () => {
|
||||
// 返回
|
||||
const cancelForm = () => {
|
||||
router.push({
|
||||
path: '/inspection/point'
|
||||
path: '/Inspection/point'
|
||||
});
|
||||
};
|
||||
|
||||
@@ -170,6 +170,23 @@ onMounted(async () => {
|
||||
plugins: ['AMap.Scale', 'AMap.Marker']
|
||||
}).then(async (AMap) => {
|
||||
const villageinfo = await getVillageByIdAPI(villageid);
|
||||
|
||||
AMap.plugin('AMap.Geocoder', function () {
|
||||
const city = villageinfo.data.city.replaceAll('/', '');
|
||||
const geocoder = new AMap.Geocoder({
|
||||
city: city // city 指定进行编码查询的城市,支持传入城市名、adcode 和 citycode
|
||||
});
|
||||
|
||||
const address = villageinfo.data.address;
|
||||
|
||||
geocoder.getLocation(address, function (status, result) {
|
||||
if (status === 'complete' && result.info === 'OK') {
|
||||
// result中对应详细地理坐标信息
|
||||
map.value.setCenter(result.geocodes[0].location.toArray());
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
map.value = new AMap.Map('containerMap', {
|
||||
viewMode: '3D',
|
||||
zoom: 11,
|
||||
|
||||
Reference in New Issue
Block a user