Respect mutiWorld: false same as explicit extent
Fixes #9577 The multiWorld: false constraint is currently not taken into account when constrainResolution is set or when an explicit resolutions array is specified, while an explicit extent constraint is respected in the same situations. This pull request takes a global projection extent into consideration in that same situations that an explicit extent would be. Add multiWorld tests with resolution constraints includes fix for #9937
This commit is contained in:
@@ -82,6 +82,9 @@ export function createSnapToResolutions(resolutions, opt_smooth, opt_maxExtent)
|
||||
|
||||
const capped = Math.min(cappedMaxRes, resolution);
|
||||
const z = Math.floor(linearFindNearest(resolutions, capped, direction));
|
||||
if (resolutions[z] > cappedMaxRes && z < resolutions.length - 1) {
|
||||
return resolutions[z + 1];
|
||||
}
|
||||
return resolutions[z];
|
||||
} else {
|
||||
return undefined;
|
||||
|
||||
Reference in New Issue
Block a user