commit
2337dcf220
@ -0,0 +1 @@
|
||||
*.geojson
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,56 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Векторные тайлы</title>
|
||||
<script src='https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.js'></script>
|
||||
<link href='https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.css' rel='stylesheet' />
|
||||
</head>
|
||||
<body>
|
||||
<h1>Векторные тайлы</h1>
|
||||
<ol id="tilesets-list"></ol>
|
||||
<div id='map' style='width: 400px; height: 300px;'></div>
|
||||
<script>
|
||||
fetch("catalog.json")
|
||||
.then((r) => r.json())
|
||||
.then(
|
||||
(tilesets) =>
|
||||
(document.getElementById("tilesets-list").innerHTML = tilesets
|
||||
.map((t) => {
|
||||
return `
|
||||
<li>
|
||||
<p>URL: <a href="./${t.name}/{z}/{x}/{y}.pbf" onclick="event.preventDefault();navigator.clipboard.writeText(decodeURI(this.href))">https://vt.ru/${t.name}/{z}/{x}/{y}.pbf</a></p>
|
||||
<p>Layer: <i>${JSON.parse(t.json).vector_layers[0].id}</i>
|
||||
</li>
|
||||
`;
|
||||
})
|
||||
.join(""))
|
||||
);
|
||||
var map = new maplibregl.Map({
|
||||
container: 'map',
|
||||
style: {
|
||||
version: 8,
|
||||
sources: {
|
||||
land: {
|
||||
type: "vector",
|
||||
tiles: ["http://localhost:5500/land/{z}/{x}/{y}.pbf"],
|
||||
maxzoom: 0
|
||||
}
|
||||
},
|
||||
layers: [
|
||||
{
|
||||
id: "land-layer",
|
||||
source: "land",
|
||||
"source-layer": "land",
|
||||
type: "fill"
|
||||
}
|
||||
]
|
||||
}, // stylesheet location
|
||||
center: [-74.5, 40], // starting position [lng, lat]
|
||||
zoom: 0 // starting zoom
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "land",
|
||||
"description": "land",
|
||||
"version": "2",
|
||||
"minzoom": "0",
|
||||
"maxzoom": "0",
|
||||
"center": "0.000000,0.000000,0",
|
||||
"bounds": "-180.000000,-85.051129,180.000000,83.645130",
|
||||
"antimeridian_adjusted_bounds": "0.106689,-85.040752,359.872620,83.645130",
|
||||
"type": "overlay",
|
||||
"format": "pbf",
|
||||
"generator": "tippecanoe v2.41.2",
|
||||
"generator_options": "tippecanoe '--maximum-zoom=g' '--output-to-directory=land' --drop-densest-as-needed --no-tile-compression land.geojson",
|
||||
"json": "{\"vector_layers\":[{\"id\":\"land\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":0,\"fields\":{\"featurecla\":\"String\",\"min_zoom\":\"Number\",\"scalerank\":\"Number\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"land\",\"count\":127,\"geometry\":\"Polygon\",\"attributeCount\":3,\"attributes\":[{\"attribute\":\"featurecla\",\"count\":1,\"type\":\"string\",\"values\":[\"Land\"]},{\"attribute\":\"min_zoom\",\"count\":4,\"type\":\"number\",\"values\":[0,0.5,1,1.5],\"min\":0,\"max\":1.5},{\"attribute\":\"scalerank\",\"count\":2,\"type\":\"number\",\"values\":[0,1],\"min\":0,\"max\":1}]}]}}"
|
||||
}
|
||||
Binary file not shown.
@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "ocean",
|
||||
"description": "ocean",
|
||||
"version": "2",
|
||||
"minzoom": "0",
|
||||
"maxzoom": "0",
|
||||
"center": "0.000000,0.000000,0",
|
||||
"bounds": "-180.000000,-85.051129,180.000000,85.051129",
|
||||
"antimeridian_adjusted_bounds": "0.106689,-85.040752,359.872620,84.375000",
|
||||
"type": "overlay",
|
||||
"format": "pbf",
|
||||
"generator": "tippecanoe v2.41.2",
|
||||
"generator_options": "tippecanoe '--maximum-zoom=g' '--output-to-directory=ocean' --drop-densest-as-needed --no-tile-compression ocean.geojson",
|
||||
"json": "{\"vector_layers\":[{\"id\":\"ocean\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":0,\"fields\":{\"featurecla\":\"String\",\"min_zoom\":\"Number\",\"scalerank\":\"Number\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"ocean\",\"count\":2,\"geometry\":\"Polygon\",\"attributeCount\":3,\"attributes\":[{\"attribute\":\"featurecla\",\"count\":1,\"type\":\"string\",\"values\":[\"Ocean\"]},{\"attribute\":\"min_zoom\",\"count\":1,\"type\":\"number\",\"values\":[0],\"min\":0,\"max\":0},{\"attribute\":\"scalerank\",\"count\":1,\"type\":\"number\",\"values\":[0],\"min\":0,\"max\":0}]}]}}"
|
||||
}
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue