Optional extra stops to refine extent transforms

Add optional extra stops to refine some non-parallel transforms

Refine extent transforms use by Gratucule by using 32 points (8 per side) instead of the standard corners only transform
Update Graticule class description with current limitations

Correct projection extent in Mollweide example and revise opening zoom level correspondingly
This commit is contained in:
mike-000
2020-02-22 22:40:29 +00:00
parent 05d3386995
commit 6ae6d0b835
4 changed files with 40 additions and 17 deletions

View File

@@ -476,12 +476,14 @@ export function transform(coordinate, source, destination) {
* @param {import("./extent.js").Extent} extent The extent to transform.
* @param {ProjectionLike} source Source projection-like.
* @param {ProjectionLike} destination Destination projection-like.
* @param {number=} opt_stops Number of stops per side used for the transform.
* By default only the corners are used.
* @return {import("./extent.js").Extent} The transformed extent.
* @api
*/
export function transformExtent(extent, source, destination) {
export function transformExtent(extent, source, destination, opt_stops) {
const transformFunc = getTransform(source, destination);
return applyTransform(extent, transformFunc);
return applyTransform(extent, transformFunc, undefined, opt_stops);
}