Maps in Blocks
If you are developing integrations for Bitrix24 using AI tools (Codex, Claude Code, Cursor), connect to the MCP server so that the assistant can utilize the official REST documentation.
Blocks with maps use subtype: map. This subtype connects map settings, adds the necessary attributes, and prepares the block for use in the editor.
In standard blocks for maps, the following approach is used:
- In the
blocksection,subtype: mapis specified - In
assets, thelanding_mapextension is included - In the block markup, the node
.landing-block-node-mapis used
The node .landing-block-node-map must already be present in the block markup. If it is not, the map subtype will not function. For an existing node .landing-block-node-map, the handler automatically adds the type map, the attribute data-map, and, if available, the attribute data-map-provider.
How to Configure a Map Block
The minimal version of the manifest:
'block' => [
'name' => 'Map',
'section' => ['contacts'],
'subtype' => 'map',
],
'assets' => [
'ext' => ['landing_map'],
],
Example markup:
<section class="landing-block g-pt-0 g-pb-0 g-height-70vh">
<div class="landing-block-node-map h-100"></div>
</section>
What the Map Subtype Does
After adding the block, the system:
- Determines the map provider
- Adds the attribute
data-map-providerto the node.landing-block-node-map - Creates an initial value for
data-mapwith center, zoom, and marker - Connects the
map_initextension if it is not already in the manifest
In standard blocks, the manifest usually specifies the landing_map extension. The map subtype automatically adds map_init if this extension is not present.
By default, the following is recorded in data-map:
- Center of the map
- Zoom level
17 - One initial marker
The starting center of the map depends on the website's zone.
If a map key is not configured for the selected provider, the subtype adds requiredUserAction. In the editor, the user will see a required action to navigate to the website settings.
What Providers Are Used
By default, Google Maps is used. The current provider is stored in the attribute data-map-provider.
The starting coordinates of the map depend on the website's zone. For the ru zone, a separate set of coordinates is used. For other zones, the default value is applied.
In the block interface, map provider settings are available, and for Google Maps, additional visual parameters are accessible:
- Map theme
- Display of roads
- Display of landmarks
Important Considerations
- In standard map blocks, the
landing_mapextension is used, notlanding_google_maps_new - In standard map manifests,
subtype: mapandlanding_mapare usually specified, while themap_initsubtype is added automatically type: mapfor.landing-block-node-mapis added by the subtype handler- If the block does not contain the node
.landing-block-node-map, the map subtype will not function
Examples of Standard Blocks
Examples of blocks of this type can be viewed in the repository through the methods landing.block.getmanifestfile and landing.block.getrepository.
Codes for some standard blocks:
16.1.google_map16.2.two_cols_text_map_fix16.3.two_cols_map_text_fix16.5.two_cols_map16.6.two_cols_map_reverse
To ensure the map block functions correctly, add the node .landing-block-node-map to the markup in advance, and the map subtype will complement the manifest and initial settings.