MapOptions
Map initialization options.
undefined
false
true
Enables OSM copyright auto hide after 5 sec
[DEPRECATED] This option is no longer supported and will be removed in the next major release.
number[]
Map center in geographical coordinates ([longitude, latitude]
).
Partial<Padding>
Sets padding for controls layout
Where to add copyright control during the map initialization. By default it's "bottomRight"
.
undefined
string
Sets default background color, while style is loading
undefined
false
true
Disables fullscreen AntiAliasing when map is idle. True by default.
undefined
false
true
Prevents the map from dragging.
undefined
false
true
Disables hiding POIs behind objects such as buildings, 3D models, etc. False by default.
undefined
false
true
Prevents users from pitching the map.
undefined
false
true
Disable render caching.
undefined
false
true
Prevents users from rotating the map.
undefined
false
true
Disables map zoom on scrolling over the map container.
undefined
false
true
Tracks changes of the map container size and automatically updates the size of the map.
ControlPosition
boolean
Whether a floor control should be added during the map initialization. By default it's false
.
Set to true
to add the floor control at "topRight"
position.
undefined
false
true
Prevents center changing while user is zooming or rotating the map by touch.
undefined
string
The key that allows usage of the API.
undefined
string
The desired map language. short language code 'en', 'ru', ...etc
undefined
false
true
Loop the map when rendering at large scales or near the anti-meridian
undefined
number
Maximum map pitch in degrees for low zoom (zoom < 16.5).
The map will be constrained to the given bounds, if set.
undefined
number
Maximum map pitch in degrees.
undefined
number
Maximum map styleZoom.
undefined
number
Minimum map pitch in degrees.
undefined
number
Minimum map styleZoom.
Dimensions in pixels applied on each side of the viewport for shifting the vanishing point. the padding on each side has a clamp to a positive value no larger than the map canvas size for either side
undefined
number
Map pitch in degrees.
undefined
false
true
Sets preserveDrawingBuffer option to WebGLRenderingContext.
undefined
number
Map rotation in degrees.
ControlPosition
boolean
Whether a scale control should be added during the map initialization. By default it's false
.
Set to true
to add the scale control at "bottomLeft"
position.
undefined
string
The map style ID, that you can get at https://styles.2gis.com
Partial<StyleOptions>
Map style options. Containts path to style assets - icons, fonts, models etc. Warning: If the options are incompatible, a broken style might be applied. Map styles are constantly evolving in order to display new cartographic data. By storing the style on your own side, you assume the responsibility to update it periodically and take care of its relevance. It is recommended to use map.setStyleById to update styles during runtime.
Map style global variables
undefined
number
Map style zoom. Use this option if you want to set the same zoom that is used in the style settings. The styleZoom and zoom options set the same map scale but in different projections. If both options are set, the styleZoom has a higher priority than the zoom option.
undefined
number
Map rotation threshold with multitouch in degrees. 10 by default.
ControlPosition
boolean
Whether a traffic control should be added during the map initialization. By default it's false
.
Set to true
to add the traffic control at "topRight"
position.
"always-on"
"always-off"
"depends-on-language"
Enables map to download additional plugin for RTL-text rendering. Values are:
- 'always-on' - plugin will be downloaded at map initialization.
- 'always-off - plugin will not be downloaded.
- 'depends-on-language' - plugin will be downloaded only if "ar" language is selected.
Default value is 'depends-on-language'. If the language of the map is not rtl (eg. 'en') and tiles contain rtl labels, you should use 'always-on' to render rtl label properly.
Sets the map WebGL version. It can be helpful if you use CustomLayer with other WebGL libraries.
undefined
number
Map zoom.
ControlPosition
boolean
Whether a zoom control should be added during the map initialization. By default it's "topRight"
.
Set to false
to not add the control.