Join our new community forum for support & discussion
Join NowHome › Support › Extensions › Geolocation › HivePress Geolocation
HivePress Geolocation
-
AuthorPosts
-
gc2k 1 year, 4 months ago
Hi I am trying to setup Geolocation on my site. I have installed every relevant extensions to the site but get something weird when I try to type in a location to use to create listing or to search by location. The Google Maps API Key has been placed under integrations. When I click and start typing to inter a location the box turns gray with a little black circle with an exclamation point on the upper left of the box.
This means that there’s an error on the Google Maps API side, please make sure that all the API settings are correct (for example, Places, Geocoding and Maps APIs should be enabled for this API key). You can also send a link to your site and I’ll check this issue (usually Google displays the full error text in the browser console).
lightningrealwp 1 year, 4 months agoHello,
I’m also having issues setting up HivePress Geolocation. I entered my Google API key – but on the front end, if the user clicks the address, Google searches on a comma, only. This happens regardless of whether there is actually a comma in the address (Los Angeles, CA or Los Angeles CA).The listing address link looks like this:
https://www.google.com/maps/search/?api=1&query=,
When Google Maps opens, the link looks like this:
https://www.google.com/maps/search/,/@27.8134784,-82.6999516,15z
On the backend, when I click on the address, I see a drop-down message that says: “Google – This page can’t load Google Maps correctly. Do you own this website? – OK”
I tried to check on the API key on Google and it matches what I entered – but I don’t know what to look for on the Google Developer site.
What could I be missing?
Your help is much appreciated.
Please send a link to your site and I’ll check the detailed error message in the browser console, usually Google displays all the details there.
lightningrealwp 1 year, 4 months agoThis error is logged:
This API project is not authorized to use this API. Places API error: ApiNotActivatedMapError https://developers.google.com/maps/documentation/javascript/error-messages#api-not-activated-map-error
Please make sure that Places API is enabled for this key.
lightningrealwp 1 year, 4 months agoHi Ihor,
Per the directions, I enabled Places API.
I then tried to map one of my sample listings on my site, but the query is the same as I described before (searches for a comma “,” and cannot find any results).
I went back to the Google Console and enabled the rest of the APIs, such as Geolocation, Elevation, and Time Zone, just to be sure I was not leaving anything out. Then I cleared the cache on the browser and tried another search.
The result is the same – It searches for a comma and can’t find anything.
https://www.google.com/maps/search/,/@27.8134784,-82.6999516,15z
Questions:
The site was originally built on a different CMS and host. I have recreated the site in WP on a new host, but using the same URL. Do I need to generate all new keys for this new version of the site?
I also see a notice “Remember to configure the OAuth consent screen with information about your application. ” I don’t know what to do with this. Do I need to configure OAuth consent screen, and if so, what is my “application”?
Any assistance to get this working is much appreciated.
lightningrealwp 1 year, 4 months agoHi again – I think I went down the wrong path for OAuth. It seemed to be asking me for all sorts of verification information, and would only let me create an “external” test version, and then said i needed to provide a youtube video of how user data was going to be used, and then they would approve or deny the OAuth.
I am hoping that by following their path that I have not permanently blocked my ability to use maps on my site.
Do I need all this OAuth verification just to use their mapping tool?
No, OAuth is not required. Please follow the same steps as in this tutorial, without any extra settings https://hivepress.io/blog/how-to-add-location-search-to-directory-website/ If you enable the suggested 3 APIs and the API key is restricted to the correct URL (yoursite.com/*) then it should be ok.
It seems that you site URL is not allowed for this key, Google shows this error:
Google Maps JavaScript API error: RefererNotAllowedMapError https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error Your site URL to be authorized: https://reallightning.com/
You can try adding this value to the allowed referrers (with the asterisk):
https://reallightning.com/*
lightningrealwp 1 year, 4 months agoHi Ihor,
Thanks for these instructions.
Regarding the API keys, I am not sure which ones to use. I have now enabled:
Geocoding API
Maps Javascript API
Places APIIn the Credentials area, I chose 3 APIs for the API restrictions, same as above.
Google console’s example for the allowed referrers does not include the HTTPS:// part of the URL, so I entered it this way: reallightning.com/* I also entered a second referrer as https://reallightning.com/* as you suggested.
Problem still occurs – the mapping is still searching on just a comma “,” instead of the address in the listing.
2 Questions:
1. How are you accessing the error message you mentioned? Also, is the Google Maps JavaScript API error on the home page, or are you looking at an individual listing page?
2. In Chrome, in the Developer Tools Console, I am getting 6 mixed content warnings on my home page. On my Siteground hosting, I have HTTPS Enforce turned on. Should I be concerned about the mixed content?
Your help is appreciated!
1. I checked again and it works now, please try to re-enter the location for some listing (select it from the auto-suggest list).
2. Yes, I recommend fixing the mixed content issues, maybe there are some images left with “http://” in the page content?
I checked these errors in the Developer Tools Console.lightningrealwp 1 year, 4 months agoHi Ihor,
Thanks for your help!
1. Your instructions worked. All I needed to do was go to each listing (while logged in as the listing owner) and then I selected the address from the drop-down that appeared when I hovered on the address, then saved the listing.
2. My hosting provider offers a tool to fix mixed content, and I ran that function on my site. The Developer Tools Console does not show any more mixed content warnings.
Again, thanks for your patience!
No worries, I’m glad I could help 🙂
-
AuthorPosts
New Reply
This forum has been archived and is no longer accepting new posts or replies. Please join our new community forum for support & discussion.