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:
mike-000
2019-09-04 11:51:06 +01:00
parent 1f5dfef200
commit 9d125ee340
3 changed files with 70 additions and 15 deletions

View File

@@ -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;