‘,
{
build: function() {
this.constructor.superclass.build.call(this);
var firstElementChild = BX.findChild(this.getElement());
firstElementChild.style.marginTop = «-» + (firstElementChild.offsetHeight + 10) + «px»;
BX.bind(BX.findChild(this.getElement(), {«class» : «kb-close»}, true), «click», BX.delegate(function(){
this.getData().geoObject.getMap().balloon.close();
}, this));
},
getClientBounds: function() {
var el = BX.findChild(this.getElement());
if (el) {
return [[-1 * el.offsetWidth / 2, -1 * el.offsetHeight], [el.offsetWidth / 2, 0]];
}
}
}
),
balloonShadow: false,
balloonAutoPan: true,
// balloonAutoPanMargin: 200,
geoObjectIconImageHref : «/images/templates/kupibonus/pointer2.png»,
geoObjectIconImageSize : [44,63],
geoObjectIconImageOffset : [-15, -54]
});
var places = [{‘yandex_map’:[‘55.696524072129′,’37.507196361091′],’name’:’Фитнес-центр ТОНУС-КЛУБ®’,’address’:’г. Москва, Мичуринский пр-т, д. 19, корп. 3′,’subway_class’:’m-sk’,’subway_name’:’Университет’,’phones’:’+7
‘,’have_line’:true},{‘yandex_map’:[‘55.697777213359′,’37.859264087243′],’name’:’Фитнес-центр ТОНУС-КЛУБ®’,’address’:’г. Москва, Октябрьский пр-т, д. 5′,’subway_class’:’m-tk’,’subway_name’:’Выхино’,’phones’:’+7
‘,’have_line’:true},{‘yandex_map’:[‘55.541397245223′,’37.536382624672′],’name’:’Фитнес-центр ТОНУС-КЛУБ®’,’address’:’г. Москва, ул. Южнобутовская, д. 36′,’subway_class’:’m-bt’,’subway_name’:’Улица Горчакова’,’phones’:’+7
‘,’have_line’:true},{‘yandex_map’:[‘55.897674843647′,’37.390190795335′],’name’:’Фитнес-центр ТОНУС-КЛУБ®’,’address’:’г. Химки, ул. Соколово-Мещерская, д. 16/114′,’subway_class’:»,’subway_name’:»,’phones’:’+7
‘,’have_line’:true},{‘yandex_map’:[‘55.841083739614′,’37.376841830213′],’name’:’Фитнес-центр ТОНУС-КЛУБ®’,’address’:’г. Москва, ул. Митинская, д. 12′,’subway_class’:’m-ap’,’subway_name’:’Волоколамская’,’phones’:’+7
‘,’have_line’:true},{‘yandex_map’:[‘55.73865212383′,’37.488610217863′],’name’:’Фитнес-центр ТОНУС-КЛУБ®’,’address’:’г. Москва, ул. Олеко Дундича, д. 21, корп. 3′,’subway_class’:’m-fl’,’subway_name’:’Филевский парк’,’phones’:’+7
‘,’have_line’:true},{‘yandex_map’:[‘55.49323699704′,’37.299514850556′],’name’:’Фитнес-центр ТОНУС-КЛУБ®’,’address’:’г. Троицк, ул. Нагорная, д. 8′,’subway_class’:»,’subway_name’:»,’phones’:’+7
‘,’have_line’:true},{‘yandex_map’:[‘55.923684801723′,’37.826295916316′],’name’:’Фитнес-центр ТОНУС-КЛУБ®’,’address’:’г. Королев, ул. Фрунзе, д. 1Д, корп. 1′,’subway_class’:»,’subway_name’:»,’phones’:’+7
‘,’have_line’:true},{‘yandex_map’:[‘55.881868583355′,’37.423015235816′],’name’:’Фитнес-центр ТОНУС-КЛУБ®’,’address’:’г. Химки, ул. Бабакина, д. 4А’,’subway_class’:»,’subway_name’:»,’phones’:’+7
‘,’have_line’:true},{‘yandex_map’:[‘55.645008930658′,’37.659155374553′],’name’:’Фитнес-центр ТОНУС-КЛУБ®’,’address’:’г. Москва, ул. Москворечье, д. 31, корп. 1′,’subway_class’:’m-zm’,’subway_name’:’Кантемировская’,’phones’:’+7
‘,’have_line’:true}];
// Добавим метки
for (var i = 0; i < places.length; i++) {
var placemark = new ymaps.Placemark(
places[i]['yandex_map'], places[i]);
myMap.geoObjects.add(placemark);
balloons.push(placemark);
}
myMap.setBounds(myMap.geoObjects.getBounds(), {
checkZoomRange: true,
zoomMargin: [20, 0, 0, 0]
});
var clearClass = function() {
var arItems = BX.findChild(document.body, {"tag" : "li", "class" : "kb-place-item"}, true, true);
if (arItems) {
for (var j = 0; j < arItems.length; j++) {
if (BX.hasClass(arItems[j], "active")) {
BX.removeClass(arItems[j], "active");
}
}
}
};
myMap.controls.add('smallZoomControl', { top: 70, right: 5 });
myMap.events.add(["balloonopen"], function (event) {
for (var i = 0; i < balloons.length; i++) {
balloons[i].balloon.isOpen();
}
});
var arItems = BX.findChild(document.body, {"tag" : "li", "class" : "kb-place-item"}, true, true);
if (arItems) {
for (var j = 0; j < arItems.length; j++) {
BX.bind(arItems[j], "click", function() {
if(BX.hasClass(this, "active"))
{
return false;
}
var balloonId = this.getAttribute("id").replace("kb-place-", "");
if (balloonId && balloons[balloonId]) {
balloons[balloonId].getMap().setGlobalPixelCenter(
balloons[balloonId].geometry.getPixelGeometry().getCoordinates(),
16,
{
callback : function(){balloons[balloonId].balloon.open();},
duration : 500
}
);
}
clearClass();
BX.addClass(this, "active");
});
}
}
});