MapOptions
Map initialization options.
undefined
false
true
Enables OSM copyright auto hide after 5 sec
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
Prevents the map from dragging.
undefined
false
true
Prevents users from pitching the map.
undefined
false
true
Prevents users from rotating the map.
undefined
false
true
Disables map zoom on scrolling over the map container.
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
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 and fonts.
undefined
{ [key: string]: boolean }
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'.
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.