angular-ui / angular-google-maps

AngularJS directives for the Google Maps Javascript API
http://angular-ui.github.io/angular-google-maps
2.52k stars 1.07k forks source link

Google Maps API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys #1887

Open rajlara opened 8 years ago

rajlara commented 8 years ago

This is my issues shows in my console: "i hve the api key also"

Google Maps API error: RefererNotAllowedMapError https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error Your site URL to be authorized: http://countryriders.club/staging/route-detail/view?id=1 http://maps.googleapis.com/maps/api/js?sensor=false&key=AIzaSyB_W2805xDjvqm2fxrq_eaahbFjdGZGaUU Line 32

magikfingerz commented 8 years ago

I solved this error using the API key in the script src:

script src='//maps.googleapis.com/maps/api/js?key=Your-API-Key'

funkflute commented 8 years ago

You can add the key in the provider config:

var app = angular.module('YourApp',['uiGmapgoogle-maps']);
app.config([
    'uiGmapGoogleMapApiProvider',
    function(uiGmapGoogleMapApiProvider) {
        uiGmapGoogleMapApiProvider.configure({
            key      : 'YOUR_KEY_HERE',
            v        : '3.18',
            libraries: 'places,geometry'
        });
    }
]);
ryuker16 commented 8 years ago

Check your console logs. If your getting an error about ._includes, you need to lower your lodash version to 3.8.0 or lower. Until i did that, setting the api key via .config did not work.