V
V
Vadim Kravchik2018-06-17 18:32:02
JavaScript
Vadim Kravchik, 2018-06-17 18:32:02

Why is google map throwing an error?

There is a script:

<script>
          var locations = [
          <?php foreach($mapdata as $maping){ ?>
          {lat:<?=$maping['lat'];?>, lng: <?=$maping['lng'];?>, type:<?=$maping['category_id']?>},
          <?php } ?>
          ];
          var descrip = <?=json_encode($mapdata)?>;
          
          function initMap() {
          
            var map = new google.maps.Map(document.getElementById('map'), {
              zoom: 11,
              center: {lat: 50.427646, lng: 30.539380}
            });
        }
        </script>

And immediately after it follows:
<script async defer
      src="https://maps.googleapis.com/maps/api/js?key=MyKEY&callback=initMap"></script>
        <script defer src="https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/markerclusterer.js"></script>

But it gives an error in the console:
5b267ef0d34b4651550526.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dymok, 2018-06-17
@UnluckySerivelha

Why does google map throw an error at times?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question