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

Clip at edges? #157

Closed
mwojtul opened this issue Oct 17, 2015 · 1 comment
Closed

Clip at edges? #157

mwojtul opened this issue Oct 17, 2015 · 1 comment

Comments

@mwojtul
Copy link

mwojtul commented Oct 17, 2015

Is there a way to clip the SVG at the edges to basically prevent scrolling it beyond view?

#37 deals with this, but I couldn't quite put it all together.

beforePan(oldpan, newpan) {
return { x: Math.max(newpan.x, 0), y: Math.max(newpan.y, 0) };
}

Comes close and limits top left, but how can I also limit bottom right?

Here's an example: http://jsfiddle.net/ha2t7et2/1/

Basically, I want the map to always be in view.

@bumbu
Copy link
Owner

bumbu commented Nov 29, 2015

An example is available here.

@bumbu bumbu closed this as completed Nov 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants