');var placemark = new ymaps.Placemark(geo[i], {balloonContentBody:'
' +'' + phoneformat(ph[i].toString()) + '' +'
' + adres[i] + '
Курсы валют банков
Подробно об отделении'+ '
Программы кредитования'+ '
Все банки Арсеньева'}, {iconLayout: squareLayout,iconShape: {type: 'Rectangle',coordinates: [[-20, -49], [23, 0]]}});placemarks.push(placemark);}clusterer.add(placemarks);map.geoObjects.add(clusterer);if (clusterer.getClusters().length != 0) { map.setBounds(clusterer.getBounds()); }else { map.setCenter(placemarks[0].geometry.getCoordinates(), 15); }};function phoneformat(phone) {var len = phone.length;if (len == 10) {phone = phone.replace(/(\d{3})(\d{3})(\d{2})(\d{2})/, '+7 ($1) $2-$3-$4');} else if (len == 12) {phone = phone.replace(/(\d{2})(\d{3})(\d{3})(\d{2})(\d{2})/, '+$1 ($2) $3-$4-$5');}return phone;}function infoaddress(adres, id) {ymaps.geocode(adres, {results: 1}).then(function (res) {var firstGeoObject = res.geoObjects.get(0),coords2 = firstGeoObject.geometry.getCoordinates(),bounds = firstGeoObject.properties.get('boundedBy');map.geoObjects.add(firstGeoObject);map.setBounds(bounds, {checkZoomRange: true });var myPlacemark2 = new ymaps.Placemark(coords2, {iconContent: adres + ' -- ' + coords2[0].toFixed(6) + ' ' + coords2[1].toFixed(6),balloonContent: 'Данные БД: ' + adres+ '
Данные Yand: ' + firstGeoObject.properties.get('name')+ '
' + firstGeoObject.properties.get('description') + '
' + firstGeoObject.properties.get('text') + '
' + coords2[0].toFixed(6) + ' ' + coords2[1].toFixed(6)+ '
Записать в БД geo - ' + coords2 + ''}, {preset: 'islands#violetStretchyIcon'});map.setZoom(15);map.geoObjects.add(myPlacemark2);myPlacemark2.balloon.open();});}