A
A
Alexander2019-01-30 23:27:17
Yandex maps
Alexander, 2019-01-30 23:27:17

Why doesn't setBounds take into account maximum zoom and padding?

When creating a map, I specify the maximum zoom as follows:

APP.controller.map.map = new ymaps.Map(self.$$o.map.attr('id'), {
            center: [55.76, 37.64],
            zoom: 7,
            maxZoom: 12
        });

and immediately set the default indents:
APP.controller.map.map.margin.setDefaultMargin([0,600,0,0]);

margin.getOffset() returns [-300, 0] (btw why not 600?)
margin.getMargin() - [0, 600, 0, 0]
But when I do map.setBounds(map.geoObjects.getBounds()) ; neither padding nor zoom are taken into account.
I struggle with zoom like this: if (map.getZoom() > 16) map.setZoom(16);// maximum zoom
And I don't know what to do with indents.
Where to dig?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question