mirror of
https://github.com/consbio/mbtileserver.git
synced 2024-10-26 07:51:06 +03:00
Gracefully handle missing tile service bounds in map preview
This commit is contained in:
parent
10eb6193b7
commit
65d73d5600
@ -84,10 +84,13 @@
|
||||
|
||||
var layer = null;
|
||||
d3.json('./', function(tileJSON) {
|
||||
var b = tileJSON.bounds;
|
||||
if (tileJSON.bounds) {
|
||||
var b = tileJSON.bounds;
|
||||
|
||||
// TODO: optimize and prevent jitter
|
||||
map.fitBounds([[b[1], b[0]], [b[3], b[2]]]);
|
||||
}
|
||||
|
||||
// TODO: optimize and prevent jitter
|
||||
map.fitBounds([[b[1], b[0]], [b[3], b[2]]]);
|
||||
if (tileJSON.maxzoom && tileJSON.maxzoom < map.getZoom()){
|
||||
map.setZoom(tileJSON.maxzoom);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user