2016-09-07 17 views
0

我中存在的問題,同時使用谷歌地圖在我的.NET項目
爲什麼GoogleMap的,否則,不能顯示,並在我的.NET V計劃

<script src="http://maps.google.com/maps/api/js?v=3&libraries=places&sensor=true" type="text/javascript"></script> 

當我使用上面的代碼顯示來襲我正確地獲得谷歌地圖,但如果我嘗試添加關鍵

<script src="http://maps.google.com/maps/api/js?key=xxxx-&libraries=places&sensor=true" type="text/javascript"></script> 

地圖沒有顯示,也收到此錯誤

Uncaught TypeError: Cannot read property '__e3_' of undefined

我也試過

<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?key=xxxxxxxx_xxx---------&libraries=places"></script> 

但仍是不能正常工作。 任何暗示?

+0

先顯示您的代碼! – RajeeshMenoth

+0

@binoy顯示你的初始化和監聽器函數 – Webruster

+0

感謝你的意見我只是想知道它的原因 –

回答

4

如果您省略「v = 3」參數,則默認爲API的實驗版本(如果您有標準計劃帳戶)。似乎目前沒有顯示地圖的實驗版本存在問題。因此除了其他參數之外,還要添加「v = 3」參數。

<script src="http://maps.google.com/maps/api/js?v=3&key=<YourAPIKey>&libraries=places&sensor=true" type="text/javascript"></script> 
相關問題