0
如何避免缩放this.map.fitBounds()? 做这个.map.fitBounds将放大或缩小映射以拟合边界值。我想避免fitBounds的缩小功能。我可以这样做吗?避免缩小this.map.fitBounds()
试过following.This将在执行fitBounds()后执行。需要在执行fitBounds之前执行()
var lineBounds = this._trail.getLineBounds()
, current_zoom = this.map.getZoom()
, center = this.map.getCenter();
this.map.fitBounds(lineBounds, {
padding: [29, 29],
});
this.map.once('zoomend', function() {
if (current_zoom > this.map.getZoom()) {
this.map.setView(center, current_zoom);
}
}.bind(this));