new google.maps.Geocoder() returns empty object in google Javascript Map API - google-maps-api-3

I am trying to use the geocoder feature of google maps api and i have a strange issue.
I have already checked this as it was working for today, and suddenly stopped working right now.
Geocoding API is enabled
google api is loaded
other objects and constructors within the google object work for example new google.maps.Marker()
But new google.maps.Geocoder() returns empty object
I checked that Geocoding API is enabled
Then checked the quota and I did not notice any limit passing
Here I copied the api url in an empty html page and just loaded the api
then tried in console to create a new Geocoder object and you see that its empty.

Related

gmapsdistance - which API is needed? [duplicate]

I've started getting this error from a Google Maps widget within a CMS I use:
This API key is not authorized to use this service or API. Places API error: ApiTargetBlockedMapError
The error message provides a helpful link to this page, which includes the following text:
ApiTargetBlockedMapError Error
The Maps JavaScript API has not been authorized for the used API key.
Please check the API restrictions settings of your API key in the
Google Cloud Platform Console.
See API keys in the Google Cloud Platform Console. For more
information, see Using API Keys.
I know Google has tweaked this API in the past, so I went to the console and checked the permissions given for the key I am using. It includes these four permissions, include the Maps JavaScript API permission:
Geocoding API
Maps Embed API
Maps JavaScript API
Maps Static API
The only part not working is the address auto-complete. When I change to Don't Restrict Key mode so the key works with all services, it works fine. Any idea which service checkbox I might be missing? I'm wondering if Google is just displaying the wrong error.
Any ideas?
This is what I did. Updated.
Make sure you have enabled all the next Google Maps Services
If you have key restrictions, make sure you add the services like the next image..
Restart the project. It worked.
It turns out that Google has tweaked their permissions settings without updating the error. I had to give access to the Places API as well for the autocomplete to function.
I've submitted a PR to the CMS widget's documentation:
https://github.com/Frojd/wagtail-geo-widget/pull/59/files

How do i tell Openrefine to fetch some data trough the google and facebook API (Grel)

I have a list of around 500 foundations and companies and i need to fetch more data like address, description, lat long, email or phone number, from the google and FB APIs I have found something more or less like this, but it won't work in OpenRefine, i need some help please.
I think it is possible to do beacause there is an addon called spotlight for spreadsheets that is able to fetch Google URLs and Lat Long https://www.youtube.com/watch?v=Vj1v3QfyrgA&feature=youtu.be
https://maps.googleapis.com/maps/api/place/findplacefromtext/output?parameters/json?input=value&inputtype=textquery&fields=photos,formatted_address,name,rating,email,geometry&key=YOURKEY
I have created the FB and Google places and google staic map API already. I have tried different queries, but it won't work unless it is in GREL
value.parseJson().geonames[0].lng
value.parseJson().geonames[0].geonameId
value.parseJson().geonames[0].lat
From the error "This API project is not authorized to use this API" the first thing to check is that you have enabled the Places and/or Geocoding API in the Google Developer console, and you have setup an API Key and that it is showing as a credential for the Places API and/or the Geocoding API
Next step, take OpenRefine out of the equation and check you can get a simple API call working in your browser - using one of the Google Places API examples:
https://maps.googleapis.com/maps/api/place/findplacefromtext/json?input=Museum%20of%20Contemporary%20Art%20Australia&inputtype=textquery&fields=photos,formatted_address,name,rating,opening_hours,geometry&key=<INSERT YOUR API KEY HERE>
If that gives you the same error, you know the issue is not with OpenRefine.
If you are still having problems in OpenRefine make sure you are creating URLs in OpenRefine that are valid for the appropriate Google API based on the documentation for that API and that you are using the correct API key.

Analytics Reporting API v4 "viewId must be set" issue

We are using Analytics Reporting API v4 in our backend to process analytical data collected from our clients (apps & website). We are facing an issue that the reporting API requires a viewId parameter to be present in the request that queries analytical data, otherwise the request fails.
// create the ReportRequest object
ReportRequest request = new ReportRequest().setViewId("your-view-id-here")
.setDateRanges(Arrays.asList(dateRange))
.setDimensions(Arrays.asList(browser))
.setMetrics(Arrays.asList(sessions));
According to their documentation, the viewId parameter can be extracted from the Google Analytics Console, which is correct.
The problem we are facing is that our "Website" property in Google Analytics already has a view where we can extract the ID from under it's settings:
This is great and exactly what we need, but for the "iOS" and "Android" properties, there is no view and the button to create one is greyed out:
Is there any way to query the API without specifying a viewId or is there a way to create a view in the console that we are unaware of?
Could the issue be caused by the fact that we are using Firebase to collect our data in Android and iOS?

Google Maps V3 API: How can I get report of the use of the DIRECTIONS and GEOCODE APIS

I am using Google Maps API v3 in a Web.
And also I am using:
new google.maps.Geocoder(); (GEOCODING)
new google.maps.DirectionsService(); (DIRECTIONS for trace routes between 2 places)
Then I went to API Developers Console and create a KEY and I call the Google service in this way usin the key:
http://maps.google.es/maps/api/js?key='the-key-from-api-console'&sensor=true
The intent of this is to keep track of the use of apis to watch that I do not pass the limits of use.
In the API console Google reports me ok about the use of the javascript API v3 counting the number of visits, the number of loads of the maps even the URL of the pages that use the maps.
I can see that my use of this service does not exceed 25,000 requests / day
But i need reports of the use of GEOCODING and DIRECTIONS too and Google is not reporting me this info. In developers console I activated the Directions API, the Geocoding API and Google Maps JavaScript API v3. But I only get reports of Maps JavaScript API v3.
Report of Directions API and the Geocoding API stay always at 0%. It is as if Google is not using this report.
Could it be that the service should be contracted to have this data or to be other types of APIS enable the console in order to have use of this report?
I've been trying to find information clarifying this for me but I found nothing that completely solved my doubt.
Thanks in advance.
When you use both services via the methods of the Javascript-API the limits apply to the user that visits the page with the map, the quota of your account is not affected(so there is nothing to count/report for your account/project)
It applies to your account only when you request the webservices(usually via serverside scripts).

How do I generate the Google Maps API AuthenticationService token value

I am attempting to create a test script which needs to emulate some calls to the Google Maps API, the first call being the AuthenticationService (so that I subsequently make some further calls). The request which needs to be made is:
https://maps.googleapis.com/maps/api/js/AuthenticationService.Authenticate?1shttps%3A%2F%2Fmyurlhere.net.au%2FOASIS%2FLocation.aspx&4sAIzaSyBzwCtz4eN5ZbnAsa_3qDFRoYP4vYSqB-c&5e1&callback=_xdc_._tl1sk9&token=10004
In the query string (at the end of the above URL) there is a token value that does not appear to be static and so the above doesn't work. In order to write my test script I need to work out how this value gets created and if there is any method call in the Maps API I can use to get this token.
This value must come from the Maps API somewhere. I've tried to look through the JavaScript but for some reason I'm unable to find this.
Is anyone familiar with the API that can point me in the right direction on this?
In the Google API console you must have a gmail email, in this link you have entered information
https://developers.google.com/coordinate/authentication#client-id

Resources