Skip to content

Instantly share code, notes, and snippets.

@Pum-purum
Created October 9, 2017 07:20
Show Gist options
  • Save Pum-purum/6c6ec6c94fde1f3133294be7f44f3888 to your computer and use it in GitHub Desktop.
Save Pum-purum/6c6ec6c94fde1f3133294be7f44f3888 to your computer and use it in GitHub Desktop.
Вызов Яндекс-карты с произвольной отметкой на карте и подписью
$map_data['yandex_lat'] = $latitude; //значение типа 56.827911201256
$map_data['yandex_lon'] = $longitude; //значение типа 56.827911201256
$map_data['yandex_scale'] = 14;
$map_data['PLACEMARKS'][0] = array(
"LON" => $longitude,
"LAT" => $latitude,
"TEXT" => $address //любая текстовая строка
);
$APPLICATION->IncludeComponent(
"bitrix:map.yandex.view",
"cities",
array(
"COMPONENT_TEMPLATE" => "cities",
"CONTROLS" => array(
0 => "SCALELINE",
),
"INIT_MAP_TYPE" => "MAP",
"MAP_DATA" => serialize($map_data),
"MAP_HEIGHT" => "500",
"MAP_ID" => "",
"MAP_WIDTH" => "600",
"OPTIONS" => array(
0 => "ENABLE_DRAGGING",
)
),
false
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment