N
N
Nadezhda Golovina2020-10-13 01:33:46
1C-Bitrix
Nadezhda Golovina, 2020-10-13 01:33:46

How to put your icon on Ya.Maps in Bitrix?

There is a Bitrix infoblock with the "Binding to Yandex.Map" property . On the element page in the admin panel, a map is displayed where a point is marked. On the site , this map with the label is displayed through the code:

<div class="salon-yamap" id="map_container">
      <?$coord = explode(",", $arResult['PROPERTIES']['SALON_MAP']['VALUE']);?>
      <?$APPLICATION->IncludeComponent(
      "bitrix:map.yandex.view",
      "",
      Array(
      "INIT_MAP_TYPE" => "MAP",
      "MAP_DATA" => serialize(array(
      'yandex_lat' => $coord[0],
      'yandex_lon' => $coord[1],
      'yandex_scale' => 16, //Масштаб карты
      'PLACEMARKS' => array (
      array(
      'TEXT' => $arProperty["SALON_MAP"]["VALUE"],
      'LON' => $coord[1],
      'LAT' => $coord[0],
      ),
      ),
      )),
      "MAP_WIDTH" => "100%",
      "MAP_HEIGHT" => "285",
      "CONTROLS" => array("SMALLZOOM", "TYPECONTROL"),
      "OPTIONS" => array("ENABLE_DRAGGING"),
      "MAP_ID" => ""
      ),
      false
      );?>
</div>

Tell me how to put your icon on the label?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Danny Arty, 2020-10-13
@Golovina90

If you have a "Yandex.Maps: Custom Map" component , then you need to find the script.js file and find the line in its code: under this line, add:
{balloonCloseButton: true}

balloonCloseButton: true,
iconImageHref:"путь к картинке",
iconImageSize: [ширина, высота],

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question