Google Maps API Error with no changes in the page code

前端 未结 3 495
伪装坚强ぢ
伪装坚强ぢ 2021-01-18 13:23

Today, with no changes in our code, Google Maps is not working, we are getting this errors today:

Uncaught TypeError: Cannot read property \'entries\' of und         


        
相关标签:
3条回答
  • 2021-01-18 13:47

    I found the solution to the problem based on this Cannot read property 'entries' of undefined in http://maps.googleapis.com/maps/api/ and on @ajayel answer's: "Google changed their Maps API script and started using the variable Map which broke our site November 2017. Renaming the Map variable to OurMap fixed the issue for us."

    The issue here is that we was also using the name Map for our main map operations javascript library, we changed it, and everything started to work fine!

    0 讨论(0)
  • 2021-01-18 13:48

    There are 2 types of error codes, errors and warnings. An error indicates a severe issue which occurred while loading the Google Maps JavaScript API. Your page cannot load the API correctly, and the API will not work on that page. A warning is a supplemental message about the loading of the Google Maps JavaScript API. The warning describes the possible reasons for an error, or suggests potential issues in your code that loads the Google Maps JavaScript API. If you receive only warnings without any errors, the API will work correctly on that page. But we recommend that you fix the potential issues as well.

    0 讨论(0)
  • 2021-01-18 13:55

    You are using the "experimental" version of the API, try the release version. Details (from the documentation):

    The current release version is 3.29. You can request it with either of the following bootstraps:

    <script async defer
    src="https://maps.googleapis.com/maps/api/js?v=3
        &key=YOUR_API_KEY&callback=initMap">
    

    or

    <script async defer
    src="https://maps.googleapis.com/maps/api/js?v=3.29
        &key=YOUR_API_KEY&callback=initMap">
    

    related question: Google Maps API: Load specific version

    0 讨论(0)
提交回复
热议问题