Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MapNavigatorZoomOptions

The options for a zoom operation.

Hierarchy

  • MapNavigatorZoomOptions

Overview

Properties

Optional animate

animate: MapNavigatorAnimationOptions | boolean

When falsy, the fit operation will be immediate (synchronous).

When truthy, the fit operation will be animated and asynchronous.

The default value is false.

This flag affects the resolution of the returned Promise (see return value documentation for details). To alter the animation, you can assign an MapNavigatorAnimationOptions to this option.

Optional factor

factor: number | { x: number; y: number }

The zoom factor to multiply the map scale with.

Uniform zooming: When you assign a single, strictly positive Number to this option, that number will be used to zoom in a uniform way (the scale for all axes is multiplied with this factor). A factor larger than 1 will zoom in, a factor smaller than 1 will zoom out. Zooming with a factor of 1 will have no effect on the map.

Non-uniform zooming (non-georeferenced, 2D views only): You can use separate factors for the x- and y-axis. To achieve this, you assign an object literal to the factor option. The object literal has to have one or two properties:
  • x The factor to scale the x-axis with.
  • y The factor to scale the y-axis with.
Non-uniform zooming is disabled for georeferenced maps and 3D maps. While it is technically possible to zoom in a non-uniform way on a georeferenced map, it will cause the map to be incorrectly visualized (it distorts the properties of the map's projection). Non-uniform zooming in 3D is not meaningful.

Optional location

location: Point

The Point to zoom in to or out from. This point will remain fixed on the map while the scale changes. Can be a view, model or map Point. When omitted, will default to the map's view center.

Note that location will not be moved to the center of the map! Think of it as zooming in with the scroll wheel on a location that is not the center of the map. In this case, location is the location (in pixel coordinates) of the mouse cursor. The point under the cursor remains fixed, while the scale changes.

Optional snapToScaleLevels

snapToScaleLevels: boolean

Indicates whether or not the target zoom level should be snapped to layer scale levels, to allow for pixel-perfect display of raster layers. Only has effect on 2D maps. Note that this flag has an effect on the target zoom level of the zoom operation. When omitted, this defaults to defaults.snapToScaleLevels.

Optional targetScale

targetScale: number | { x: number; y: number }

The target scale of the zoom operation.

Uniform zooming: When you assign a single, strictly positive Number to this option, that number will be used to zoom in a uniform way (the scale for all axes is set to this value). After the zoom operation, map.MapScale will equal this value. See map.MapScale for additional details on map scales.

Non-uniform zooming (non-georeferenced, 2D views only): You can use separate scales for the x- and y-axis. To achieve this, you assign an object literal to the targetScale option. The object literal has to have one or two properties:
  • x The target scale for the x-axis.
  • y The target scale for the y-axis.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method