Add raster view for raster data
This commit is contained in:
parent
daa94dc806
commit
187da7bb58
6 changed files with 32 additions and 3 deletions
BIN
public/resources/images/icons-000000@2x.png
Normal file
BIN
public/resources/images/icons-000000@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
|
@ -3,6 +3,7 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>{{name}} - TileServer GL</title>
|
<title>{{name}} - TileServer GL</title>
|
||||||
|
{{#is_vector}}
|
||||||
<link rel="stylesheet" type="text/css" href="/mapbox-gl.css" />
|
<link rel="stylesheet" type="text/css" href="/mapbox-gl.css" />
|
||||||
<script src="/mapbox-gl.js"></script>
|
<script src="/mapbox-gl.js"></script>
|
||||||
<style>
|
<style>
|
||||||
|
@ -13,7 +14,19 @@
|
||||||
#layerList div div {width:15px;height:15px;display:inline-block;}
|
#layerList div div {width:15px;height:15px;display:inline-block;}
|
||||||
#propertyList {position:absolute;top:40%;bottom:0;right:0;width:240px;overflow:auto;color:#fff;}
|
#propertyList {position:absolute;top:40%;bottom:0;right:0;width:240px;overflow:auto;color:#fff;}
|
||||||
</style>
|
</style>
|
||||||
|
{{/is_vector}}
|
||||||
|
{{^is_vector}}
|
||||||
|
<link rel="stylesheet" type="text/css" href="/mapbox.css" />
|
||||||
|
<script src="/mapbox.js"></script>
|
||||||
|
<script src="/leaflet-hash.js"></script>
|
||||||
|
<style>
|
||||||
|
body { margin:0; padding:0; }
|
||||||
|
#map { position:absolute; top:0; bottom:0; width:100%; }
|
||||||
|
</style>
|
||||||
|
{{/is_vector}}
|
||||||
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
{{#is_vector}}
|
||||||
<h1>{{name}}</h1>
|
<h1>{{name}}</h1>
|
||||||
<div id="map"></div>
|
<div id="map"></div>
|
||||||
<div id="layerList"></div>
|
<div id="layerList"></div>
|
||||||
|
@ -98,5 +111,17 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
{{/is_vector}}
|
||||||
|
{{^is_vector}}
|
||||||
|
<h1 style="display:none;">{{name}}</h1>
|
||||||
|
<div id='map'></div>
|
||||||
|
<script>
|
||||||
|
var map = L.mapbox.map('map', '/data/{{id}}.json', { zoomControl: false });
|
||||||
|
new L.Control.Zoom({ position: 'topright' }).addTo(map);
|
||||||
|
setTimeout(function() {
|
||||||
|
new L.Hash(map);
|
||||||
|
}, 0);
|
||||||
|
</script>
|
||||||
|
{{/is_vector}}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -49,9 +49,10 @@
|
||||||
<h3>{{name}}</h3>
|
<h3>{{name}}</h3>
|
||||||
<p>Id: {{@key}} |{{#if formatted_filesize}} {{formatted_filesize}} |{{/if}} {{#is_vector}}Vector{{/is_vector}}{{^is_vector}}Raster{{/is_vector}} data | <a href="/data/{{@key}}.json">TileJSON</a></p>
|
<p>Id: {{@key}} |{{#if formatted_filesize}} {{formatted_filesize}} |{{/if}} {{#is_vector}}Vector{{/is_vector}}{{^is_vector}}Raster{{/is_vector}} data | <a href="/data/{{@key}}.json">TileJSON</a></p>
|
||||||
{{#is_vector}}
|
{{#is_vector}}
|
||||||
<a class="btn" href="/data/{{@key}}/{{viewer_hash}}">X-Ray viewer</a>
|
<a class="btn" href="/data/{{@key}}/{{viewer_hash}}">X-Ray view</a>
|
||||||
{{/is_vector}}
|
{{/is_vector}}
|
||||||
{{^is_vector}}
|
{{^is_vector}}
|
||||||
|
<a class="btn" href="/data/{{@key}}/{{viewer_hash}}">Raster view</a>
|
||||||
{{/is_vector}}
|
{{/is_vector}}
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
body { margin:0; padding:0; }
|
body { margin:0; padding:0; }
|
||||||
#map { position:absolute; top:0; bottom:0; width:100%; }
|
#map { position:absolute; top:0; bottom:0; width:100%; }
|
||||||
</style>
|
</style>
|
||||||
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1 style="display:none;">{{name}}</h1>
|
<h1 style="display:none;">{{name}}</h1>
|
||||||
<div id='map'></div>
|
<div id='map'></div>
|
||||||
|
|
|
@ -30,6 +30,7 @@ module.exports = function(options, repo, params, id) {
|
||||||
tileJSON['tilejson'] = '2.0.0';
|
tileJSON['tilejson'] = '2.0.0';
|
||||||
tileJSON['basename'] = id;
|
tileJSON['basename'] = id;
|
||||||
tileJSON['filesize'] = fs.statSync(mbtilesFile)['size'];
|
tileJSON['filesize'] = fs.statSync(mbtilesFile)['size'];
|
||||||
|
delete tileJSON['scheme'];
|
||||||
|
|
||||||
Object.assign(tileJSON, params.tilejson || {});
|
Object.assign(tileJSON, params.tilejson || {});
|
||||||
utils.fixTileJSONCenter(tileJSON);
|
utils.fixTileJSONCenter(tileJSON);
|
||||||
|
|
|
@ -253,13 +253,14 @@ module.exports = function(opts, callback) {
|
||||||
});
|
});
|
||||||
*/
|
*/
|
||||||
|
|
||||||
serveTemplate('/data/:id/$', 'xray', function(params) {
|
serveTemplate('/data/:id/$', 'data', function(params) {
|
||||||
var id = params.id;
|
var id = params.id;
|
||||||
var data = serving.data[id];
|
var data = clone(serving.data[id]);
|
||||||
if (!data) {
|
if (!data) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
data.id = id;
|
data.id = id;
|
||||||
|
data.is_vector = data.format == 'pbf';
|
||||||
return data;
|
return data;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue