修复跨端问题

This commit is contained in:
2026-06-04 17:49:31 +08:00
parent f84a9a3cdd
commit 6fb6fc4f10
4 changed files with 49 additions and 3 deletions
+3 -1
View File
@@ -32,6 +32,8 @@ let markerLayer: L.LayerGroup | null = null
let hasFitBounds = false
const minMapZoom = 3
const defaultMapCenter: L.LatLngExpression = [35.8617, 104.1954]
const defaultMapZoom = 4
const worldBounds = L.latLngBounds(
[-85.05112878, -180],
[85.05112878, 180],
@@ -50,7 +52,7 @@ onMounted(async () => {
maxBounds: worldBounds,
maxBoundsViscosity: 1.0,
worldCopyJump: false,
}).setView([0, 0], minMapZoom)
}).setView(defaultMapCenter, defaultMapZoom)
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
minZoom: minMapZoom,
maxZoom: 19,