Implementing A Website like Google Waypoints - html

Actually I am new in web development and doing work by search and reading tutorials. I am confused by google API and need some help.
I am using nodejs and need to show the google map in my view and show path of a vehicle on map. I have read https://developers.google.com/maps/documentation/javascript/examples/directions-waypoints#try-it-yourself and found the waypoints in direction is my solution.
According to the steps at https://developers.google.com/maps/documentation/directions/get-api-key#key
I have created a project, added libraries and also get api key from google.then to test my api key I made a html page just like a page which is defined here
And I got an error after loading map.It
Oops! Something went wrong.
This page didn't load Google Maps correctly. See the JavaScript
console for technical details.
And consol log said the url is not authorised so I added url to Domain Verification section at Credential of this link
but the error still appears.
I am sure there is a lot of info which I did not understand them but I need to know What's wrong on my work? Do I skip any step?

I found the solution to fix my problem! I did not enable javascript API and that caused error.
To enable JavaScript Api do this
Go to API Manager
Click on Dashboard
Click on Enable API with Plus button
Search for Google Maps JavaScript API and Click on that
You will find Enable button there. Click to enable API.

Related

Google Maps API for both localhost & production server, as of April 2019

TLDR
My code works fine on my laptop when accessed as file://<path>/index.html, but neither on my laptop with an Apache server running when accessed as http://<path>/index.html, nor on my real (production) server. I see no errors on the console, but the map is just a grey rectangle.
[Update] I moved to LeafletJS shortly after asking this question, and recommend others to do so too.
It has been a few years since I coded any Google Maps applications.
It seems that, as of last year, it is now necessary to have an API key, by providing it with credit card details, and to provide it with each API call.
Unfortunately, there is a lot of of information about this, much/most of it out of date and/or contradictory.
Can anyone point to the canonical guide, preferably with screenshots, of how to configure this?
I wish to draw a map, and add some makers, which will require reverse geocoding, such that I provide a street address and convert it to lat/long in order to place the markers.
Sounds simple enough, but which of the many thousands of "helpful" site has gotten it right?
For instance, what seems to be the current Google help page speaks of
From the Navigation menu, select APIs & Services > Credentials.
On the Credentials page, click Create credentials > API key
But I can't even see that menu option :-(
[Update] If it helps any, the error message in the developer console said :
Geocoding Service: You must use an API key to authenticate each request to Google Maps Platform APIs. For additional information, please refer to http://g.co/dev/maps-no-account For more information on authentication and Google Maps JavaScript API services please see: https://developers.google.com/maps/documentation/javascript/get-api-key
[Update] I am trying to access the API like this
<script src="maps.google.com/maps/api/…>
and
var url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' + comapnyLocation +'&key=XXXX';
$http.get(url)
[Update++] in the developer console, I see a bunch of errors along the lines of:
aliextension.com/wp-content/uploads/2017/08/JAR.png:1 GET https://aliextension.com/wp-content/uploads/2017/08/JAR.png net::ERR_CONNECTION_TIMED_OUT
I have no idea what aliextension is, nor does it appear in my code (maybe in some minified JS?)
Ok, it is something to do with AliExpress (Ali Baba). I removed it & the timeout messages go away, but I still have problems.
If I load the index.html into Chrome as a file://, then it works just fine. But, if I load it `as http://, where I have a Xampp Apache server running, the map box remains grey, although I see no error messages. The same thing happens on my real server :-(
This page should be your starting point:
https://developers.google.com/maps/documentation/javascript/tutorial
it helps you working with Google map javascript API.
To embedded a google map to your website read the overview page in the above link.
To add markers to your google map read this page:
https://developers.google.com/maps/documentation/javascript/adding-a-google-map
To do reverse geocoding read this page:
https://developers.google.com/maps/documentation/javascript/geocoding
That all i need to work with google map. I think you can do the same too.
The cause for this is quite likely an API key restriction.
In order to permit these host-names or IP addresses, you have to:
a) go to the credentials panel and select the according project, then click on "Api key".
b) there you can loosen the restrictions, for HTTP referrers (for web-sites)
... or for IP addresses (in case these are server-side requests).

Error GET Google Places API

Today, Google places API stopped working on my site. Yesterday, it was working just fine. When I call it, I get following error in developer's console:
GET https://maps.googleapis.com/maps/api/place/js/AutocompletionService.GetPredictions?1slux&4scs-CZ&9sgeocode&15e3&key=AIzaSyCe8-UQIQuXtaQ5xVOqtwnCtZOjDtXj4Co&callback=_xdc_._8rz5bv&token=109805 net::ERR_ABORTED
The problem isn't in Google maps API itself, because that works just fine (without the Places). If I take fresh code snipper from Google website, it is still not working, as you can see here. So the problem isn't in my code, but in the API itself. I checked my project on Google site and the API is enabled, so it should work. Maybe it's connected to my API key? I haven't tried creating a new one, I don't want to have too many of them.
SOLUTION: After approximately one hour (from posting this), it started working again. Apparently a problem on Google side. So if you have the same problem:
Go to your Google account and check in API manager if the Google Places API service is enabled.
If it is enabled, wait and be patient. Hopefully it will fix by itself.

Alert "This page was unable to display google maps element." javascript error "RefererDeniedMapError"

I'm getting this alert message in one of my sites that uses Google Maps JavaScript API v3:
"This page was unable to display google maps element. See the terms of service"
And in the javascript console this error:
"RefererDeniedMapError"
I searched in internet and its seems to be a new bug, I only found reports in this month (June 2015).
It seems to be a domain specific problem, because the same code works in others domains.
In my case the web page were working without an API key. After this error I generated and added an API key to my code, but it doesn't solve the problem.
In the https://console.developers.google.com/ doesn't appear any useful information. The quota of map loads is OK, but when I load the web page the map loads are not counted (probably because the error).
Does anyone has a clue about how to solve the problem?
I was getting the same error message, and realized I replaced with below one
<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
I was getting the same error message, and realized I needed to remove "signin=true" from the google maps call.

Google Drive sharing dialog blocked by x-frame-options, sameorigin

I can not get the Share dialog to work for the life of me. I created a test page here: https://super.neutrondrive.com/edit?view=test
What am I doing wrong that I keep getting blocked by xframe?
It looks like the problem was I needed to have the app installed on the user's Google Drive. When using the backend api this is pretty easy to do, but when using the JS API this is not readily apparent.

Google maps API v3 flash empty viewport

I'm using the google maps API v3 with flash and it works fine on one of my websites.
I transfered it to another website and changed the API key, but all I see is the default background color with no error message. Unfortunatly, I cannot access the flash source code.
Is there a way to debug the application or see some error messages without the source code?
Or maybe somebody has an idea of what is wrong?
Use Firebug Net monitor to see if all of the request are going through. That would be the first place that I would start. My guess is that there are HTTP Requests trying to get data from a domain that doesn't have a crossdomain policy allowing access from the new site you moved it to.
First of all maps V3 doesn't need a a key. I think you are combining parts of V2 (with key) and V3(which doesn't need key) so obviously there is something wrong in your code.