"use strict"; const common_vendor = require("../../common/vendor.js"); const pages_api_luyou = require("../api/luyou.js"); const _sfc_main = { data() { return { latitude: 38.818143, // 保定理工的纬度 longitude: 115.484621, // 保定理工的经度 scale: 14, markers: [], polylines: [], includePoints: [], // 添加要包含在地图视野内的点 showAllMarkers: false, // 是否显示所有景点 searchKeyword: "", selectedLocations: [], currentIndex: -1, jingdian: [], // 存储景点数据 targetSpotName: "", // 目标景点名称 defaultBaodingSpots: [ { id: 999, name: "保定古莲花池", pinyin: "baodinggulianhuchi", description: "始建于唐代,是保定市著名的风景名胜区,国家AAAA级旅游景区", address: "河北省保定市莲池区牌坊街67号", city: "保定", category: "景区", latitude: 38.8743, longitude: 115.4646, image: "/static/default_attraction.jpg" }, { id: 998, name: "保定直隶总督署", pinyin: "baodingzhilizongedushu", description: "中国保存最完整的清代省级衙署,是河北省重点文物保护单位", address: "河北省保定市莲池区东风路1399号", city: "保定", category: "景区", latitude: 38.87346, longitude: 115.47486, image: "/static/default_attraction.jpg" }, { id: 997, name: "保定野三坡景区", pinyin: "baodingyesanpo", description: "国家AAAAA级景区,以奇峰、怪石、峡谷、溶洞和清泉著称", address: "河北省保定市涞水县野三坡镇", city: "保定", category: "景区", latitude: 39.46082, longitude: 115.61501, image: "/static/default_attraction.jpg" } ] }; }, onLoad(options) { if (options.lat && options.lng && options.name) { this.latitude = parseFloat(options.lat); this.longitude = parseFloat(options.lng); this.targetSpotName = decodeURIComponent(options.name); this.scale = 15; common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:176", `接收到景点定位参数: ${this.targetSpotName}, 坐标: ${this.latitude}, ${this.longitude}`); common_vendor.index.showToast({ title: `定位到: ${this.targetSpotName}`, icon: "none", duration: 2e3 }); } this.initMap(); common_vendor.index.showLoading({ title: "加载景点数据..." }); this.setDefaultBaodingSpots(); this.getJingdian(); }, methods: { // 设置默认保定景点 setDefaultBaodingSpots() { this.jingdian = [...this.defaultBaodingSpots]; this.latitude = this.defaultBaodingSpots[0].latitude; this.longitude = this.defaultBaodingSpots[0].longitude; this.createMarkersFromJingdian(); }, // 查询景点数据 getJingdian() { pages_api_luyou.findalls().then((res) => { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:218", "API返回原始数据:", JSON.stringify(res)); common_vendor.index.hideLoading(); if (res && res.code === 200) { this.apiResponse = res; let data = null; if (res.obj) { data = res.obj; common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:233", "数据在res.obj中, 长度:", data.length); } else if (res.data && res.data.obj) { data = res.data.obj; common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:236", "数据在res.data.obj中, 长度:", data.length); } else if (res.data) { data = res.data; common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:239", "数据在res.data中, 长度:", data.length); } else { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:241", "尝试解析完整响应"); data = res; } let apiJingdian = []; if (Array.isArray(data)) { apiJingdian = data; common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:250", "直接使用数组数据, 长度:", apiJingdian.length); } else { for (const key in data) { if (Array.isArray(data[key]) && data[key].length > 0) { apiJingdian = data[key]; common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:256", `找到数组数据在${key}字段中, 长度:`, apiJingdian.length); break; } } } if (apiJingdian && apiJingdian.length > 0) { const processedApiData = apiJingdian.map((item) => { if (!item.latitude || !item.longitude) { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:267", `景点${item.name || "未命名"}没有坐标,尝试解析其他字段`); if (item.latitudeStr && item.longitudeStr) { item.latitude = parseFloat(item.latitudeStr); item.longitude = parseFloat(item.longitudeStr); common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:273", `从latitudeStr/longitudeStr字段获取到坐标: ${item.latitude}, ${item.longitude}`); } else if (item.lat && item.lng) { item.latitude = parseFloat(item.lat); item.longitude = parseFloat(item.lng); common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:277", `从lat/lng字段获取到坐标: ${item.latitude}, ${item.longitude}`); } } if (item.latitude) item.latitude = Number(item.latitude); if (item.longitude) item.longitude = Number(item.longitude); return item; }).filter((item) => { const hasValidCoords = item.latitude && item.longitude && !isNaN(Number(item.latitude)) && !isNaN(Number(item.longitude)); if (!hasValidCoords) { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:291", `过滤掉无效坐标的景点: ${item.name || "未命名"}`); } return hasValidCoords; }); common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:296", `处理后的有效API景点数据: ${processedApiData.length}个`); this.jingdian = [...this.defaultBaodingSpots, ...processedApiData]; common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:301", "合并后总景点数据:", this.jingdian.length); if (this.jingdian.length > 0) { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:303", "第一条数据:", JSON.stringify(this.jingdian[0])); } common_vendor.index.showToast({ title: `成功加载${this.jingdian.length}个景点`, icon: "success" }); this.createMarkersFromJingdian(); if (this.targetSpotName) { this.selectTargetSpot(); } this.adjustMapViewToShowAllSpots(); } else { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:322", "API未返回有效景点数据,继续使用默认景点"); common_vendor.index.showToast({ title: "使用默认景点数据", icon: "none" }); if (this.targetSpotName) { this.selectTargetSpot(); } } } else { common_vendor.index.__f__("error", "at pages/custom-trip/map.vue:334", "API返回错误:", res); common_vendor.index.showToast({ title: res && res.message ? res.message : "查询失败,使用默认景点", icon: "none" }); } }).catch((error) => { common_vendor.index.hideLoading(); common_vendor.index.__f__("error", "at pages/custom-trip/map.vue:342", "查询失败:", error); common_vendor.index.showToast({ title: "加载API景点失败,使用默认景点", icon: "none" }); }); }, // 调整地图视野以包含所有景点 adjustMapViewToShowAllSpots() { if (!this.jingdian || this.jingdian.length === 0) return; common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:354", "调整地图视野以显示所有景点"); let latSum = 0; let lngSum = 0; let validSpots = 0; this.jingdian.forEach((spot) => { if (spot.latitude && spot.longitude) { latSum += Number(spot.latitude); lngSum += Number(spot.longitude); validSpots++; } }); if (validSpots > 0) { const centerLat = latSum / validSpots; const centerLng = lngSum / validSpots; common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:376", `设置地图中心点为所有景点的地理中心: ${centerLat}, ${centerLng}`); this.latitude = centerLat; this.longitude = centerLng; } }, // 从景点数据创建标记 createMarkersFromJingdian() { if (!this.jingdian || this.jingdian.length === 0) { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:387", "景点数据为空"); common_vendor.index.showToast({ title: "景点数据为空", icon: "none" }); return; } common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:395", "开始创建标记,景点数据长度:", this.jingdian.length); [...this.markers]; const poiMarkers = this.jingdian.filter((poi) => { if (!poi) { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:403", "发现无效的景点数据(null或undefined)"); return false; } const hasCoords = poi.latitude && poi.longitude; if (!hasCoords) { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:409", `景点${poi.name || "未命名"}没有有效的坐标`); return false; } return true; }).map((poi, index) => { try { const lat = Number(poi.latitude); const lng = Number(poi.longitude); common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:417", `处理景点 ID=${poi.id}, 名称=${poi.name}, 坐标: ${lat}, ${lng}`); if (isNaN(lat) || isNaN(lng)) { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:421", `景点${poi.name}的坐标转换为数字后不有效`); return null; } const iconType = poi.category || poi.type || "attraction"; const iconPath = this.getMarkerIcon(iconType); return { id: poi.id || index + 1, latitude: lat, longitude: lng, title: poi.name || poi.title, iconPath, width: 36, // 增大标记尺寸以提高可见度 height: 36, callout: { content: poi.name || poi.title, color: "#333333", fontSize: 12, borderRadius: 4, padding: 5, display: "BYCLICK" } }; } catch (error) { common_vendor.index.__f__("error", "at pages/custom-trip/map.vue:447", `处理景点${poi.name || "未命名"}时出错:`, error); return null; } }).filter((marker) => marker !== null); common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:452", `生成了${poiMarkers.length}个景点标记`); if (poiMarkers.length > 0) { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:454", "示例标记:", JSON.stringify(poiMarkers[0])); } else { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:456", "没有有效的景点标记生成"); this.addTestMarker(); return; } const selectedMarkers = this.selectedLocations.map((location, index) => { return { id: 1e3 + index, latitude: Number(location.latitude), longitude: Number(location.longitude), title: location.name, iconPath: "/static/marker_selected.png", // 使用绝对路径 width: 40, height: 40, label: { content: (index + 1).toString(), color: "#FFFFFF", fontSize: 14, textAlign: "center", anchorX: 0, anchorY: -10 } }; }); this.markers = [...poiMarkers, ...selectedMarkers]; common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:485", `总共有${this.markers.length}个标记点`); setTimeout(() => { this.checkMarkersVisibility(); }, 1e3); }, // 检查标记可见性 checkMarkersVisibility() { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:495", "检查标记可见性"); if (this.markers.length > 0) { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:497", "标记数量:", this.markers.length); common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:498", "地图中心坐标:", this.latitude, this.longitude); const firstMarker = this.markers[0]; if (firstMarker && firstMarker.latitude && firstMarker.longitude) { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:503", "移动地图到第一个标记:", firstMarker.latitude, firstMarker.longitude); this.latitude = firstMarker.latitude; this.longitude = firstMarker.longitude; this.scale = 14; } } }, // 初始化地图 initMap() { common_vendor.index.getLocation({ type: "gcj02", success: (res) => { this.latitude = res.latitude; this.longitude = res.longitude; }, fail: () => { common_vendor.index.showToast({ title: "获取位置信息失败,使用默认位置", icon: "none" }); } }); }, // 根据POI类型获取不同的图标 getMarkerIcon(type) { const systemInfo = common_vendor.index.getSystemInfoSync(); const platform = systemInfo.platform; common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:535", "当前运行平台:", platform); const baseUrl = "/static/"; let iconName; switch (type) { case "景区": case "著名景点": case "历史遗迹": case "attraction": iconName = "marker_attraction.png"; break; case "酒店": case "住宿": case "hotel": iconName = "marker_hotel.png"; break; case "美食": case "餐厅": case "restaurant": iconName = "marker_restaurant.png"; break; case "购物": case "商场": case "shopping": iconName = "marker_shopping.png"; break; default: iconName = "marker_default.png"; } const iconPath = baseUrl + iconName; common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:568", `选择的图标路径: ${iconPath}, 类型: ${type}`); return iconPath; }, // 搜索位置 searchLocation() { if (!this.searchKeyword.trim()) { return; } if (!this.jingdian || this.jingdian.length === 0) { common_vendor.index.showToast({ title: "景点数据未加载", icon: "none" }); return; } const result = this.jingdian.find( (poi) => (poi.name || "").includes(this.searchKeyword) || (poi.address || "").includes(this.searchKeyword) || (poi.description || "").includes(this.searchKeyword) ); if (result && result.latitude && result.longitude) { this.latitude = Number(result.latitude); this.longitude = Number(result.longitude); this.scale = 15; common_vendor.index.showToast({ title: `找到: ${result.name}`, icon: "none" }); } else { common_vendor.index.showToast({ title: "未找到相关位置", icon: "none" }); } }, // 点击标记 onMarkerTap(e) { const markerId = e.markerId; common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:613", "点击了标记:", markerId); if (markerId >= 1e3) { const index = markerId - 1e3; if (index >= 0 && index < this.selectedLocations.length) { this.currentIndex = index; return; } } const poi = this.jingdian.find((item) => item.id === markerId); if (poi) { let content = ""; if (poi.description) { content += `描述: ${poi.description} `; } if (poi.address) { content += `地址: ${poi.address} `; } if (poi.category) { content += `类型: ${poi.category} `; } if (poi.city) { content += `城市: ${poi.city} `; } content += "是否添加到行程?"; common_vendor.index.showModal({ title: poi.name, content, confirmText: "添加", cancelText: "取消", success: (res) => { if (res.confirm) { const location = { id: poi.id, name: poi.name, latitude: Number(poi.latitude), longitude: Number(poi.longitude), address: poi.address || poi.city || "", type: poi.category || "attraction", description: poi.description || "" }; this.addLocation(location); } } }); } }, // 添加地点到行程 addLocation(location) { const exists = this.selectedLocations.some((item) => item.id === location.id); if (exists) { common_vendor.index.showToast({ title: "该地点已在行程中", icon: "none" }); return; } const standardizedLocation = { ...location, latitude: Number(location.latitude), longitude: Number(location.longitude) }; common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:687", "添加标准化后的地点:", standardizedLocation); this.selectedLocations.push(standardizedLocation); this.currentIndex = this.selectedLocations.length - 1; this.updateSelectedMarkers(); common_vendor.index.showToast({ title: "已添加到行程", icon: "success" }); }, // 移除地点 removeLocation(index) { this.selectedLocations.splice(index, 1); if (this.currentIndex >= this.selectedLocations.length) { this.currentIndex = this.selectedLocations.length - 1; } this.updateSelectedMarkers(); }, // 选择地点 selectLocation(index) { this.currentIndex = index; const location = this.selectedLocations[index]; this.latitude = location.latitude; this.longitude = location.longitude; }, // 清空所有地点 clearAllLocations() { if (this.selectedLocations.length === 0) return; common_vendor.index.showModal({ title: "确认清空", content: "确定要清空所有已添加的地点吗?", success: (res) => { if (res.confirm) { this.selectedLocations = []; this.currentIndex = -1; this.updateSelectedMarkers(); } } }); }, // 保存行程 saveTrip() { if (this.selectedLocations.length === 0) { common_vendor.index.showToast({ title: "请至少添加一个地点", icon: "none" }); return; } try { common_vendor.index.setStorageSync("selectedLocations", JSON.stringify(this.selectedLocations)); common_vendor.index.navigateTo({ url: "/pages/custom-trip/plan-detail", success: () => { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:756", "成功跳转到计划详情页"); }, fail: (err) => { common_vendor.index.__f__("error", "at pages/custom-trip/map.vue:759", "跳转到计划详情页失败:", err); common_vendor.index.showModal({ title: "跳转失败", content: JSON.stringify(err), showCancel: false }); } }); } catch (e) { common_vendor.index.__f__("error", "at pages/custom-trip/map.vue:768", "保存位置数据失败:", e); common_vendor.index.showToast({ title: "操作失败,请重试", icon: "none" }); } }, // 返回上一页 goBack() { common_vendor.index.navigateBack(); }, // 更新选中的标记 updateSelectedMarkers() { this.createMarkersFromJingdian(); this.updatePolylines(); }, // 更新路线连线 updatePolylines() { if (this.selectedLocations.length < 2) { this.polylines = []; this.markers = this.markers.filter((marker) => marker.id < 2e3 || marker.id >= 3e3); return; } const points = this.selectedLocations.map((location) => { return { latitude: Number(location.latitude), longitude: Number(location.longitude) }; }); this.polylines = [{ points, color: "#1aad19", width: 4, dottedLine: false, arrowLine: true, borderColor: "#ffffff", borderWidth: 1 }]; let distanceMarkers = []; for (let i = 0; i < points.length - 1; i++) { const startPoint = points[i]; const endPoint = points[i + 1]; const distance = this.calculateDistance( startPoint.latitude, startPoint.longitude, endPoint.latitude, endPoint.longitude ); const distanceText = distance < 1e3 ? `${Math.round(distance)}米` : `${(distance / 1e3).toFixed(1)}公里`; const midPoint = { latitude: (startPoint.latitude + endPoint.latitude) / 2, longitude: (startPoint.longitude + endPoint.longitude) / 2 }; distanceMarkers.push({ id: 2e3 + i, // 距离标记ID从2000开始 latitude: midPoint.latitude, longitude: midPoint.longitude, iconPath: "/static/marker_default.png", // 使用默认图标 width: 0, // 设置为0使图标不可见 height: 0, // 设置为0使图标不可见 callout: { content: distanceText, color: "#333333", fontSize: 12, borderRadius: 4, borderWidth: 1, borderColor: "#1aad19", bgColor: "#ffffff", padding: 5, display: "ALWAYS" } }); } const otherMarkers = this.markers.filter((marker) => marker.id < 2e3 || marker.id >= 3e3); this.markers = [...otherMarkers, ...distanceMarkers]; }, // 计算两点之间的距离(使用Haversine公式) calculateDistance(lat1, lon1, lat2, lon2) { const R = 6371e3; const dLat = this.deg2rad(lat2 - lat1); const dLon = this.deg2rad(lon2 - lon1); const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(this.deg2rad(lat1)) * Math.cos(this.deg2rad(lat2)) * Math.sin(dLon / 2) * Math.sin(dLon / 2); const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); return R * c; }, // 角度转弧度 deg2rad(deg) { return deg * (Math.PI / 180); }, // 选择目标景点(从热门目的地跳转来的) selectTargetSpot() { if (!this.targetSpotName || this.jingdian.length === 0) { return; } const targetSpot = this.jingdian.find( (spot) => spot.name === this.targetSpotName || spot.name.includes(this.targetSpotName) || this.targetSpotName.includes(spot.name) && spot.name.length > 2 ); if (targetSpot) { setTimeout(() => { const e = { markerId: targetSpot.id }; this.onMarkerTap(e); }, 1e3); } else { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:908", `未找到匹配的目标景点: ${this.targetSpotName}`); } }, // 地图加载完成后的处理 onMapLoaded() { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:914", "地图加载完成"); if (this.markers && this.markers.length > 0) { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:918", "当前地图标记数量:", this.markers.length); common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:919", "第一个标记示例:", JSON.stringify(this.markers[0])); } else { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:921", "当前无地图标记"); } this.refreshMarkers(); }, // 刷新地图标记 refreshMarkers() { const validMarkers = this.markers.map((marker) => { const newMarker = { ...marker }; if (typeof newMarker.latitude === "string") { newMarker.latitude = parseFloat(newMarker.latitude); } if (typeof newMarker.longitude === "string") { newMarker.longitude = parseFloat(newMarker.longitude); } if (isNaN(newMarker.latitude) || isNaN(newMarker.longitude)) { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:946", `忽略无效标记: ID=${newMarker.id}, 标题=${newMarker.title}`); return null; } newMarker.width = 36; newMarker.height = 36; return newMarker; }).filter((m) => m !== null); common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:957", `刷新后有效标记数量: ${validMarkers.length}`); if (validMarkers.length > 0) { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:959", "刷新后第一个标记:", JSON.stringify(validMarkers[0])); } this.markers = validMarkers; if (validMarkers.length === 0) { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:967", "没有有效标记,添加一个默认测试标记"); this.addTestMarker(); } }, // 添加测试标记 addTestMarker() { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:974", "添加测试标记"); const testMarker = { id: 9999, latitude: 38.8743, longitude: 115.4646, title: "测试标记", width: 20, height: 20, iconPath: "/static/marker_default.png", callout: { content: "测试标记", color: "#333333", fontSize: 12, borderRadius: 4, padding: 5, display: "ALWAYS" } }; this.markers = [testMarker]; common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:996", "添加了测试标记:", JSON.stringify(testMarker)); this.includePoints = [ { latitude: testMarker.latitude, longitude: testMarker.longitude } ]; }, // 添加测试标记并显示 addTestMarkerAndShow() { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:1009", "手动添加测试标记"); const currentScale = this.scale; common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:1013", "当前缩放级别:", currentScale); this.addTestMarker(); setTimeout(() => { if (this.markers.length > 0) { const marker = this.markers[0]; this.latitude = marker.latitude; this.longitude = marker.longitude; this.scale = currentScale; common_vendor.index.showToast({ title: "已添加测试标记", icon: "success" }); } }, 300); }, // 显示标记信息 showMarkersInfo() { if (this.markers.length > 0) { const info = { 总标记数: this.markers.length, 第一个标记: this.markers[0] }; common_vendor.index.showModal({ title: "标记信息", content: JSON.stringify(info, null, 2), showCancel: false }); common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:1046", "当前标记信息:", info); } else { common_vendor.index.showToast({ title: "当前没有标记", icon: "none" }); } }, // 重新加载标记 reloadMarkers() { common_vendor.index.__f__("log", "at pages/custom-trip/map.vue:1057", "重新加载标记"); this.markers = []; this.createMarkersFromJingdian(); common_vendor.index.showToast({ title: `已重载${this.markers.length}个标记`, icon: "success" }); }, // 显示所有景点(手动方法) showAllSpots() { common_vendor.index.showModal({ title: "显示所有景点", content: "调整地图视图以显示所有景点?这会改变地图缩放级别。", success: (res) => { if (res.confirm) { this.scale = 9; this.includePoints = this.markers.map((marker) => ({ latitude: marker.latitude, longitude: marker.longitude })); this.showAllMarkers = true; if (this.markers.length > 0) { let latSum = 0, lngSum = 0; this.markers.forEach((marker) => { latSum += marker.latitude; lngSum += marker.longitude; }); this.latitude = latSum / this.markers.length; this.longitude = lngSum / this.markers.length; common_vendor.index.showToast({ title: "已显示所有景点", icon: "success" }); } } } }); }, // 重置地图视图 resetView() { this.showAllMarkers = false; this.scale = 14; if (this.defaultBaodingSpots.length > 0) { this.latitude = this.defaultBaodingSpots[0].latitude; this.longitude = this.defaultBaodingSpots[0].longitude; } common_vendor.index.showToast({ title: "已重置地图视图", icon: "success" }); } } }; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { return common_vendor.e({ a: common_vendor.o((...args) => $options.goBack && $options.goBack(...args)), b: $data.latitude, c: $data.longitude, d: $data.markers, e: $data.scale, f: common_vendor.o((...args) => $options.onMarkerTap && $options.onMarkerTap(...args)), g: $data.polylines, h: common_vendor.o((...args) => $options.onMapLoaded && $options.onMapLoaded(...args)), i: $data.showAllMarkers ? $data.includePoints : [], j: common_vendor.o((...args) => $options.searchLocation && $options.searchLocation(...args)), k: $data.searchKeyword, l: common_vendor.o(($event) => $data.searchKeyword = $event.detail.value), m: common_vendor.o((...args) => $options.addTestMarkerAndShow && $options.addTestMarkerAndShow(...args)), n: common_vendor.o((...args) => $options.showMarkersInfo && $options.showMarkersInfo(...args)), o: common_vendor.o((...args) => $options.reloadMarkers && $options.reloadMarkers(...args)), p: common_vendor.o((...args) => $options.showAllSpots && $options.showAllSpots(...args)), q: $data.showAllMarkers }, $data.showAllMarkers ? { r: common_vendor.o((...args) => $options.resetView && $options.resetView(...args)) } : {}, { s: common_vendor.t($data.selectedLocations.length), t: $data.selectedLocations.length > 0 }, $data.selectedLocations.length > 0 ? { v: common_vendor.f($data.selectedLocations, (item, index, i0) => { return { a: common_vendor.t(index + 1), b: common_vendor.t(item.name), c: common_vendor.t(item.address), d: common_vendor.o(($event) => $options.removeLocation(index), index), e: index, f: $data.currentIndex === index ? 1 : "", g: common_vendor.o(($event) => $options.selectLocation(index), index) }; }) } : {}, { w: common_vendor.o((...args) => $options.clearAllLocations && $options.clearAllLocations(...args)), x: common_vendor.o((...args) => $options.saveTrip && $options.saveTrip(...args)), y: $data.selectedLocations.length === 0 ? 1 : "" }); } const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]); wx.createPage(MiniProgramPage); //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/custom-trip/map.js.map