|
|
@ -41,6 +41,7 @@ import axios from 'axios';
|
|
|
|
|
|
|
|
|
|
|
|
const attributionHtml = `©2024 高德软件- <span>审图号:GS(2021)6375号</span>
|
|
|
|
const attributionHtml = `©2024 高德软件- <span>审图号:GS(2021)6375号</span>
|
|
|
|
- 甲测资字11111093 - <a href="https://map.amap.com/doc/serviceitem.html" target="_blank" trace="tos">服务条款</a> `
|
|
|
|
- 甲测资字11111093 - <a href="https://map.amap.com/doc/serviceitem.html" target="_blank" trace="tos">服务条款</a> `
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
const basePathUrl = window.basePathUrl || "";
|
|
|
|
const basePathUrl = window.basePathUrl || "";
|
|
|
@ -48,53 +49,21 @@ export default {
|
|
|
|
configUrl: basePathUrl + "config/config.json",
|
|
|
|
configUrl: basePathUrl + "config/config.json",
|
|
|
|
mapOptions: {
|
|
|
|
mapOptions: {
|
|
|
|
copyright: false,
|
|
|
|
copyright: false,
|
|
|
|
// basemaps: [
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// id: 2021,
|
|
|
|
|
|
|
|
// pid: 10,
|
|
|
|
|
|
|
|
// name: "高德电子",
|
|
|
|
|
|
|
|
// icon: "img/basemaps/gaode_vec.png",
|
|
|
|
|
|
|
|
// type: "gaode",
|
|
|
|
|
|
|
|
// layer: "vec",
|
|
|
|
|
|
|
|
// show: true
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
basemaps: [
|
|
|
|
basemaps: [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
name: "高德地图",
|
|
|
|
id: 2021,
|
|
|
|
|
|
|
|
chinaCRS: "GCJ02",
|
|
|
|
|
|
|
|
pid: 10,
|
|
|
|
|
|
|
|
name: "高德电子",
|
|
|
|
|
|
|
|
icon: "img/basemaps/gaode_vec.png",
|
|
|
|
type: "gaode",
|
|
|
|
type: "gaode",
|
|
|
|
layer: "vec",
|
|
|
|
layer: "vec",
|
|
|
|
show: true,
|
|
|
|
show: true
|
|
|
|
// maxZoom: 21,
|
|
|
|
|
|
|
|
// maxNativeZoom: 18,
|
|
|
|
|
|
|
|
attribution: attributionHtml
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: "高德卫星",
|
|
|
|
|
|
|
|
type: "group",
|
|
|
|
|
|
|
|
layers: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
type: "gaode",
|
|
|
|
|
|
|
|
layer: "img_d"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
type: "gaode",
|
|
|
|
|
|
|
|
layer: "img_z"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
attribution: attributionHtml
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: "高德大字体地图",
|
|
|
|
|
|
|
|
type: "gaode",
|
|
|
|
|
|
|
|
layer: "vec",
|
|
|
|
|
|
|
|
bigfont: true,
|
|
|
|
|
|
|
|
attribution: attributionHtml
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
],
|
|
|
|
center: { lat: 31.2304, lng: 120.6184 },
|
|
|
|
center: { lat: 31.2304, lng: 120.6184 },
|
|
|
|
zoom: 10,
|
|
|
|
zoom: 10,
|
|
|
|
CRS: "BAIDU"
|
|
|
|
chinaCRS: 'GCJ02'
|
|
|
|
},
|
|
|
|
},
|
|
|
|
map: null,
|
|
|
|
map: null,
|
|
|
|
floatingPanelVisible: false,
|
|
|
|
floatingPanelVisible: false,
|
|
|
@ -149,15 +118,21 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
confirmPoint() {
|
|
|
|
confirmPoint() {
|
|
|
|
if (this.pointForm.name) {
|
|
|
|
if (!this.pointForm.address) {
|
|
|
|
this.selectedPlaceName = this.pointForm.name;
|
|
|
|
this.$message.warning('请先落点选择地址');
|
|
|
|
} else if (this.pointForm.address) {
|
|
|
|
return;
|
|
|
|
this.selectedPlaceName = this.pointForm.address;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 通知父组件关闭弹窗并传递地址信息
|
|
|
|
|
|
|
|
this.$emit('confirm-selection', {
|
|
|
|
|
|
|
|
address: this.pointForm.address,
|
|
|
|
|
|
|
|
lng: this.pointForm.lng,
|
|
|
|
|
|
|
|
lat: this.pointForm.lat
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
this.hideFloatingPanel();
|
|
|
|
this.hideFloatingPanel();
|
|
|
|
this.$message.success('地点选择成功');
|
|
|
|
this.$message.success('地点选择成功');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 逆地理编码 - 根据经纬度获取地址
|
|
|
|
// 逆地理编码 - 根据经纬度获取地址
|
|
|
|
reverseGeocode() {
|
|
|
|
reverseGeocode() {
|
|
|
|
if (!this.pointForm.lat || !this.pointForm.lng) return;
|
|
|
|
if (!this.pointForm.lat || !this.pointForm.lng) return;
|
|
|
@ -187,7 +162,10 @@ export default {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.$message.warning('未能获取详细地址信息');
|
|
|
|
this.$message.warning('未能获取详细地址信息');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).catch().finally(() => {
|
|
|
|
}).catch(error => {
|
|
|
|
|
|
|
|
console.error('逆地理编码失败:', error);
|
|
|
|
|
|
|
|
this.$message.error('获取地址信息失败');
|
|
|
|
|
|
|
|
}).finally(() => {
|
|
|
|
this.loadingAddress = false;
|
|
|
|
this.loadingAddress = false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -202,12 +180,6 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
toSearch() {
|
|
|
|
toSearch() {
|
|
|
|
if (!this.keyword.trim()) {
|
|
|
|
|
|
|
|
this.$message({
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let params = {
|
|
|
|
let params = {
|
|
|
|
key: this.gaodeKey,
|
|
|
|
key: this.gaodeKey,
|
|
|
|
keywords: this.keyword,
|
|
|
|
keywords: this.keyword,
|
|
|
|