Search code examples
angularjsgoogle-mapsng-map

Ng-map (angular map) is not working now


Previuosly when I use ng-map it was working fine but now its not working, I get blank map. I am getting this error from google map api:

The Google Maps JavaScript API must be downloaded directly from Google's servers. Learn more: https://developers.google.com/maps/documentation/javascript/tutorial#Loading_the_Maps_API


Solution

  • you should be downloading the google maps JS from google's servers, as stated in ng-maps' DOCS

    Include Google maps:

    <script src="http://maps.google.com/maps/api/js"></script>
    

    Name your angular app ngMap, or add it as a dependency

    var myApp = angular.module('myApp', ['ngMap']);