-1

I have an inherited site using Umbraco cms and angularjs. I am getting an issue with a google map component, the call looks like:

        assetsService.loadJs('https://www.google.com/jsapi?key=mykey')
        .then(function () {
            google.load('maps', '3',
                        {
                            callback: initMap,
                            other_params: 'libraries=places&sensor=false'
                        });
        });

mykey obviously is not my actual key, the actual key is an unrestricted one that I have created. I still get NoApiKeys error.

Is it because the URL I am calling is no longer supported?

Ismail
  • 923
  • 2
  • 12
  • 29
  • 1
    Check network activity tab in your browser. What calls to Google Maps APIs you can see there? It looks like you might load an API twice. First time via `loadJs()` function with API key, second time via `google.load()` without API key. Try to use `other_params: 'libraries=places&key=YOUR_API_KEY'` in second call. – xomena May 16 '19 at 17:44
  • ok putting the key in the load call has fixed the issue, many thanks for this. – Ismail May 17 '19 at 10:24

1 Answers1

1

from xomena's comment i have added the key to load call:

assetsService.loadJs('https://www.google.com/jsapi')
    .then(function () {
        google.load('maps', '3',
                    {
                        callback: initMap,
                        other_params: 'libraries=places&sensor=false&key=mykey'
                    });
    });

all works fine now

Ismail
  • 923
  • 2
  • 12
  • 29