hookehuyr

feat: 添加地图加载中的默认标题并优化标记创建

设置默认标题避免显示undefined,优化标记创建逻辑使其更清晰
<!--
* @Date: 2023-05-31 16:10:33
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-03-06 10:16:37
* @LastEditTime: 2025-09-18 09:49:26
* @FilePath: /map-demo/index.html
* @Description: 文件描述
-->
......@@ -11,7 +11,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<title></title>
<title>地图加载中...</title>
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.compat.css" /> -->
</head>
<body>
......
<!--
* @Date: 2023-05-19 14:54:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-09-08 10:46:16
* @LastEditTime: 2025-09-18 09:52:28
* @FilePath: /map-demo/src/views/checkin/map.vue
* @Description: 公众地图主体页面
-->
......@@ -189,6 +189,13 @@ export default {
*/
mapHeight() {
return this.isMiniProgramWebView ? 'calc(100vh - 80px)' : '100vh';
},
/**
* 获取地图缩放级别
* @returns {number} 地图缩放级别
*/
zoom() {
return this.data_zoom;
}
},
data() {
......@@ -312,6 +319,9 @@ export default {
}
},
async mounted() {
// 设置默认标题,避免显示undefined
document.title = '地图加载中...';
const AMap = await AMapLoader.load({
key: '17b8fc386104b89db88b60b049a6dbce', // 控制台获取
version: '2.0', // 指定API版本
......