Separate internal and API methods for the view

This commit is contained in:
Tim Schaub
2019-08-11 17:28:28 -06:00
parent f73d0b16ec
commit c03c359a20
17 changed files with 214 additions and 69 deletions
+2 -1
View File
@@ -2,6 +2,7 @@
* @module ol/control/ZoomToExtent
*/
import EventType from '../events/EventType.js';
import {fromExtent as polygonFromExtent} from '../geom/Polygon.js';
import Control from './Control.js';
import {CLASS_CONTROL, CLASS_UNSELECTABLE} from '../css.js';
@@ -80,7 +81,7 @@ class ZoomToExtent extends Control {
const map = this.getMap();
const view = map.getView();
const extent = !this.extent ? view.getProjection().getExtent() : this.extent;
view.fit(extent);
view.fitInternal(polygonFromExtent(extent));
}
}