<script>
function init(){
var myMap = new ymaps.Map("map", {
center: [ЧИСЛА],
zoom: 10
}, {
searchControlProvider: 'yandex#search'
});
myMap.geoObjects.add(new ymaps.Placemark([ЧИСЛА?>], {
balloonContent: 'ИМЯ?>'
}, {
preset: 'islands#dotIcon',
iconColor: '#3b5998'
}));
}
ymaps.ready(init);
</script>
ymaps.ready(function () {
map = new ymaps.Map('map_two', {
center: [47.258453, 39.599471],
zoom: 17,
//controls: []
}, {
searchControlProvider: 'yandex#search'
}
);
var placemark1 = new ymaps.Placemark([47.258453, 39.599471], {
balloonContent: 'г. Москва',
iconCaption: 'пер. д. 9/2'
}, {
preset: 'islands#redDotIconWithCaption'
});
map.geoObjects
.add(placemark1)
var counter = 0;
var menulinks = jQuery('.mapto');
var counter = 0;
/*jQuery('.mapto').click(function(event) {
map.panTo([47.239691, 39.599283], {
flying: true,
duration: 500
})
});
*/
menulinks.bind('click', function () {
map.panTo([47.239691, 39.599283], {
flying: true,
duration: 500,
});
});
<?
$selected_min_id = empty($_SESSION["city"]) ? 25 : $_SESSION["city"];
$rsMin = CIBlockElement::GetList(array(), array("IBLOCK_ID" => 10, "ACTIVE" => "Y", "ID" => $selected_min_id), false, false, array("ID", "NAME", "PROPERTY_MAP"));
if ($arMin = $rsCity->GetNext()) {
} else {
$rsMin = CIBlockElement::GetList(array(), array("IBLOCK_ID" => 10, "ACTIVE" => "Y", "ID" => 25), false, false, array("ID","NAME", "PROPERTY_MAP"));
$arMin = $rsCity->GetNext();
}
// $map = $arMin["PROPERTY_MAP_VALUE"];
?>
<script>
function init_<?=$arMin['ID']?>(){
var myMap = new ymaps.Map("map_<?=$arMin['ID']?>", {
center: [<?=$arMin['PROPERTY_MAP_VALUE']?>],
zoom: 10
}, {
searchControlProvider: 'yandex#search'
});
myMap.geoObjects.add(new ymaps.Placemark([<?=$arMin['PROPERTY_MAP_VALUE']?>], {
balloonContent: '<?=$arMin['NAME']?>'
}, {
preset: 'islands#dotIcon',
iconColor: '#3b5998'
}));
}
ymaps.ready(init_<?=$arMin['ID']?>);
</script>
<div id = "map_<?=$arMin['ID']?>">
</div>