Офисы
Списком
Московский филиал, Головной офис | Москва, Москва, ул.Тихвинская, д.20 | Понедельник – пятница 9:00 — 18:00 |
+7 (495) 644-11-64 | info@1dbank.ru | 2 |
$(document).ready(function(){
$('.b-safe-info__nav .city li a').click(function(){ if ($(this).parent().hasClass('active')) { return false; } $('.b-safe-info__nav .city .active').removeClass('active'); $(this).parent().addClass('active'); initMap(); //$('.safes-list tr').hide(); $('.safes-list tr.city-' + $(this).parent().attr('index')).show(); return false; });
$('.switch .switch-item,.switch-btn').click(function(){ if ($(this).hasClass('active')) { return false; } $('.switch .switch-item').toggleClass('active');
if ($('.switch-item:eq(0)').hasClass('active')) { $('.switch-btn .icon').animate({left:0},100); $('.safes-map').toggle(); initMap(); } else { $('.switch-btn .icon').animate({left:28},100); $('.safes-map').toggle(); }
return false; });
$('.offices tr td a').click(function(){ $('.b-offices__pop-up h2').text($(this).text());
$('.b-offices__pop-up .office-head').text($(this).parents('tr:eq(0)').find('.info.head').text()); $('.b-offices__pop-up .office-phone').text($(this).parents('tr:eq(0)').find('.info.phone').text()); $('.b-offices__pop-up .office-email').text($(this).parents('tr:eq(0)').find('.info.email').text()); $('.b-offices__pop-up .office-address').text($(this).parents('tr:eq(0)').find('.info.address').text()); $('.b-offices__pop-up .office-schedule').text($(this).parents('tr:eq(0)').find('.info.schedule').text());
$('.print-button').attr('href','./' + $(this).parents('tr:eq(0)').find('.info.id').text() + '/');
$('.b-overlay').show(); $('.b-offices__pop-up').show();
a = []; a[0] = $(this).parents('tr:eq(0)').find('.info.address').text(); initMap('popupmap',a); return false; });
});
ymaps.ready(initMap1); var mapYa; adresses = {
"Москва":["Москва, Москва, ул.Тихвинская, д.20"] }
function initMap1() { prts = document.location.href.split('#'); if (prts.length > 1 && prts[1].length > 3) { console.log('>> a[href="#' + prts[1] + '"]'); $('a[href="#' + prts[1] + '"]').click(); } initMap(); }
function initMap(subject,a){
if (typeof mapYa != 'undefined') { mapYa.destroy(); }
if (subject == 'popupmap') { mapYa = 'popupmap'; } else { mapYa = 'map'; } mapYa = new ymaps.Map(map, { center: [53, 25] , // Default city zoom: 3, behaviors: ['default', 'scrollZoom'] });
mapYa.setType('yandex#map'); mapYa.container.fitToViewport(); mapYa.controls.add(new ymaps.control.ZoomControl()); mapYa.controls.add('typeSelector');
function MultiGeocoder(options) { this._options = options || {}; }
MultiGeocoder.prototype.geocode = function (requests, options) { var self = this, opts = ymaps.util.extend({}, self._options, options), size = requests.length, promise = new ymaps.util.Promise(), result = [], geoObjects = new ymaps.GeoObjectArray()
requests.forEach(function (request, index) { ymaps.geocode(request, opts) .then( function (response) { var geoObject = response.geoObjects.get(0); var p = new ymaps.geometry.base.Point(geoObject.geometry.getCoordinates()); var geoObject = new ymaps.GeoObject({ geometry: { type: "Point", coordinates: geoObject.geometry.getCoordinates() }, properties: { // } }, { iconImageHref: '/style/images/marker.png', iconImageSize: [54, 90], iconImageOffset: [-25, -90] });
geoObject && (result[index] = geoObject); --size || (result.forEach(geoObjects.add, geoObjects), promise.resolve({ geoObjects : geoObjects })); }, function (err) { promise.reject(err); } ); }); return promise; };
var mGeocoder = new MultiGeocoder({ boundedBy : mapYa.getBounds() });
if (subject == 'popupmap') { points = a; } else { points = adresses[$('.b-safe-info__nav li.active a').text()]; }
mGeocoder.geocode(points, {kind: 'house'}) .then(function (res) { var myGroup = new ymaps.GeoObjectArray(); myGroup.add(res.geoObjects); mapYa.geoObjects.add(myGroup); mapYa.setBounds(myGroup.getBounds(), { checkZoomRange: true }); }, function (err) { console.log(err); } );
};