Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

max zoom selection uses unconverted source units #174

Open
dnomadb opened this issue Oct 11, 2017 · 0 comments
Open

max zoom selection uses unconverted source units #174

dnomadb opened this issue Oct 11, 2017 · 0 comments

Comments

@dnomadb
Copy link
Contributor

dnomadb commented Oct 11, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant