`;
- if (marker.name) {
- infoWindowContent += `
${marker.name}
`;
+ if (pois.name) {
+ infoWindowContent += `
${pois.name}
`;
}
- if (marker.address) {
- infoWindowContent += `
地址:${marker.address}
`;
+ if (pois.address) {
+ infoWindowContent += `
地址:${pois.address}
`;
}
infoWindowContent += '
';
let infoWindow = new AMap.InfoWindow({
@@ -315,8 +328,13 @@ export default {
);
});
this.searchPanelVisible = false;
- if (marker.address) {
- this.form.address = marker.address;
+ this.marker.on('click', () => {
+ if (pois.address) {
+ this.form.address = pois.address;
+ }
+ });
+ if (pois.address) {
+ this.form.address = pois.address;
}
},
close() {
@@ -367,8 +385,9 @@ export default {
}
});
} else {
+ //因为权限或其他原因导致无法自动获取定位,不抛出异常,由用户手动选择地址即可
console.error(result);
- reject(result);
+ /* reject(result);*/
/* this.$emit('error', '无法获取定位信息:' + result.message);*/
}
});