mirror of
https://github.com/consbio/mbtileserver.git
synced 2024-09-11 07:15:24 +03:00
Merge pull request #84 from sikmir/fix-bounds
Gracefully handle missing tile service bounds in map preview
This commit is contained in:
commit
fc91bd5a6a
@ -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