Answer the question
In order to leave comments, you need to log in
Is it possible to connect 2 Yandex cards with different positions in neighboring blocks?
Good day. The question is next. How can I connect 2 Yandex cards in neighboring blocks. I connect through the constructor. Here is an example (there are two such blocks):
<div class="map">
<script type="text/javascript" charset="utf-8" async src="https://api-maps.yandex.ru/services/constructor/1.0/js/?um=constructor%XXX&width=100%&height=100%&lang=ru_RU&scroll=false"></script>
</div>
<iframe src="XXX" width="560" height="400" frameborder="0"></iframe>
Answer the question
In order to leave comments, you need to log in
<script src="http://api-maps.yandex.ru/2.0/?load=package.full&lang=ru-RU" type="text/javascript"></script>
<script type="text/javascript">
ymaps.ready(init);
function init() {
var myMap = new ymaps.Map("map-1", {
center: [56.830175456095785, 60.593889812164235],
zoom: 16
});
myMap.behaviors.disable('scrollZoom', 'drag');
var myMap2 = new ymaps.Map("map-2", {
center: [56.830175456095785, 60.593889812164235],
zoom: 16
});
myMap2.behaviors.disable('scrollZoom', 'drag');
}
</script>
<div id="map-1" style="height: 500px;"></div>
<div id="map-2" style="height: 500px;"></div>
Rather, it is better to connect the map via Yandex maps api
https://tech.yandex.ru/maps/doc/jsapi/2.1/quick-st...
And you can connect several and configure each as needed
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question