Documentation

Maps in Blocks

To work with maps (presently, Google Maps are supported) and have the complete set of features to edit, the following is required:

  1. To locate two keys in the section block: subtype and subtype_params (please see manifest example for details).
  2. Specify expansion landing_google_maps_new (see assets in the manifest example).
  3. Specify map type (where the map will be located) in the required node.

Manifest example

return [
   'block' => [
      'name' => 'Google Map',
      'section' => ['contacts'],
      'subtype' => 'map',
      'subtype_params' =>[
         'required' => 'google'
      ],
   ],
   'cards' => [],
   'nodes' => [
      '.landing-block-node-map' => [
         'name' => 'Map',
         'type' => 'map',
      ]
   ],
   'style' => [
      'block' => [
         'type' => ['block-default-wo-background-vh-animation']
      ],
      'nodes' => [],
   ],
   'assets' => [
      'ext' => ['landing_google_maps_new'],
   ]
];

Example of block for this manifest:

<section class="landing_block g-pt-0 g-pb-0 g-height-70vh">
    <div class="landing-block-node-map h-100" data-map></div>
</section>


© «Bitrix24», 2001-2024