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 :(
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@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:
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
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...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
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.
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.
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.
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@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...".
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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:
That's pretty soon :(
it was duplicate of the next post...
Last edit: Tomasz Babczyński 2021-04-16
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.
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.
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.
@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?
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.
@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:
I'm an idiot. I think I downloaded the Googlemap module from 4.2 rather than 4.3...
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.
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...
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.
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.
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.
Last edit: David Smart 2024-04-07
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.
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.
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.
In case this helps anybody.
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
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)
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?
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.
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
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).
@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...".