Browse Source

CategoryOverpass: if zoom>16. don't zoom out to 16

master
parent
commit
9f90987b16
  1. 6
      src/CategoryOverpass.js

6
src/CategoryOverpass.js

@ -298,7 +298,11 @@ CategoryOverpass.prototype.show = function (id, options, callback) {
this.layer.show(id, options, function (err, data) {
if (!err) {
if (options.showDetails) {
this.map.flyToBounds(data.object.bounds.toLeaflet(), { maxZoom: 16 })
var maxZoom = this.map.getZoom()
maxZoom = maxZoom > 16 ? maxZoom : 16
this.map.flyToBounds(data.object.bounds.toLeaflet(), {
maxZoom: maxZoom
})
}
}

Loading…
Cancel
Save