Menu

Googlemaps about to stop working?

GaryT
2021-04-15
2024-05-02
  • GaryT

    GaryT - 2021-04-15

    I'm trying to get the googlemaps module to work, and came across a possible major snag.
    I looked at my browser console log, to find some hints as to why I'm still getting a greyed out map, and saw this:

    The Google Maps JavaScript API v2 is deprecated and will be turned off on May 26, 2021.

    That's pretty soon :(

     
    • Tomasz Babczyński

      it was duplicate of the next post...

       

      Last edit: Tomasz Babczyński 2021-04-16
  • Tomasz Babczyński

    It is sad to hear this, it is really soon. But now, the grayed out map with watermark "for development purposes only" is not because the API is obsoleted but that it is not connected to a card. We, at (https://mapa.ump.waw.pl), have the same problem. The service was connected to a private card but after some months appeared that the amount of the free data is not so big as we thought and that the card is charged. Then it was disconnected and the result is ready to admire in the page cited above (if you turn on any from google layers).

    About the API - we should upgrade phpgedview to API v.3. I know that @canajun2eh doesn't like this part of pgv and will not do it ;) I will try to upgrade it but not now, it may take a long time.

     
  • Gerry Kroll

    Gerry Kroll - 2021-04-15

    Tomasz:
    You're right about my not liking anything having to do with Google. They used to be quite nice to work with, but have become far too money-hungry. What's worse is that your query history is no longer private -- they use the information for all sorts of money-grabbing purposes.

    I wonder how long it will be before Google Charts stop working for free?

    If you want to take on the project of updating Google Maps, that would be greatly appreciated.

    You mention that the $200 "free" amount is not enough. Try turning off AutoComplete. If you check Google's pricing formula, you will see that Autocomplete is VERY expensive.

     
  • Tomasz Babczyński

    Hi Gerry,
    I'm happy user of old (legacy?) api key for google map service. It still works without any card. How long else, I don't know... Generally I like google tools but not their policy.

    I think about an alternative to google maps. I'd prefer UMP (I participate in making it) but it is mainly Polish map and has not handy API. Maybe OSM, although they are rivals of us?

    BTW. I believe that goggle maps will be free, otherwise they would be less attractive to advertisers. But the APIs can become commercial sooner than we can suppose.

     
  • GaryT

    GaryT - 2021-04-16

    @Tomasz - No, I don't think the issue is the card for me. I've just signed up, and added a card. There were suggestions on the Google page that new API keys don't work with V2 either.

    The idea of another map source is a good one. I'm familiar with UMP, but I don't think the mapping is worldwide enough. OSM is a good suggestion, but I think the issue there is finding a server.

    I was thinking about doing a local test of a V2->V3 conversion. My skills aren't great, but I can make a start. Would it make sense to set up a fork so we can work on it collaboratively?

     
  • Gerry Kroll

    Gerry Kroll - 2021-04-16

    I'll be happy to post whatever you guys come up with in the SVN repository. As I've said in the past, and continue to say, I have no use for Google Maps, so won't participate in the development process.

    There's no need to start a fork.

    Just let me know when you have something that's worth posting into the SVN repository.

     
  • Tomasz Babczyński

    @Gary
    1. new API keys issue is a very likely reason
    2. UMP definitely is not Worldwide, even not Europewide, it is a Polish map. More, the main purpose of the project is navigation, not presentation. Although my heart and hands are with this project, I must to say that OSM is a better candidate.
    3. There are publicly available OSM servers. We needn't to install one more and it is easy to find at least one working.
    4. Main problem with migrating API in PGV it that the code is not clean. There are some code duplicates, sometimes incompatible one with the other. On the other hand, probably it is good reason to make refactoring before or during the migration.
    5. fork? It is not git but svn ;) When you are ready to start coding (I'm not ready this month) we can make a private git (where branches and merges are lighter then in svn) clone of the project and prepare patch at side. Just let me know, when.
    6. @canajun2eh - first we will make great disorder in the module. You don't want it to have in the production code. The beautiful patch will appear at the very end. C:

     
  • GaryT

    GaryT - 2021-04-17

    I'm an idiot. I think I downloaded the Googlemap module from 4.2 rather than 4.3...

     
  • Gerry Kroll

    Gerry Kroll - 2021-04-17

    Hmmm, .....

    Perhaps you should consider replacing your PhpGedView installation with the latest-and-greatest "SVN" version. That way, you can be sure that you have the correct Googlemaps module. Also, you can then be sure that PhpGedView is compatible with all versions of PHP from 5.3 right through to 8.1.

    https://sourceforge.net/p/phpgedview/svn/HEAD/tree/trunk/phpGedView/
    Click on the "Download Snapshot" link.

    If you need help in doing the upgrade, please let us know. There have been lots of "how to" posts.

     
  • Tomasz Babczyński

    Hay, @Gary and @canajun2eh, wait! Yet we have support to google maps api v3 since 7143 revision from 22.10.2016.
    But still the code needs to be refactorized and still support to alternative map service is welcomed.
    I have it on the list...

     
  • Gerry Kroll

    Gerry Kroll - 2021-04-17

    Tomasz:
    Yes, you are correct. You were instrumental in updating GoogleMaps. A simple check of the changelog .txt file confirms this.

    I agree that the code in PhpGedView needs to be cleaned up. As you have pointed out on several occasions, there is a lot of dead and redundant code in PhpGedView. Also, much of the programming is "amateur". Definitely NOT what I would ordinarily accept.

    It works (sort of), so I hesitate to change anything. However, if you want to take on this not-very-rewarding project, please go ahead.

     
  • jacky chen

    jacky chen - 2023-09-23

    The message you've encountered in your browser console log indicates that the Google Maps JavaScript API version 2 is deprecated and was scheduled to be turned off on May 26, 2021. This means that the functionality and support for this particular version of the API have been discontinued since that date.

    If you're using Google Maps in your project and you're still relying on version 2 of the JavaScript API, it's essential to update your code to use a more recent and supported version of the Google Maps API. Version 2 was deprecated for various reasons, including security updates, new features, and improved performance in newer versions.

    To address this issue and avoid a greyed-out map, you should:

    Update to a Supported Version: Visit the Google Maps JavaScript API documentation to identify the latest supported version. Ensure that your code is configured to use the most recent version of the API.

    API Key: Make sure you have a valid API key for the updated version of the Google Maps API. You may need to create a new API key if you haven't already.

    Code Migration: Review and update your code to be compatible with the new version of the API. Google's documentation will provide guidance on the changes and improvements made in each version.

    Testing: After making the necessary updates, thoroughly test your application to ensure that the Google Maps functionality works as expected with the new version of the API.

    By addressing these steps, you should be able to resolve the issue and continue using Google Maps in your project without any problems related to the deprecated version 2 of the Google Maps JavaScript API.

     
  • David Smart

    David Smart - 2024-04-07

    Has there been any recent work on this? I see some new messages in the console about the next api change events. And for me, the main menu Charts | Pedigree Map still works fine, as it does on the Options for an individual - Pedigree Map. But from the "Personal Facts and Details" ... "Map" menu, then it gets a google "Oops, Something went wrong..."

    If I had a better handle on how this works, I'd see if I could help sort it out, but at the moment I think I'm at the mercy of others.

    I'm on the latest version, having updated earlier today. This problem, I suspect, comes from google.

    Here's the full console window if I refresh an individual to the Map view. Oh, and a lot of the stuff below is also there for the map views that work - plenty of API change recommendations.

    [Violation] Avoid using document.write().
    clearbox.js:371 [Violation] Parser was blocked due to document.write(<script>)
    (anonymous) @ clearbox.js:371
    js?key=<KeyWasHere>&language=en:224  This site overrides Array.from() with an implementation that doesn't support iterables, which could cause Google Maps JavaScript API v3 to not work correctly.
    cca @ js?key=<KeyWasHere>&language=en:224
    hca @ js?key=<KeyWasHere>&language=en:219
    google.maps.Load @ js?key=<KeyWasHere>&language=en:14
    (anonymous) @ js?key=<KeyWasHere>&language=en:391
    (anonymous) @ js?key=<KeyWasHere>&language=en:391
    js?key=<KeyWasHere>&language=en:219  Google Maps JavaScript API has been loaded directly without loading=async. This can result in suboptimal performance. For best-practice loading patterns please see https://goo.gle/js-api-loading
    hca @ js?key=<KeyWasHere>&language=en:219
    google.maps.Load @ js?key=<KeyWasHere>&language=en:14
    (anonymous) @ js?key=<KeyWasHere>&language=en:391
    (anonymous) @ js?key=<KeyWasHere>&language=en:391
    pgvGoogleMap.js:90 loadMap()
    js?key=<KeyWasHere>&language=en:167  As of February 21st, 2024, google.maps.Marker is deprecated. Please use google.maps.marker.AdvancedMarkerElement instead. At this time, google.maps.Marker is not scheduled to be discontinued, but google.maps.marker.AdvancedMarkerElement is recommended over google.maps.Marker. While google.maps.Marker will continue to receive bug fixes for any major regressions, existing bugs in google.maps.Marker will not be addressed. At least 12 months notice will be given before support is discontinued. Please see https://developers.google.com/maps/deprecations for additional details and https://developers.google.com/maps/documentation/javascript/advanced-markers/migration for the migration guide.
    _.Vl @ js?key=<KeyWasHere>&language=en:167
    window.SetMarkers @ VM15653:38
    processFunc @ individual.php?pid=i1:497
    XMLHttpRequest.send (async)
    tabswitch @ individual.php?pid=i1:535
    (anonymous) @ individual.php?pid=i1:792
    js?key=<KeyWasHere>&language=en:149  google.maps.event.addDomListener() is deprecated, use the standard
    addEventListener() method instead:
    https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener
    The feature will continue to work and there is no plan to decommission
    it.
    _.lk @ js?key=<KeyWasHere>&language=en:149
    _.Eq.addDomListener @ js?key=<KeyWasHere>&language=en:257
    m @ infobubble.js:4
    h @ infobubble.js:3
    window.SetMarkers @ VM15653:44
    processFunc @ individual.php?pid=i1:497
    XMLHttpRequest.send (async)
    tabswitch @ individual.php?pid=i1:535
    (anonymous) @ individual.php?pid=i1:792
    individual.php:1  Third-party cookie will be blocked. Learn more in the Issues tab.
    individual.php:1  Third-party cookie will be blocked. Learn more in the Issues tab.
    
     

    Last edit: David Smart 2024-04-07
    • Gerry Kroll

      Gerry Kroll - 2024-04-07
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> Hello, David:

      I don't understand how this works either, so I can't help.  Sorry, I only support the stuff I can understand.

      There hasn't been any recent work done on Google Maps.  The most recent updates were done on July 17, 2022; I don't know what they were supposed to resolve.  Before that, updates occurred in 2019 and 2016; again, no information.

      I wish Google would stop "fixing" things so that the old stuff, which used to work, no longer works.
      Regards,
      Gerry Kroll
      
      e-mail: gkroll@keldine.ca
      Phone:  +1 613 836-3970
      Mobile: +1 613 558-3990
      On 2024-04-06 21:01, David Smart wrote:
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">

      Has there been any recent work on this? I see some new messages in the console about the next api change events. And for me, the main menu Charts | Pedigree Map still works fine, as it does on the Options for an individual - Pedigree Map. But from the "Personal Facts and Details" ... "Map" menu, then it gets a google "Oops, Something went wrong..."

      If I had a better handle on how this works, I'd see if I could help sort it out, but at the moment I think I'm at the mercy of others.

      Here's the full console window if I refresh an individual to the Map view. Oh, and a lot of the stuff below is also there for the map views that work - plenty of API change recommendations.

      [Violation] Avoid using document.write().
      clearbox.js:371 [Violation] Parser was blocked due to document.write(<script>)
      (anonymous) @ clearbox.js:371
      js?key=<KeyWasHere>&language=en:224  This site overrides Array.from() with an implementation that doesn't support iterables, which could cause Google Maps JavaScript API v3 to not work correctly.
      cca @ js?key=<KeyWasHere>&language=en:224
      hca @ js?key=<KeyWasHere>&language=en:219
      google.maps.Load @ js?key=<KeyWasHere>&language=en:14
      (anonymous) @ js?key=<KeyWasHere>&language=en:391
      (anonymous) @ js?key=<KeyWasHere>&language=en:391
      js?key=<KeyWasHere>&language=en:219  Google Maps JavaScript API has been loaded directly without loading=async. This can result in suboptimal performance. For best-practice loading patterns please see https://goo.gle/js-api-loading
      hca @ js?key=<KeyWasHere>&language=en:219
      google.maps.Load @ js?key=<KeyWasHere>&language=en:14
      (anonymous) @ js?key=<KeyWasHere>&language=en:391
      (anonymous) @ js?key=<KeyWasHere>&language=en:391
      pgvGoogleMap.js:90 loadMap()
      js?key=<KeyWasHere>&language=en:167  As of February 21st, 2024, google.maps.Marker is deprecated. Please use google.maps.marker.AdvancedMarkerElement instead. At this time, google.maps.Marker is not scheduled to be discontinued, but google.maps.marker.AdvancedMarkerElement is recommended over google.maps.Marker. While google.maps.Marker will continue to receive bug fixes for any major regressions, existing bugs in google.maps.Marker will not be addressed. At least 12 months notice will be given before support is discontinued. Please see https://developers.google.com/maps/deprecations for additional details and https://developers.google.com/maps/documentation/javascript/advanced-markers/migration for the migration guide.
      _.Vl @ js?key=<KeyWasHere>&language=en:167
      window.SetMarkers @ VM15653:38
      processFunc @ individual.php?pid=i1:497
      XMLHttpRequest.send (async)
      tabswitch @ individual.php?pid=i1:535
      (anonymous) @ individual.php?pid=i1:792
      js?key=<KeyWasHere>&language=en:149  google.maps.event.addDomListener() is deprecated, use the standard
      addEventListener() method instead:
      https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener
      The feature will continue to work and there is no plan to decommission
      it.
      _.lk @ js?key=<KeyWasHere>&language=en:149
      _.Eq.addDomListener @ js?key=<KeyWasHere>&language=en:257
      m @ infobubble.js:4
      h @ infobubble.js:3
      window.SetMarkers @ VM15653:44
      processFunc @ individual.php?pid=i1:497
      XMLHttpRequest.send (async)
      tabswitch @ individual.php?pid=i1:535
      (anonymous) @ individual.php?pid=i1:792
      individual.php:1  Third-party cookie will be blocked. Learn more in the Issues tab.
      individual.php:1  Third-party cookie will be blocked. Learn more in the Issues tab.
      

      Googlemaps about to stop working?


      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/phpgedview/discussion/185165/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

      <link itemprop="url" href="https://sourceforge.net/p/phpgedview/discussion/185165/"> <meta itemprop="name" content="View">
      <meta itemprop="description" content="View">

       
      • David Smart

        David Smart - 2024-04-14

        I found even the messages in the console window were not helping me. Most of them came from deep in the google map apis and it wasn't able to show the call-stack (so perhaps an async thread). So, I was really struggling to see what caused it.

        This doesn't help me much (I don't know it well enough), but in "prototype.js", I commented out the following as a quick test - based on one of the console error messages.

        Array.from = $A;
        

        The personal map "sort of" showed up. For some people, the map seemed to work as expected. For others, only part of the map filled in. It did move the failure point to elsewhere in the javascript - still without the ability to see the thread of execution leading up to it.

        js?key=<key here>-…B9Ds&language=en:77 
         Uncaught Error: dnarr
            at js?key=<key here>-…&language=en:77:271
            at Nla (map.js:36:107)
            at map.js:76:260
            at _.F.Hz (js?key=<key here>-…language=en:335:934)
            at js?key=<key here>-…&language=en:46:314
        (anonymous) @   js?key=<key here>-…B9Ds&language=en:77
        Nla @   map.js:36
        (anonymous) @   map.js:76
        _.F.Hz  @   js?key=<key here>-…9Ds&language=en:335
        (anonymous) @   js?key=<key here>-…B9Ds&language=en:46
        setTimeout (async)      
        _.fg    @   js?key=<key here>-…9Ds&language=en:108
        _.F.start   @   js?key=<key here>-…9Ds&language=en:335
        _.$m    @   js?key=<key here>-…9Ds&language=en:181
        changed @   map.js:77
        Lk  @   js?key=<key here>-…9Ds&language=en:153
        _.Jk.bindTo @   js?key=<key here>-…9Ds&language=en:263
        zD.Fg   @   map.js:110
        (anonymous) @   js?key=AIza<key here>SyBIfMRq-…9Ds&language=en:209
        

        In case this helps anybody.

         
        • Tomasz Babczyński

          David,
          please check whether the file from the following link solves the issue. It is the newest available version of prototype.js file. It is actually file from 2015 but anyway newer than the file in PGV.
          https://ajax.googleapis.com/ajax/libs/prototype/1.7.3.0/prototype.js
          @canajun2eh - maybe this proposed bump to 1.7.3 version of prototype helps to solve or or at least workaround the issue until we change google map api to leaflet

           
          • David Smart

            David Smart - 2024-04-14

            v.1.7.3 as downloaded:
            * Main maps work
            * Personal map on the individual menu, "Oops, something went wrong"
            (If I comment that same line, then I get a blank box for the map)

             
            • Tomasz Babczyński

              Yes, after sending the message I've noticed the same. In both Firefox
              and Chrome. The better idea than removing the line is to change it to:
              Array.from = Array.from || $A
              for a case of legacy browser without Array.from implementation. Are
              there such browsers in wild?

               
            • Tomasz Babczyński

              Huh, the problem is more serious than it appeared. And I suppose, the leaflet will be affected as well. The problem is in prototype.js library. It is no longer developed and as one gay said "its successors successor is obsoleted now". If I commented out the script calling the library (in js/prototype.js.htm), the maps works again but probably the other things doesn't.
              To solve the problem, and maybe the others in the future, we should make the audit of the code, find the calls to prototype.js lib functions (also indirect from libs like behaviour, scriptaculous, etc., they all are obsoleted) and change them to up to date standards, e.g. jQuery, which is used already. Many of the features are incorporated directly in browsers now so probably the lib is not needed but it is to check.

               
  • GaryT

    GaryT - 2024-04-08

    I can have a look and see if I can at least reproduce.
    I did get a leaflet based 'version'/option sort-of working, if that would be of interest.
    It would be hopefully relatively easy (assuming I can remember what I did) to hack it into your system - less so to do a "proper" version that works out of the box. There's issues with bits of google maps specific code in odd places (presumably the refactoring that Tomasz referred to), and potentially a legal/moral issue of having 'googlemaps' hardcoded in as well. That would obviously be quite a bit of work for Gerry (and me) to sort out, if he was willing to help.

    (edit) I was probably the instigator of the 2022 changes. The timing sounds right.

     

    Last edit: GaryT 2024-04-08
    • David Smart

      David Smart - 2024-04-08

      I have a private project that uses google maps - in a far more primitive way. But I wasn't able to unravel in PhpGedView where the data is formed that is presented to google maps. If somebody has a good handle on that, and can point me to it, maybe I can also help out in some way. In my project, I tried to make it work with either google or bing maps, but I found bing couldn't handle the larger kml files I was producing and google could. I wasn't aware of other "open" map engines I could tap into.

      Do you see a way to get me enough insight into how it prepares the data for the map engine? (and maybe I just need to find an afternoon to study it in more detail).

       
    • Tomasz Babczyński

      @GaryT You have my hands. And my phpstorm. And my modest leaflet knowledge. But I refuse to migrate this part of code to anything before deep refactoring and moving all "mapping" code to one-and-the-only place.
      In my site now, the edit place page and places diagram page display grayed out maps while the personal 'map' card doesn't display map "oops, something went wrong...".

       

Log in to post a comment.