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

Simplify setting pan limits #36

Open
ansis opened this issue Jul 16, 2012 · 0 comments
Open

Simplify setting pan limits #36

ansis opened this issue Jul 16, 2012 · 0 comments

Comments

@ansis
Copy link
Member

ansis commented Jul 16, 2012

Would it be appropriate to add map.setPanLimits? In a way, it would be the other half of map.setZoomRange.

Something like:

    setPanLimits: function(locations) {
        if (locations instanceof MM.Extent) {
            locations = locations.toArray();
        }
        this.coordLimits = [
            locations[0].zoomTo(this.coordLimits[0].zoom), 
            locations[1].zoomTo(this.coordLimits[1].zoom) 
        ];
        return this;
    }
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

1 participant