View / make the constrainResolution function private
Other classes should not need to worry about constraining the resolution or not, as the View will eventually do this on its own.
This commit is contained in:
@@ -345,13 +345,12 @@ class View extends BaseObject {
|
||||
if (options.resolution !== undefined) {
|
||||
this.setResolution(options.resolution);
|
||||
} else if (options.zoom !== undefined) {
|
||||
this.setResolution(this.constrainResolution(
|
||||
this.maxResolution_, options.zoom - this.minZoom_));
|
||||
|
||||
if (this.resolutions_) { // in case map zoom is out of min/max zoom range
|
||||
this.setResolution(clamp(
|
||||
Number(this.getResolution() || properties[ViewProperty.RESOLUTION]),
|
||||
const resolution = this.getResolutionForZoom(options.zoom);
|
||||
this.setResolution(clamp(resolution,
|
||||
this.minResolution_, this.maxResolution_));
|
||||
} else {
|
||||
this.setZoom(options.zoom);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user