I
I
Igor2020-05-21 00:40:11
Yandex maps
Igor, 2020-05-21 00:40:11

How to center route Yandex maps from a closed container?

I'm trying to center a route built in Yandex Maps using route in a closed container. The route method has an option mapStateAutoApply: true , but it doesn't work in a hidden container. The geometry route.geometry returns null and setBound is therefore not taken either.

What other ways are there to center the maps on the constructed route?
Oh yes, if there can still be other elements on the map, and myMap.setBounds(myMap.geoObjects.getBounds()); also does not fit, you need to center the desired route .
Example attached: https://codepen.io/corsik/pen/LYpMeJP

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