how to include googe maps api key in rd google map plugin - javascript

i am using RD Google Map plugin but i can't find the google api script
the page do not display the map and display this error and a gray area instead of map
js?sensor=false&libraries=geometry,places&v=3.7&_=1525804623037:40 Google Maps API error: MissingKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#missing-key-map-error
then i tried to add this script line to initialize the google maps
<script src="https://maps.googleapis.com/maps/api/js?key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" type="text/javascript"></script>
but this time the map did not display at all
with this error
js?sensor=false&libr…&_=1525804236821:96 You have included the Google Maps API multiple times on this page. This may cause unexpected errors.
if i include the script it says it is included multiple times and if i exclude it it says no key
please advice
thanks in advance

After more searching and digging i found the answer here
MissingKeyMapError when configuring Google Maps API
i tried the solution and find it helpful and the issue is solved

Related

angular google maps api key not getting passed

I am trying to use Angular google maps and I went through the quick setup supplied by angular google maps
.config(['$routeProvider','$locationProvider','uiGmapGoogleMapApiProvider,
function($routeProvider,$locationProvider,uiGmapGoogleMapApiProvider) {
// Other configurations
uiGmapGoogleMapApiProvider.configure({
key: ‘MY_GOOGLE_API_KEY’,
v: ‘3.17’,
libraries: 'weather,geometry,visualization'
});
}
]);
I setup an API key in Google API Console, but when I load the page i get an MissingKeyMapError.
Google Maps API error: MissingKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#missing-key-map-error
I have the Google Javascript API enabled in the API console. I am at a loss as to what I am doing wrong. Any help would be greatly appreciated.
I solved the issue. Turns out I was loading the Google Maps API v3 twice. I was loading it in the provider
uiGmapGoogleMapApi.then(function(maps) {});
and loading the script tag
<script src="https://maps.googleapis.com/maps/api/js"></script>
Once I removed the script tag, It worked!
Thanks for everyones help.
Make sure that you used a key parameter with a valid API key. Follow this link for the steps on how to get the proper API Key for your project.
Go to the Google API Console.
Create or select a project.
Click Continue to enable the API and any related services.
On the Credentials page, get a Browser key (and set the API Credentials). Note: If you have an existing Browser key, you may
use that key.
To prevent quota theft, secure your API key following these best practices.
(Optional) Enable billing. See Usage Limits
for more information.
But based from this thread, the problem was because of a stray script tag which was including the google maps api before using this library. You can also check this related SO question.
Hope this helps!

Google Maps API error: DeletedApiProjectMapError

I have to use google map. I use below google API script
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=MY_API_KEY"></script>
And i got below Error
Google Maps API error: DeletedApiProjectMapError https://developers.google.com/maps/documentation/javascript/error-messages#deleted-api-project-map-error
I created a New Project & New API key. But still this error came. Kindly help to solve this error.
Yo should go to https://console.developers.google.com and after create your API KEY, go to "Google Maps JavaScript API" and just ENABLE (by default is DISABLE)
You need to enable Maps JavaScript API for your website.
API link: https://console.developers.google.com/apis/library/maps-backend.googleapis.com?q=map
Based from this documentation, the DeletedApiProjectMapError means that your API project may have been deleted from the Google API Console. Please check the project for which you generated the API key that's included in JavaScript API loader.
Since you have already created a new API project and get a new key on the Google API Console, one workaround I found on this forum is to try deactivating all plugins to see if one of them is causing a conflict.
Check this related link. It states that:
I created new API keys in the first project for those maps again and deleted second project. The maps work partially now - without markers. It looks a little like manual blocking by someone on the Google maps side. Maybe someone is blocking access to Marker Manager .js file somewhere between my computer and a server where it is stored to ban my website.
Hope this helps!
I activate/enable more API Google Maps on https://console.developers.google.com and disappear this error.
You have deleted the project in google cloud platform of which you created an API.Regenrate Api by creating a new Project in google cloud platform.
There some answers saying the JavaScript API needs to be enabled as it is disabled by default. That seems to have changed. It was enabled by default in my account. It did not work anyway. I had to disable and reenable the API, then it worked.
Also it is to be noted that Google says it may take a couple of minutes upon creation until the API key works, that may also have been the thing.

Autosetting search terms when implementing google maps in website (javascript)

I'm using google maps to geolocate users on my website. After that I would need to find different services near them (I would like to have ability for webpage to input search term in google maps with geolocaion) Is this possible? and if it is how could I do it?
You can use following example for searching places.
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=500&type=restaurant&name=cruise&key=YOUR-API-KEY-GOES-HERE
You have to create project in google console using below link
https://console.developers.google.com
Then create browser key and that key is which you have to use in above url which mention.
Last thing you need to enable Google Places API Web Service from https://console.developers.google.com
See below link for more detailed document.
https://developers.google.com/places/web-service/search#PlaceSearchRequests
Let me know if any issue you faced.

Register new place google places via API

Is it possible to register new place in google place via google maps API?
I have searched on the documentation and found nothing. Some stackoverflow questions on this were getting no response.
Thank you for the help.
I don't think that it is possible to add a business place via the API. If you want to add a new place to Google Places, you will have to register it manually.
Here you can find a tutorial of how to add places to Google Maps.

Using Direction service in combination with Autocomplete service in Google Maps

I have trouble setting my little application which uses the Google maps API 3.
In detail: I want to use two features:
Direction service: In order to calculate the route between two points and
Autocomplete feature in the textboxes that hold the source and destination points.
I have figured out that those two, need different script includes from google:
Autocomplete
Direction Service
If I add both in my <head> section, I get this warning:
Warning: you have included the Google Maps API multiple times on this
page. This may cause unexpected errors.
How can I combine those two javascript functionalities?
When you take a look at both links to load the Google Maps API, you can see that they are very similar. What happens with the "libraries" parameter is that it loads additional scripts along with the default script. So basically what happens when you load both links, is that the default script is loaded twice and produces this error.
To combine the two, you just have to load only https://maps.googleapis.com/maps/api/js?sensor=false&libraries=places.

Categories

Resources