Skip to content

max zoom selection uses unconverted source units #174

Description

@dnomadb

The source's resolution is converted to meters here:

var pixelSize = utils.convertToMeters(this.details.pixelSize, utils.getUnitType(this.projection));

But then the resolution in native units is then used to calculate the max zoom:

var validSpatialResolutions = utils.getValidSpatialResolutions(spatialResolutions, _this.details.pixelSize[0], thresholdWeight);

This results in incorrect maxzoom selection for non-meter source data, as the thresholds for zoom levels are defined in mercator meters. This can be fixed by simply swapping out _this.details.pixelSize[0] for pixelSize[0] above.

cc @pratikyadav

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions