Jump to content
TNG Community
mkmcgold

Google Maps quit working

Recommended Posts

mkmcgold

About a year ago I activated a Google map key. I enabled Geocoding API, Maps JavaScript API and Places API. I have set up billing. The maps were working until not long ago,  it may have been when I upgraded to Ver.13 but I am not sure.  Geocoding does work.  If I attempt to edit a place manually, the map there is blank.  I have checked and double checked on the Google Cloud Platform and everything looks correct (although I admit most of it is Greek to me!)

I tried setting up a new site from scratch - same problem - so I deleted it. 

http://www.marypie.net 

 

Edited by theKiwi
Made link clickable

Share this post


Link to post
Share on other sites
theKiwi

Have you entered the Google Map Key in TNG Admin ------> Setup ------> Map Settings?

Looking at a page that should show a map, there is nothing in the source code to indicate you have a Map Key set in TNG.

There are also some other errors not related to maps showing too - at this page

http://www.marypie.net/placesearch.php?tree=mm&psearch=Anoka%2C+Anoka%2C+MN

there is no map, and there are the following errors:

image.png

so it seems you're missing some .gif files from the img directory for the first 3 errors

The next 2 failed to load resource I suspect are because you have no Map Key, and then the last error is caused by one or both of the previous 2

Roger

Share this post


Link to post
Share on other sites
mkmcgold

Thank you Kiwi, the first 3 errors I believe relate to the fact I haven't gotten around to replacing favicons on some of my media files, which I have done now to eliminate those errors.

 And I do have the Map Key, I've re-added and saved it a dozen times and geocoding works so that portion is at least recognized.

This caught my eye as it references maps, but I have no idea what it means.

I've add a new person, Guy Test, to eliminate your having to scroll around.

https://www.marypie.net/getperson.php?personID=I29651&tree=MM

error.jpg

Share this post


Link to post
Share on other sites
bhemph

In the header section of the HTML page, the Google maps api JavaScript is not being included.  So that is being disabled for the page header output in some way, which is why google is not defined.

Share this post


Link to post
Share on other sites
theKiwi

The errors I see now relating to maps are still the same

image.png

can't find the variable "google" because it's not loading the needed JavaScripts.

Given that your map key appears to be valid because geocoding works I'm at a loss to know what the problem might be - you could try uploading all the files from the js folder again and see if that changes anything.

Roger

Share this post


Link to post
Share on other sites
Ken Roy

Might be a dumb question, but is your API key setup to use Maps JavaScript API and Geocoding API

Google Maps - Gerring Started indicates that both are required.

Share this post


Link to post
Share on other sites
mkmcgold

bhemph

If I look at the page source of a working site and my non-working site I can see what you are talking about:  Everything is pretty much identical. 

Any ideas where one could fix this??? 

This is from a working site - I assume the bold text is what makes maps work

<link href="templates/template15/css/templatestyle.css?v=13.0" rel="stylesheet" type="text/css" />

<script src="https://code.jquery.com/jquery-3.4.1.min.js" type="text/javascript" integrity="sha384-vk5WoKIaW/vJyUAd9n/wmopsmNhiy+L2Z+SBxGYnUkunIxVxAv/UtMOhba/xskxh" crossorigin="anonymous"></script>

<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" type="text/javascript" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"></script>

<script type="text/javascript" src="js/net.js"></script>

This is from the non-working site - The bold stuff is what my site has.

<link href="templates/template15/css/templatestyle.css?v=13.0" rel="stylesheet" type="text/css" />

<script type="text/javascript">// <![CDATA[

window.jQuery || document.write("<script src='js/jquery-3.4.1.min.js?v=910'>\x3C/script>")

//]]></script>

<script type="text/javascript">// <![CDATA[

window.jQuery.ui || document.write("<script src='js/jquery-ui-1.12.1.min.js?v=910'>\x3C/script>")

//]]></script>

<script type="text/javascript" src="js/net.js"></script>

Share this post


Link to post
Share on other sites
Ken Roy

Actually, the following script is what makes Google Maps display

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?language=&amp;hl=en&amp;key=ken-deleted></script>

If I remember correctly, the Google Maps script is not added to the page, if

* no key exists

* no places are geocoded

Share this post


Link to post
Share on other sites
mkmcgold

Not sure I answered all the questions (thanks so much for trying to help) but:

  • Google Cloud Platform indicates Geocoding API, Maps JavaScript API and Places API are enabled and a credit card on file.
  • I have thousands of geocoded places and key is in place at website
  • I reloaded the JS folder to the non-working site.
  • The "failed to load resource" error shows on both sites 

I did a "View Page Source" on my non-working site and another that I manage that works. I can't help but think the problem is in the highlighted section/view but I haven't a clue how the html pages are made .maptrouble.docx

The site highlighted in yellow works, version 13.0, https://www.marypie.com/mlekodaybrant/getperson.php?personID=I23&amp;tree=JR

The site highlighted in green does not work,, version 13.0,  https://www.marypie.net/getperson.php?personID=I29651&amp;tree=MM

Again, geocoding works on both sites but maps do not show on just one of them.

 

Share this post


Link to post
Share on other sites
Ken Roy

Do you have 2 different API keys?   I am not sure that the .net domain can work with the .com domain key.  Sorry, I did not look at your word document.

Share this post


Link to post
Share on other sites
theKiwi
2 hours ago, Ken Roy said:

Do you have 2 different API keys?   I am not sure that the .net domain can work with the .com domain key.  Sorry, I did not look at your word document.

Yep - I'm pretty sure you'll need 2 API keys - one for the .com and one for the .net

Roger

Share this post


Link to post
Share on other sites
mkmcgold

Ken and Roger,

I don't think it is necessary to have a key for each. One of the parameters when setting up an API is listing the addresses that can call for it.  Right now I actually have it set up so that it is completely unrestricted (a little dangerous should someone get your key # but......I'm trying everything.)

However, for some reason I do have two keys when I go look at the Google platform, they are both activated, both funded etc.  I have tried using them in every conceivable combination to no avail.  Dot Com works with either Key #1 or Key #2.  Dot Net geocodes with either Key1 or Key2, regardless of what is on Dot Com.. 

They were both working for almost a year (with the same API) and for some reason dot.net just quit. 

Maybe I don't know how to read these things but when I look at the Page Source (previously inclueded),  the working one references google maps and the non-working one does not.  The error codes indicate that I (the web site) is not calling for the maps.

Thanks again!

 

Share this post


Link to post
Share on other sites
RickM

@mkmcgold,

I'm not sure if my suggestion will work, however I have my Maps API setup as per the image below. I did add the .net address to see if indeed you can.. It seems to be fine, I don't have a .net url to test it though.. It might be over kill but I don't have issues with Maps loading, and if I have subdomains (which I do) it works with them too.. If you choose to add the .net to one of your API keys then perhaps you should disable the other (after checking things work).

googleapis.jpg
 

Share this post


Link to post
Share on other sites
mkmcgold

Thanks Rick, the Google maps set up isn't exactly intuitive for non-experts. I'll give it a try!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×