skip to Main Content

Google map was working and now asking require to change API key. After API key updation, it says

Array.from() with an implementation that doesn’t support iterables,
Google Maps JavaScript API v3 to not work correctly.

How it remove this bug?

2

Answers


  1. It’s possible we have the same issue.

    You probably received a mail from google which annonce an API update.

    We’re writing to let you know that the Maps JavaScript API will become
    unavailable to applications using non-compliant libraries, from the
    Maps JavaScript API version 3.54, releasing to the weekly channel in
    August 2023.

    Some third party libraries emulate newer JavaScript functionality, for
    browsers that may not support them natively. The Maps JavaScript API
    will start using some newer functionality in the ECMAScript standard,
    namely Array.from().

    While Array.from() is available and working in all browsers supported
    by the Google Maps JavaScript API, some applications have code which
    replaces the working version of this with an invalid version from a
    library – creating an invalid JS environment.

    We have noticed that your application uses libraries incompatible with
    ECMAScript 2020, especially Array.from().

    The first solution you can use is to specify the API version in the url. In that case, the earlier version from the update (april 2023), which is the 3.53.

    It will look like that:

    https://maps.googleapis.com/maps/api/js?key=xxxxxxxxxxxx&v=3.53
    

    The default of this solution is that Google already announces its obsolescence:

    For example, you can specify v=3.53 until April 2024, after which all
    Maps JavaScript versions will require a fix to your application.

    Hope it will help. I will post again if I find a sustainable solution.

    Axel

    Login or Signup to reply.
  2. In my case, I had a conflict between Prototype.js and the new version of Google Maps API with the functionality Array.from().

    So I have to use a local version on my website (because i usually use https://ajax.googleapis.com/ajax/libs/prototype), only call where is use a frame Google Maps and in that local version I change the line:

    Array.from = $A;
    

    To:

    Array.from = Array.from || $A;
    

    Hope it will help,
    Axel

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search