MapOptions | MapGL | 2GIS Documentation

MapOptions

Map initialization options.

Properties
undefinedfalsetrue

Enable OSM copyright auto hide after 5 sec

number[]

Map center in geographical coordinates ([longitude, latitude]).

Partial<Padding>

Set padding for contols layout

Where to add copyright control during the map initialization. By default it's "bottomRight".

undefinedstring

Set default background color, while style is loading

undefinedfalsetrue

Prevent users from pitching a map.

undefinedfalsetrue

Prevent users from rotating a map.

undefinedfalsetrue

Disable map zoom on scrolling over the map container.

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.

undefinedstring

The key that allows usage of the API.

undefinedstring

The desired map language. short language code 'en', 'ru', ...etc

The map will be constrained to the given bounds, if set.

undefinednumber

Maximum map pitch in degrees.

undefinednumber

Maximum map zoom.

undefinednumber

Minimum map pitch in degrees.

undefinednumber

Minimum map zoom.

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

undefinednumber

Map pitch in degrees.

undefinedfalsetrue

Set preserveDrawingBuffer option to WebGLRenderingContext.

undefinednumber

Map rotation in degrees.

undefinedstring

The map style ID, that you can get at https://styles.2gis.com

undefined{ [key: string]: boolean }

Map style global variables

undefinednumber

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.

undefinednumber

Map rotation threshold with multitouch in degrees. 10 by default.

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.

undefinednumber

Map zoom.

Whether a zoom control should be added during the map initialization. By default it's "topRight". Set to false to not add the control.