添加瓦片代理
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -5,6 +5,9 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
.claude/
|
.claude/
|
||||||
|
|
||||||
|
# MapProxy tile cache
|
||||||
|
tiles/cache/
|
||||||
|
|
||||||
# TODO: where does this rule come from?
|
# TODO: where does this rule come from?
|
||||||
docs/_book
|
docs/_book
|
||||||
|
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ function initMap() {
|
|||||||
attributionControl: false
|
attributionControl: false
|
||||||
})
|
})
|
||||||
|
|
||||||
L.tileLayer('https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png', {
|
L.tileLayer('https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png', {
|
||||||
maxZoom: 18,
|
maxZoom: 18,
|
||||||
subdomains: 'abcd'
|
subdomains: 'abcd'
|
||||||
}).addTo(map)
|
}).addTo(map)
|
||||||
|
|||||||
@@ -28,7 +28,13 @@ export default defineConfig({
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
server: {
|
server: {
|
||||||
port: 5173
|
port: 5173,
|
||||||
|
proxy: {
|
||||||
|
'/tiles': {
|
||||||
|
target: 'http://localhost:8080',
|
||||||
|
changeOrigin: true
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
outDir: resolve(__dirname, '../dist')
|
outDir: resolve(__dirname, '../dist')
|
||||||
|
|||||||
14
tiles/docker-compose.yml
Normal file
14
tiles/docker-compose.yml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
mapproxy:
|
||||||
|
image: kartoza/mapproxy:latest
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
||||||
|
volumes:
|
||||||
|
- ./mapproxy/mapproxy.yaml:/srv/mapproxy/mapproxy.yaml
|
||||||
|
- ./mapproxy/seed.yaml:/srv/mapproxy/seed.yaml
|
||||||
|
- ./cache:/srv/mapproxy/cache_data
|
||||||
|
environment:
|
||||||
|
- MAPPROXY_PROCESSES=4
|
||||||
|
restart: unless-stopped
|
||||||
34
tiles/mapproxy/mapproxy.yaml
Normal file
34
tiles/mapproxy/mapproxy.yaml
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
services:
|
||||||
|
tms:
|
||||||
|
grids: [GLOBAL_WEBMERCATOR]
|
||||||
|
origin: nw
|
||||||
|
restful: true
|
||||||
|
|
||||||
|
layers:
|
||||||
|
- name: stamen_watercolor
|
||||||
|
title: Stamen Watercolor (Cached)
|
||||||
|
sources: [stamen_watercolor_cache]
|
||||||
|
|
||||||
|
caches:
|
||||||
|
stamen_watercolor_cache:
|
||||||
|
grids: [GLOBAL_WEBMERCATOR]
|
||||||
|
sources: [stamen_watercolor_source]
|
||||||
|
cache:
|
||||||
|
type: file
|
||||||
|
directory: /srv/mapproxy/cache_data/stamen_watercolor
|
||||||
|
|
||||||
|
sources:
|
||||||
|
stamen_watercolor_source:
|
||||||
|
type: tile
|
||||||
|
url: https://tiles.stadiamaps.com/tiles/stamen_watercolor/%(z)s/%(x)s/%(y)s.jpg
|
||||||
|
grid: GLOBAL_WEBMERCATOR
|
||||||
|
|
||||||
|
grids:
|
||||||
|
GLOBAL_WEBMERCATOR:
|
||||||
|
srs: EPSG:3857
|
||||||
|
origin: nw
|
||||||
|
|
||||||
|
globals:
|
||||||
|
cache:
|
||||||
|
base_dir: /srv/mapproxy/cache_data
|
||||||
|
lock_dir: /srv/mapproxy/cache_data/.locks
|
||||||
13
tiles/mapproxy/seed.yaml
Normal file
13
tiles/mapproxy/seed.yaml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
seeds:
|
||||||
|
stamen_watercolor_seed:
|
||||||
|
caches: [stamen_watercolor_cache]
|
||||||
|
grids: [GLOBAL_WEBMERCATOR]
|
||||||
|
coverages: [china_coverage]
|
||||||
|
levels:
|
||||||
|
from: 1
|
||||||
|
to: 10
|
||||||
|
|
||||||
|
coverages:
|
||||||
|
china_coverage:
|
||||||
|
bbox: [73.0, 18.0, 135.0, 54.0]
|
||||||
|
srs: EPSG:4326
|
||||||
Reference in New Issue
Block a user