Skip Navigation

[Closed] Toolset Maps problem on admin Edit page.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 12 replies, has 3 voices.

Last updated by Christopher Amirian 2 years ago.

Assisted by: Christopher Amirian.

Author
Posts
#2476447

We have installed Toolset Maps and set up everything on our Google account as instructed. We have the maps displaying fine on the front end as shown here:

hidden link

The Map To Ride Start: bit on this page is working perfectly.

But on the Edit Page in the admin area, in the spot where we define the Address field and it is supposed to show the map, it instead says: "We could not connect to the Google Maps autocomplete service, but you can add an address manually."

I looked for previous tickets on this subject and found many, but none of them solved the problem for us. I see the following error in the browser console:

js?v=quarterly&language=en&libraries=geometry%2Cplaces%2Cvisualization&key=AIzaSyDo_fG7DXBOVvdhlrLa-PHREuFDpTklWhY&ver=6.0.2:101

This API key is not authorized to use this service or API. Places API error: ApiTargetBlockedMapError
hidden link

But in the Google API section, Places is enabled. So I'm not sure what to do here. Any assistance you can provide would be appreciated.

#2476987

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

Would you please check the items below beside the places in the Google API Console for the API Key that you use?

Make sure that the Maps JavaScript, Places, Geolocation, and Geocode APIs are all enabled.

See if it fixes the issue.

Thank you.

#2477267

Here's what is shown in our account:

-----------------------------------------------------------
Enabled APIs
Select an API to view details. Figures are for the last 30 days.

API
Requests
Errors
Avg latency (ms)
Directions API - - - Details
Distance Matrix API - - - Details
Geocoding API 6 2 67 Details
Geolocation API - - - Details
Maps Elevation API - - - Details
Maps Embed API - - - Details
Maps JavaScript API - - - Details
Maps SDK for Android - - - Details
Maps SDK for iOS - - - Details
Maps Static API - - - Details
Places API - - - Details
Roads API - - - Details
Street View Static API - - - Details
Time Zone API - - - Details
Rows per page:
50
1 – 14 of 14

-----------------------------------------------------------

The interesting thing is I never had to enable these this time. They were all enabled by default when we initially set up the API. I recall in the past we had to select the ones we needed. But I never saw an option for that this time. As far as I can tell, Places is enabled. So I'm not sure what to do here.

#2477363

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

From the list that you provided, it seems that all necessary APIs are enabled.

Would you please do a test?

Create a test page and use the Toolset Map block there and set it up and see if the issue is still there.

Finally, I'd appreciate it if you can give the login information of a staging version of your website so that we can do changes there with no issues. I want to see the error myself in the browser console.

Make sure that you set the next reply as private.

#2479143

Hi,

Thank you for sharing the admin access details. I couldn't see the map error on any of the edit pages on the staging website and the admin area of the live website seems to be IP restricted.

It seems the error is related to the fact that your website has two Map API keys set in the Toolset Maps settings.

As explained in the documentation, ( ref: https://toolset.com/course-lesson/creating-a-maps-api-key/#problems-with-displaying-markers-on-google-maps ), the second key (when entered) is used only for the server-side requests, so it is safe to set it without any restrictions:

"If Google Maps API key is restricted by domain, that may not work for users with multiple domains or subdomains. To solve this, you can enter a second API key for Google Maps, in the Toolset settings. When added, this second key is used exclusively for server-side requests. This means it is never exposed in HTML and does not need restrictions. If you want extra security, you can restrict it, but only by IP addresses, not by domains."

Also, please make sure that the Maps JavaScript, Places, Geolocation, and Geocode APIs are all enabled on both these keys and not on just one of them.

regards,
Waqar

#2480695

I deleted the second key in our Toolset Maps settings and on the Google account. I'm still getting the error on the admin page. I have Restrictions set to none on the first key.

When you're logged in on development.floridafreewheelers.com, at the top, hover on New and then click Ride in the dropdown. Scroll down to the Address field in the custom field group and you should see the error.

#2482069

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

I spent a lot of time to see what it might be the issue and all the research comes back to the Google API console and not Toolset code.

I found this solution:

https://stackoverflow.com/questions/61294093/google-maps-api-error-this-api-key-is-not-authorized-to-use-this-service-or-api

The Javascript error is exactly what is mentioned above so try that and see what will be the result.

Thank you.

#2483409

That's a good find. I have tried doing this. I believe I did it correctly. In the Google account I'm seeing:

-----------------------------------------------------------------------------------------

API Keys
Name
Creation date
Restrictions
Actions
Maps API Key Oct 14, 2022 4 APIs

-----------------------------------------------------------------------------------------

Then on the Edit API page it shows this:

-----------------------------------------------------------------------------------------

Application restrictions
An application restriction controls which websites, IP addresses, or applications can use your API key. You can set one application restriction per key.

**** - None
HTTP referrers (web sites)
IP addresses (web servers, cron jobs, etc.)
Android apps
iOS apps

API restrictions
API restrictions specify the enabled APIs that this key can call

Don't restrict key
This key can call any API

**** - Restrict key
4 APIs
Selected APIs:
Geocoding API
Geolocation API
Maps JavaScript API
Places API

-----------------------------------------------------------------------------------------

**** - means that is what is selected among the options. It looks like what's in the stackoverflow thread. I've waited much longer than 5 minutes and the error is persisting on our site. The only thing I didn't do is the step where it says 2. Restart the project. I don't know what that means or how to do it.

Note also that while I was trying to figure out this problem on my own, and being VERY confused by what was needed in the Google admin area, at one point it wanted me to set up Oauth consent. I tried to go through that process but it said verification was needed. It currently says

"Action Required
Comply with domain verification requirements
Ensure your application's domains have completed the Search Console verification process"

It has a link to Learn More about this, but the page that links sends me to doesn't seem to say anything about this specific action required. So I have no idea what to do with this. I think I'd be better off deleting this Oauth effort, but I'm not sure if that will cause something else to be wrong. Google seems to want to make things as difficult as possible to figure out and they have very limited help.

The page it leads me to is here:

hidden link

This might be what's causing the problem. If it isn't I have no idea what's wrong.

#2484511

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

To restart the project it means you need to restart the Google services:

hidden link

I honestly am not sure about the Oauth thing that you mentioned.

One other point is that please make sure that you do restrict the access of the API to the website you use. Because that is what needed and complete open one will not do the trick:

https://toolset.com/forums/topic/server-side-google-maps-api-key/

If the Google API gives you hard time you have a choice to use the Azure Maps:

https://toolset.com/course-lesson/creating-a-maps-api-key/

Thank you.

#2485045

I am so lost in Google's admin area. I clicked on the first link you provided. I got through step 4 of what they say to do, but then step 5 made no sense compared to what I was seeing on the resulting page. There was nothing to select and nothing to restart that I could see. Google's documentation is terrible to me and they don't seem to have any way to talk to a human to help you unless you do one of their paid accounts. They steer me to Stack Overflow, which I've used in research extensively before. So I signed up for an account there and can post there to see if anyone can help further with the Google side.

The most frustrating thing to this is I have Toolset Maps working fine on another site I'm working on. I have no idea why the setup here is so different and so much more difficult. It wasn't this hard doing this before. I notice that Google constantly changes their processes.

I have no idea why it wanted me to set up that Oauth thing, but I don't know how to get rid of that. It doesn't seem to have a way to delete it. Again, Google's admin area is utterly baffling.

As for the other support ticket you showed me about the restrictions, isn't that how I had it before? I had 2 keys before and one had restrictions but the other did not. Should I put it back the way I had it? I think I read something in another support thread here on Toolset that made me try that as one of the things I did before giving up on solving it myself and before starting this ticket.

I suppose I could just give up on this since it is displaying the map properly on the front end. This error seems like it is only effecting the admin page. But whenever I see red error messages, I just get determined to fix them.

#2485715

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

No need to change anything in the Toolset settings. You already have it setup correctly.

Unfortunately, this seems to be something coming on the other side from Google, and I doubt there is something that I can do here to help on the Toolset side.

I guess for now as you mentioned you can use the map as it shows on the front end.

Thanks.

#2486203

I have posted a new thread about this at Stack Overflow here:

https://stackoverflow.com/questions/74261384/error-coming-from-google-maps-in-use-with-toolset-maps

We'll see if anyone there provides a solution that works. I'll post it here if we find the fix so anyone experiencing the same problem and searching here will be able to find it.

#2486287

Christopher Amirian
Supporter

Languages: English (English )

Sure thanks.

The topic ‘[Closed] Toolset Maps problem on admin Edit page.’ is closed to new replies.