2016-07-13 3 views
0

私はIonicアプリ開発の新機能です。角度のあるGoogleマップのエラー: - キャッチコピーしていないエラー:Google Maps APIが利用できません

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

:私は、最後にあなたのAngularJSアプリへの依存関係としてGMモジュールを追加

<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> 

index.htmlの中でこれらの参照ファイルを追加亭

bower install angularjs-google-maps 

を使用して、角度Googleマップをインストール空白の画面が表示され、コンソールでこのエラーが発生しています。

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 

私はこれを解決してください。

答えて

0

ドキュメントを1として:私の推測では、あなたが正しい順序でファイルが含まれていないです

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.

+0

ここに示したものと同じですが、貼り付けたコピーとして役立ちます。 " "エラーの原因となった問題は、" libraries = places "in url – Charu

関連する問題