mirror of
https://github.com/maplibre/martin.git
synced 2024-12-30 10:22:27 +03:00
66b7fdc4ea
Partial implementation of the #430 * New endpoint structure: * `GET /` -- a placeholder for the future home page * `GET /catalog` -- get a list of available sources, as a list of json blobs. * `[{id, name, description, attribution, vector_layer}, ...]` (some fields might be missing) * `GET /<id>` -- get tilejson for the given source, or a combination of sources. No `.json` extension * `GET /<id>/<z>/<x>/<y>` -- get a tile. No format extension. * `GET /health` -- healthcheck * Introduce a new tile format support crate (using code from the maplibre/mbtileserve project) * Removed the `/rpc/...` routes - all source IDs are accessed in the same way * Can print auto-generated configuration or save it to a file * Refactored to support multiple sources from multiple backends, with a proper naming conflict resolution TODO: * benchmarks need to be rewritten - they were relying on some internal structures that are no longer there. This might be done as a separate PR due to a very different internal architecture - might need to rethink benchmarking approaches.
56 lines
1.3 KiB
HTML
56 lines
1.3 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>Martin Debug Page</title>
|
|
<meta
|
|
name="viewport"
|
|
content="initial-scale=1,maximum-scale=1,user-scalable=no"
|
|
/>
|
|
<link
|
|
rel="stylesheet"
|
|
href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"
|
|
/>
|
|
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
|
|
<script src="https://unpkg.com/leaflet.vectorgrid@latest/dist/Leaflet.VectorGrid.bundled.js"></script>
|
|
|
|
<style>
|
|
body {
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
#map {
|
|
width: 100vw;
|
|
height: 100vh;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="map"></div>
|
|
|
|
<script>
|
|
var map = L.map('map').setView([0, 0], 5);
|
|
|
|
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
|
attribution:
|
|
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
|
}).addTo(map);
|
|
|
|
L.vectorGrid
|
|
.protobuf('http://localhost:3000/table_source/{z}/{x}/{y}', {
|
|
vectorTileLayerStyles: {
|
|
'table_source': {
|
|
color: 'black',
|
|
fill: true,
|
|
fillColor: 'black',
|
|
fillOpacity: 1,
|
|
},
|
|
},
|
|
})
|
|
.addTo(map);
|
|
</script>
|
|
</body>
|
|
</html>
|