2016-07-13 29 views
0

Ich bin neu in Ionic App Entwicklung. Ich installierte Winkel Google Maps Bower mitAngular Google Maps Fehler: - Uncaught Fehler: Google Maps API nicht verfügbar

bower install angularjs-google-maps 

dann diesen ref Dateien in index.html hinzugefügt

<script src="lib/lodash/dist/lodash.js"></script> 
<!-- ionic/angularjs js --> 
<script src="cordova.js"></script> 
<script src="lib/ionic/js/ionic.bundle.js"></script> 
<script src="lib/angular-simple-logger/dist/angular-simple-logger.min.js"></script> 
<script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyB52Z0xUP6JEX9fjr1EEQvCWgo8W4DD5CY&extension=.js"></script> 

<script src="lib/angularjs-google-maps/dist/angularjs-google-maps.js"></script> 

schließlich die gm-Modul als eine Abhängigkeit zu Ihrem AngularJS App:

angular.module('taskerApp', ['ionic', 'taskerApp.controllers', 'taskerApp.services', 'pickadate', 'gm']) 

Es zeigt einen leeren Bildschirm und gibt diesen Fehler in der Konsole.

angularjs-google-maps.js:40 Uncaught Error: Google Maps API not available, please make sure the Google Maps library is loaded before the AngularJS Google Maps library is loaded 

Bitte helfen Sie mir, dies zu lösen.

Antwort

0

sich nach den docs:

Make sure to load the AngularJS library and the Google Maps API:

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js"></script> 
<script src="http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places"></script> 

Then load the AngularJS Google Maps library:

<script src="bower/angularjs-google-maps/dist/angularjs-google-maps.js"></script> 

Finally add the gm module as a dependency to your AngularJS app:

angular.module('yourApp', ['gm']); 

That's it! You can now start adding Google Maps directives to your markup.

Meine Vermutung ist, dass Sie die Dateien nicht in der richtigen Reihenfolge sind.

+0

Reihenfolge, wie Sie sehen, ist das gleiche wie hier gezeigt, aber es half mir als Kopie eingefügt " "das Problem, das den Fehler verursachte, fehlte" Bibliotheken = Orte "in URL – Charu