2016-06-14 9 views
0

私は流星プロジェクト内にGoogleマップの初期化の作業コードを入れようとしており、Unexpected token <initMap is not a functionという2つのエラーが発生しています。 htmlファイルのコードは、私は以下与えている:Googleマップapi 3: "予期しないトークン<"のエラーを解決するには?

<head> 
    <title>simple</title> 
</head> 

<body> 
    <h1>Welcome to Meteor!</h1> 

    {{> hello}} 
    {{> info}} 
    <script src="main.js"></script> 
    <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBNRzOGCsGk5u0VHjDOh_4QyJf4K-Hz5Bw&signed_in=true&libraries=places&callback=initMap" 
    async defer></script> 
</body> 

<template name="hello"> 
    <button>Click Me</button> 
    <p>You've pressed the button {{counter}} times.</p> 
</template> 

<template name="info"> 
    <h2>Learn Meteor!</h2> 
    <ul> 
    <li><a href="https://www.meteor.com/try">Do the Tutorial</a></li> 
    <li><a href="http://guide.meteor.com">Follow the Guide</a></li> 
    <li><a href="https://docs.meteor.com">Read the Docs</a></li> 
    <li><a href="https://forums.meteor.com">Discussions</a></li> 
    </ul> 
</template> 
+0

'予期しないトークン<'どこですか?どのファイルのどの行ですか? 'main.js? 'にありますか?デバッガはあなたに –

答えて

1

使用アプリケーションにマップを統合するのに役立ちます利用可能なパッケージがあります。

main.jsを追加する必要はありません。流星がそれに気をつけます。

このサンプルも見ることができますexample

0

あなたは流星アプリケーションでそのようgoogle maps APIを追加することはできません。あなたはドキュメント dburles:google-maps

atmospherejsから、このパッケージがうまく説明されて

dburles:google-maps