2012-10-15 51 views
0
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=.......&sensor=false&libraries=places"></script> 

我想將&libraries=geometry添加到上面的腳本中,如何描述它?在腳本源中添加變量Google Map API

<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=.......&sensor=false&libraries=places&libraries=geometry"></script> 

<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=.......&sensor=false&libraries[]=places&libraries[]=geometry"></script> 

回答

2

按照documentation,你應該給多個庫逗號分隔:

<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=.......&sensor=false&libraries=places,geometry"></script> 
0

你不能指定變量具有相同的名稱,後/獲取腳本將只處理其中一個 我建議你用'libraries = places,geometry'替換'libraries = places'& libraries = geometry'和看看這對你有用。

相關問題