fix: don't use tilesize one data endpoint

It doesn't do anything

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
This commit is contained in:
Andrew Calcutt 2024-01-22 01:44:40 -05:00
parent 955bd46f83
commit 57a0fca626
4 changed files with 6 additions and 7 deletions

View file

@ -92,14 +92,13 @@ Static images
Source data
===========
* Source data are served at ``/data/{mbtiles}[/{tileSize}]/{z}/{x}/{y}.{format}``
* Source data are served at ``/data/{id}/{z}/{x}/{y}.{format}``
* Format depends on the source file (usually ``png`` or ``pbf``)
* ``geojson`` is also available (useful for inspecting the tiles) in case the original format is ``pbf``
* The optional tile size ``/{tileSize}`` (ex. ``/256``, ``/512``) is ignored by the data endpoint, but is allowed for url consistency.
* TileJSON at ``/data/{mbtiles}.json``
* TileJSON at ``/data/{id}.json``
TileJSON arrays
===============

View file

@ -98,7 +98,7 @@
new L.Control.Zoom({ position: 'topright' }).addTo(map);
var tile_urls = [], tile_attribution, tile_minzoom, tile_maxzoom;
var url = '{{public_url}}data/256/{{id}}.json' + keyParam;
var url = '{{public_url}}data/{{id}}.json' + keyParam;
var req = new XMLHttpRequest();
req.overrideMimeType("application/json");
req.open('GET', url, true);

View file

@ -81,7 +81,7 @@
<div class="identifier">identifier: {{@key}}{{#if formatted_filesize}} | size: {{formatted_filesize}}{{/if}}</div>
<div class="identifier">type: {{#is_vector}}vector{{/is_vector}}{{^is_vector}}raster{{/is_vector}} data {{#if sourceType}} | ext: {{sourceType}}{{/if}}</div>
<p class="services">
services: <a href="{{public_url}}data/256/{{@key}}.json{{&../key_query}}">TileJSON</a>
services: <a href="{{public_url}}data/{{@key}}.json{{&../key_query}}">TileJSON</a>
{{#if xyz_link}}
| <a href="#" onclick="return toggle_xyz('xyz_data_{{@key}}');">XYZ</a>
<input id="xyz_data_{{@key}}" type="text" value="{{&xyz_link}}" style="display:none;" />

View file

@ -168,12 +168,12 @@ export const serve_data = {
},
);
app.get('/(:tileSize(256|512)/)?:id.json', (req, res, next) => {
const tileSize = parseInt(req.params.tileSize, 10) || 256;
app.get('/:id.json', (req, res, next) => {
const item = repo[req.params.id];
if (!item) {
return res.sendStatus(404);
}
const tileSize = undefined;
const info = clone(item.tileJSON);
info.tiles = getTileUrls(
req,