nginx瓦片代理缓存
This commit is contained in:
@@ -104,6 +104,9 @@ import { ref, computed, onMounted, watch } from 'vue'
|
||||
import L from 'leaflet'
|
||||
import 'leaflet/dist/leaflet.css'
|
||||
|
||||
// 瓦片代理地址 — 部署到内网其他机器时,将 localhost 改为服务器 IP
|
||||
const TILE_PROXY_URL = 'http://localhost:8080/tiles/{z}/{x}/{y}{r}.png'
|
||||
|
||||
// ── 常量 ────────────────────────────────────────────────────
|
||||
const TOTAL_VOLS = 63
|
||||
|
||||
@@ -268,9 +271,8 @@ function initMap() {
|
||||
attributionControl: false
|
||||
})
|
||||
|
||||
L.tileLayer('https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png', {
|
||||
maxZoom: 18,
|
||||
subdomains: 'abcd'
|
||||
L.tileLayer(TILE_PROXY_URL, {
|
||||
maxZoom: 18
|
||||
}).addTo(map)
|
||||
|
||||
L.control.attribution({ prefix: false, position: 'bottomright' })
|
||||
|
||||
Reference in New Issue
Block a user