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:
- To locate two keys in the section block: subtype and subtype_params (please see manifest example for details).
- Specify expansion landing_google_maps_new (see assets in the manifest example).
- 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