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

Is there a way to restrict the range you can scroll to. #88

Open
geoffoddie opened this issue Aug 1, 2016 · 4 comments · May be fixed by #269
Open

Is there a way to restrict the range you can scroll to. #88

geoffoddie opened this issue Aug 1, 2016 · 4 comments · May be fixed by #269
Assignees

Comments

@geoffoddie
Copy link

Is there a way to restrict the range you can scroll to. With the end and start set and with a maxZoom set you can still scroll indefinitely into the future and past.

@twisty-n
Copy link
Contributor

Have a go at providing values for minScale and maxScale. The defaults for these are 0 and Infinity, setting them will restrict the scroll range range.

@geoffoddie
Copy link
Author

geoffoddie commented Sep 28, 2016

Thanks for this, however minScale and maxScale only seem to control zoom
in and out but not the date range.
e.g. I can scale down to days and scale up to years, however by moving left
and right a user can potentially go back to the 10BC or forward to the year
4000.

@jpetitcolas
Copy link
Contributor

Here is a link for inspiration: http://bl.ocks.org/shawnbot/6518285

@Luwangel Luwangel self-assigned this Mar 20, 2018
@Busteren
Copy link
Contributor

If anyone is looking at this later on, you have to set .extent() and .translateExtent() passing in the constraint.

@Busteren Busteren linked a pull request May 15, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants