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

Output floats for zoom levels in viewport function #10

Open
Madelena opened this issue Sep 24, 2016 · 3 comments
Open

Output floats for zoom levels in viewport function #10

Madelena opened this issue Sep 24, 2016 · 3 comments

Comments

@Madelena
Copy link

Similar to #5 but to add support for floats for the viewport() function instead of the bounds()function.

Given the new Static Map API supports zoom levels up to two decimal places, it would be great to have an option to yield such value by removing the Math.floor() in the return.

Unlike the bounds() function, this would not require upstream changes in SphericalMercator.

@Scarysize
Copy link

I want to open up a PR for this. We probably can't just remove the Math.floor here:
https://github.com/mapbox/geo-viewport/blob/master/index.js#L35-L37

This would lead to a breaking change for everyone who only can work with integer zoom levels. So I guess we hide it behind a flag?

@TeaSeaLancs
Copy link
Contributor

I just opened a PR for this. See #15

Removing the Math.floor does work, i've wrapped it behind a boolean flag. Little unwieldy in that it comes after every other argument, but without major breaking changes I don't see what I could do there.

@MichielDeMey
Copy link

@Madelena Fixed using #15

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

4 participants