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:
parent
955bd46f83
commit
57a0fca626
4 changed files with 6 additions and 7 deletions
|
|
@ -92,14 +92,13 @@ Static images
|
||||||
|
|
||||||
Source data
|
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``)
|
* 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``
|
* ``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/{id}.json``
|
||||||
* TileJSON at ``/data/{mbtiles}.json``
|
|
||||||
|
|
||||||
TileJSON arrays
|
TileJSON arrays
|
||||||
===============
|
===============
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@
|
||||||
new L.Control.Zoom({ position: 'topright' }).addTo(map);
|
new L.Control.Zoom({ position: 'topright' }).addTo(map);
|
||||||
|
|
||||||
var tile_urls = [], tile_attribution, tile_minzoom, tile_maxzoom;
|
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();
|
var req = new XMLHttpRequest();
|
||||||
req.overrideMimeType("application/json");
|
req.overrideMimeType("application/json");
|
||||||
req.open('GET', url, true);
|
req.open('GET', url, true);
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@
|
||||||
<div class="identifier">identifier: {{@key}}{{#if formatted_filesize}} | size: {{formatted_filesize}}{{/if}}</div>
|
<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>
|
<div class="identifier">type: {{#is_vector}}vector{{/is_vector}}{{^is_vector}}raster{{/is_vector}} data {{#if sourceType}} | ext: {{sourceType}}{{/if}}</div>
|
||||||
<p class="services">
|
<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}}
|
{{#if xyz_link}}
|
||||||
| <a href="#" onclick="return toggle_xyz('xyz_data_{{@key}}');">XYZ</a>
|
| <a href="#" onclick="return toggle_xyz('xyz_data_{{@key}}');">XYZ</a>
|
||||||
<input id="xyz_data_{{@key}}" type="text" value="{{&xyz_link}}" style="display:none;" />
|
<input id="xyz_data_{{@key}}" type="text" value="{{&xyz_link}}" style="display:none;" />
|
||||||
|
|
|
||||||
|
|
@ -168,12 +168,12 @@ export const serve_data = {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
app.get('/(:tileSize(256|512)/)?:id.json', (req, res, next) => {
|
app.get('/:id.json', (req, res, next) => {
|
||||||
const tileSize = parseInt(req.params.tileSize, 10) || 256;
|
|
||||||
const item = repo[req.params.id];
|
const item = repo[req.params.id];
|
||||||
if (!item) {
|
if (!item) {
|
||||||
return res.sendStatus(404);
|
return res.sendStatus(404);
|
||||||
}
|
}
|
||||||
|
const tileSize = undefined;
|
||||||
const info = clone(item.tileJSON);
|
const info = clone(item.tileJSON);
|
||||||
info.tiles = getTileUrls(
|
info.tiles = getTileUrls(
|
||||||
req,
|
req,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue