Здравствуйте!
Имеем карту с кластерами.
function init() {
var bigMap = new ymaps.Map('bigMap', {
center: [55.82, 37.64],
zoom: 10
}, {
searchControlProvider: 'yandex#search'
}),
objectManager = new ymaps.ObjectManager({
clusterize: true,
gridSize: 32,
}),
myPlacemark0 = new ymaps.Placemark([59.924194, 30.350233], {
hintContent: 'Вы находитесь здесь',
iconContent: 'Я',
}, {
balloonPanelMaxMapArea: 0,
preset: 'islands#blueStretchyIcon',
iconCaptionMaxWidth: '70'
});
objectManager.objects.options.set({
preset: 'islands#greenDotIcon',
//balloonPanelMaxMapArea: 'Infinity'
});
objectManager.clusters.options.set('preset', 'islands#greenClusterIcons');
bigMap.geoObjects.add(objectManager);
//bigMap.geoObjects.add(myPlacemark0);
$.ajax({
url: 'db/data.json',
error: function() {
alert('Error on load data!');
}
}).done(function(data) {
objectManager.add(data);
bigMap.setBounds(bigMap.geoObjects.getBounds()); // <-- Этим методом устанавливаем масштаб
});
}
ymaps.ready(init);Иногда карта масштабируется нормально (захватывает все точки), а иногда на самое дельнее расстояние.
В чём может быть проблемма?
Заранее спасибо.