Map parameters

Viewport

The Yandex.Maps API lets you generate two types of maps: interactive (using the JavaScript API) and static (using the Static API). In the first case, HTML and JavaScript code is generated that is used for displaying maps in a rectangular container. The second case is a normal image that has a rectangular shape. The rectangular area in the browser window that contains the image of part of an area is called the map viewport.

The div element is usually used for interactive maps, and the img element for static maps. The location and size of the map viewport is determined by the parameters of these HTML elements.

Mapping area

The region displayed in the viewport is called the mapping area. By definition, it is obvious that it is also rectangular.

There are three ways to set the mapping area:

Setting boundaries. To effectively set the boundaries of the rectangle, you only need to set the coordinates of two of its corners that are diagonal to each other. In the Yandex.Maps API, the coordinates of the lower-left and upper-right corners are used.

This method of setting the mapping area is only used in the JavaScript API.

Setting the center and zoom level. As demonstrated earlier, the zoom level determines the number of tiles the image of the area is divided into. From this, it is clear that setting the center and zoom level will define the mapping area. This method of setting the mapping area can be used in both the Static API and the JavaScript API.

Setting the center and the range by longitude and latitude. The range by longitude and latitude is set in degrees. This method of setting the mapping area can be used in both the Static API and the JavaScript API.

Map type

A single area can be displayed in different ways. To link an area to several sets of images (tiles), the Yandex.Maps API uses the concept of map types.

In Yandex.Maps, the surface of the Earth is represented by the following types of maps: map (roadmap style), satellite map and a hybrid of these types.

On the roadmap, an area is shown as a drawing without excess details, and symbols and names mark geographical objects.

The satellite map is made from satellite and aerial photographs of an area.

In the hybrid view, the satellite map is used, but the borders of countries and regions, road systems, and names of geographical objects are shown on top of it.

When creating a custom map, the user can define any number of types for it. To create a custom map, you must use the JavaScript API.