A
A
Alexander2020-12-22 13:30:08
1C-Bitrix
Alexander, 2020-12-22 13:30:08

Why does Yandex map not work on a site running Bitrix?

Website Bitrix Edition Business.
It would seem that a fairly easy task is to insert a Yandex map, but a strange situation occurs, the map does not work on a site that is hosted on a server on the Internet, while Yandex map works fine on the local version of the same site (OpenServer). Both versions have antivirus enabled in alert mode. Tell me what could be the reason?

Card connection code:

<div class="contacts__map animate" id="map" data-animation="fadeInRight">
<script charset="utf-8" async src="https://api-maps.yandex.ru/services/constructor/1.0/js/?um=constructor%3A3a1c4f00f34d7cd6e5f077edd9b1267650c462874d9c0cccd965b672bed14f13&amp;width=100%25&amp;height=100%25&amp;lang=ru_RU&amp;scroll=true"></script>
 </div>


On the page of a site that is hosted on a server on the Internet, if you look at the DOM structure, the Yandex map is generated, but not added to the div block, while in the version on the local Yandex site, the map is generated inside the div element where the link to the map constructor is located.

How it looks on a site on the Internet:
5fe1c91ea792f219688231.jpeg
instead of being placed in an element with an id equal to map, the map ran to the bottom of the page, because of this it is not visible
5fe1c93523ab1291451699.jpeg

On the local server:

everything works fine here, the map is placed inside an element with an id equal to map should
5fe1c953e9c20822401085.jpeg

Perhaps the reason is in the server settings and they can somehow affect the loading of Yandex maps? Or are there other parameters in the Bitrix settings, besides the anti-virus, that will remove the link to scripts from html elements?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2020-12-22
@inviziblll

Main module settings - move all JS to the end of the page
solution - https://www.bbitrix.ru/pages/resheniya/data-skip-m...

A
Adamos, 2020-12-22
@Adamos

to fit in the element with id equal to map

You need to specify this id in the link to the script.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question