Skip to content

Simplify setting pan limits #36

Open

Description

@ansis

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;
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions