hookehuyr

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

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