D
D
danilr2019-09-30 20:37:56
JavaScript
danilr, 2019-09-30 20:37:56

Why is the 2GIS map not loading?

I connect the card exactly according to the API 2gis instructions. But it is displayed in gray, that is, the map elements are not loaded. Why and how to fix?
In the head section

<script src="https://maps.api.2gis.ru/2.0/loader.js?pkg=full"></script>
    <script type="text/javascript">
      var map;
        DG.then(function () {
            map = DG.map('map', {
                center: [55.016595, 82.948391],
                zoom: 16,
                // zoomControl: false,
                minZoom: 11,
                fullscreenControl: false,
                scrollWheelZoom: false
            });
    </script>

in bodysuit
<div class="map-wrapper">
    <div id="map" style="width:100%; height:100%"></div>
  </div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
danilr, 2019-10-01
@danilr

The problem was the following, the styles for img interfered.

img {
  max-width: 100%;
  max-height: 100%;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question