Returns the scale at a given zoom level
974353
def getScale(self, zoom):
        """"""
        if self.unit == 'degrees':
            resolution = self.getResolution(zoom) * EPSG4326_METERS_PER_UNIT
        else:
            resolution = self.getResolution(zoom)
        return resolution / STANDARD_PIXEL_SIZE
950774
def get_scaled_v2(self, amount):
        """"""

        return Vec2(self.x * amount, self.y * amount)
505356
def display(self):
        
        w, h = self.session.window_size()
        return Display(w*self.scale, h*self.scale)
282397
def cmd_z(self, lvl=None, ch=None):
        
        viewer = self.get_viewer(ch)
        if viewer is None:
            self.log("No current viewer/channel.")
            return

        cur_lvl = viewer.get_zoom()

        if lvl is None:
            self.log("zoom=%f" % (cur_lvl))

        else:
            viewer.zoom_to(lvl)
208586
public int getZoomLevelProgress(int zoomLevel) {
		Integer zoomProgress = zoomLevelProgress.get(zoomLevel);
		if (zoomProgress == null) {
			zoomProgress = 0;
		}
		return zoomProgress;
	}
606904
def zoomset_cb(self, setting, value, channel):
        
        if not self.gui_up:
            return
        info = channel.extdata._info_info
        if info is None:
            return
        #scale_x, scale_y = fitsimage.get_scale_xy()
        scale_x, scale_y = value

        # Set text showing zoom factor (1X, 2X, etc.)
        if scale_x == scale_y:
            text = self.fv.scale2text(scale_x)
        else:
            textx = self.fv.scale2text(scale_x)
            texty = self.fv.scale2text(scale_y)
            text = "X: %s  Y: %s" % (textx, texty)
        info.winfo.zoom.set_text(text)
593073
function (mode) {
            var baseVal = presentation.calculateZoomValue.call(this, mode);
            if (mode === ZOOM_FIT_WIDTH) {
                baseVal /= 2;
            }
            return baseVal;
        }
1265010
def scaleX(self, x):
        ''
        return round(self.plotviewBox.xmin+(x-self.visibleBox.xmin)*self.xScaler)
506608
def get_context_for_image(self, zoom):
        
        cairo_context = Context(self.__image)
        cairo_context.scale(zoom * self.multiplicator, zoom * self.multiplicator)
        return cairo_context
235948
def _get_distance_scaling(self, coe, rhypo):
        
        return coe["a3"] * np.log(rhypo) + coe["a4"] * rhypo
469783
def scale_view(self, x, y):
        
        d = self.declaration
        factor = self.widget.transform().scale(x, y).mapRect(
            QRectF(0, 0, 1, 1)).width()
        if (d.min_zoom > factor > d.max_zoom):
            return
        self.widget.scale(x, y)
        return factor
867711
def zoom_crop(scale:float, do_rand:bool=False, p:float=1.0):
    ""
    zoom_fn = rand_zoom if do_rand else zoom
    crop_fn = rand_crop if do_rand else crop_pad
    return [zoom_fn(scale=scale, p=p), crop_fn()]
797836
function () {
            var state = this.state,
                fitWidth = this.calculateZoomValue(ZOOM_FIT_WIDTH),
                fitHeight = this.calculateZoomValue(ZOOM_FIT_HEIGHT);

            // landscape
            if (state.widestPage.actualWidth > state.tallestPage.actualHeight) {
                return Math.min(fitWidth, fitHeight);
            }
            // portrait
            else {
                if (browser.mobile) {
                    return fitHeight;
                }
                // limit max zoom to 1.0
                return Math.min(1, fitHeight);
            }
        }
1334260
def _zoom_map(self, zoom_out=True):
        """"""
        size_step = 1 / _ZOOM_STEP if zoom_out else _ZOOM_STEP
        self._next_update = 1
        if self._satellite:
            size_step **= _ZOOM_ANIMATION_STEPS
        self._size *= size_step
        if self._size <= _ZOOM_OUT_SIZE:
            if self._zoom > 0:
                self._zoom -= 1
                self._size = _START_SIZE
            else:
                self._size = _ZOOM_OUT_SIZE
        elif self._size >= _ZOOM_IN_SIZE:
            if self._zoom < 20:
                self._zoom += 1
                self._size = _START_SIZE
            else:
                self._size = _ZOOM_IN_SIZE
27429
def scale(self, s=None):
        """"""
        if s is None:
            return np.array(self.GetScale())
        self.SetScale(s)
        return self
664972
def zoom_fit(self, no_reset=False):
        
        # calculate actual width of the limits/image, considering rotation
        try:
            xy_mn, xy_mx = self.get_limits()

        except ImageViewNoDataError:
            return

        try:
            wwidth, wheight = self.get_window_size()
            self.logger.debug("Window size is %dx%d" % (wwidth, wheight))
            if self.t_['swap_xy']:
                wwidth, wheight = wheight, wwidth
        except Exception:
            return

        # zoom_fit also centers image
        with self.suppress_redraw:

            self.center_image(no_reset=no_reset)

            ctr_x, ctr_y, rot_deg = self.get_rotation_info()

            # Find min/max extents of limits as shown by viewer
            xs = np.array((xy_mn[0], xy_mx[0], xy_mx[0], xy_mn[0]))
            ys = np.array((xy_mn[1], xy_mn[1], xy_mx[1], xy_mx[1]))
            x0, y0 = trcalc.rotate_pt(xs, ys, rot_deg, xoff=ctr_x, yoff=ctr_y)

            min_x, min_y = np.min(x0), np.min(y0)
            max_x, max_y = np.max(x0), np.max(y0)

            width, height = max_x - min_x, max_y - min_y
            if min(width, height) <= 0:
                return

            # Calculate optimum zoom level to still fit the window size
            scale_x = (float(wwidth) /
                       (float(width) * self.t_['scale_x_base']))
            scale_y = (float(wheight) /
                       (float(height) * self.t_['scale_y_base']))

            scalefactor = min(scale_x, scale_y)
            # account for t_[scale_x/y_base]
            scale_x = scalefactor * self.t_['scale_x_base']
            scale_y = scalefactor * self.t_['scale_y_base']

            self._scale_to(scale_x, scale_y, no_reset=no_reset)

        if self.t_['autozoom'] == 'once':
            self.t_.set(autozoom='off')
1034985
function () {
        var scale = null;
        if (this.baseLayer != null) {
            var res = this.getResolution();
            var units = this.baseLayer.units;
            scale = OpenLayers.Util.getScaleFromResolution(res, units);
        }
        return scale;
    }