$queryUrl = 'сайт/вебхук/crm.livefeedmessage.add.json';
$queryData = http_build_query(array(
'fields' => array(
'POST_TITLE' => 'Заявка на консультацию: ',
'MESSAGE' => "Битрикс24 создан на базе платформы Bitrix Framework.",
'ENTITYTYPEID' => 1,
'ENTITYID' => intval($result['result']),
)
));
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_POST => 1,
CURLOPT_HEADER => 0,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $queryUrl,
CURLOPT_POSTFIELDS => $queryData,
));
$result = curl_exec($curl);
curl_close($curl);
$result = json_decode($result, 1);
if (CModule::IncludeModule("iblock")) {
$filter = [
'IBLOCK_ID' => 2,
];
$select = [
'NAME',
'SECTION_PAGE_URL',
];
$dbSection = CIBlockSection::GetList(
[
'LEFT_MARGIN' => 'ASC',
],
array_merge(
[
'ACTIVE' => 'Y',
'GLOBAL_ACTIVE' => 'Y',
],
is_array($filter) ? $filter : []
),
false,
array_merge(
[
'ID',
'IBLOCK_SECTION_ID',
],
is_array($select) ? $select : []
)
);
while ($arSection = $dbSection->GetNext(true, false)) {
$SID = $arSection['ID'];
$PSID = (int)$arSection['IBLOCK_SECTION_ID'];
$arLincs[$PSID]['CHILDS'][$SID] = $arSection;
$arLincs[$SID] = &$arLincs[$PSID]['CHILDS'][$SID];
}
$arResult['SECTIONS'] = array_shift($arLincs);
}
let deliveryMap = {
run() {
deliveryMap.mainMap();
},
mainMap() {
if ($('[data-stores-map]').length) {
let tempValue = Object.values(stores);
let storesPoints = [tempValue[0]['GPS_N'], tempValue[0]['GPS_S']];
ymaps.ready(function () {
let myMap = new ymaps.Map('mapStores', {
center: storesPoints,
zoom: 13,
controls: []
}, {
searchControlProvider: 'yandex#search'
});
for (let j = 0; j < tempValue.length; j++) {
let storePoint = [tempValue[j]['GPS_N'], tempValue[j]['GPS_S']];
let specialText = '';
if (tempValue[j]['SCHEDULE'].length) {
specialText += '<b>Часы работы:</b><br>';
specialText += tempValue[j]['SCHEDULE'] + '</br>';
}
window['placemark_' + tempValue[j]['ID']] = new ymaps.Placemark(storePoint, {
balloonContentHeader: tempValue[j]['TITLE'],
balloonContentBody: specialText,
balloonContentFooter: '',
hintContent: tempValue[j]['TITLE']
});
myMap.geoObjects.add(window['placemark_' + tempValue[j]['ID']]);
if (tempValue.length > 1) {
myMap.setBounds(myMap.geoObjects.getBounds());
}
}
$(document).on('click', '[data-store-id]', function (e) {
e.preventDefault();
let storeId = e.currentTarget.attributes['data-store-id'].value;
let storesPoints = [stores[storeId]['GPS_N'], stores[storeId]['GPS_S']];
myMap.setCenter(storesPoints, 10, {
checkZoomRange: true
});
});
});
}
}
};
module.exports = deliveryMap;
<div>
<div></div>
<div></div>
<div></div>
...
</div>
<div style="display: none"></div>
<div>
<div></div>
<div></div>
<div></div>
...
</div>
<div style="display: none"></div>
<div>
<div></div>
<div></div>
<div></div>
...
</div>