3个版本
0.1.2 | 2024年5月18日 |
---|---|
0.1.1 | 2024年4月27日 |
0.1.0 | 2024年4月27日 |
#490 在 HTTP服务器
每月23次下载
16KB
89 行
SVG瓦片服务器
一个简单、内存安全 🔥 且速度极快 🚀、Leaflet/MapLibre兼容的瓦片服务器,可从SVG图像中渲染PNG瓦片。当需要渲染高度复杂和详细的SVG时非常有用。
用法
服务器端
A high performance SVG Leaflet/MapLibre compatible tile server
Usage: svg-tileserver [OPTIONS] <SVG_PATH>
Arguments:
<SVG_PATH> The path of the SVG that should be served
Options:
-t, --tile-size <TILE_SIZE> The size in pixels of a PNG tile [default: 256]
-p, --port <PORT> The port to start the server on [default: 8080]
-b, --bind-address <BIND_ADDRESS> The address to bind the server on [default: 127.0.0.1]
-h, --help Print help
-V, --version Print version
客户端
import L from "leaflet";
const map = new L.Map("#map", {
crs: L.CRS.Simple,
center: [0, 0],
zoom: 0,
});
L.tileLayer("https://#:8080/tile/{z}/{x}/{y}.png", {
maxZoom: 19,
}).addTo(map);
依赖项
~18–29MB
~535K SLoC