Planit.js

zoomTo (level)

Class: Plan

If your plan is an image, this will zoom the image to a specific level, which is an incremented integer starting at zero.

When zooming in, you are always zooming to the center of the current view. When zooming out, the plan attempts to zoom to the center of the current view, but if it can't, it zooms as far to the edge as it can and then takes more away from the opposite side.

Returns: level (the argument you passed)

Example

// assuming you already have access to `plan` as a Plan object
// and that plan has an image
plan.zoomTo(0)

// which is the equivalent of
plan.resetImage()