2014-02-09 49 views
0

我試圖使用Geocomplete庫(http://ubilabs.github.io/geocomplete/)來填充地圖,但我沒有得到正確的選項。當我使用下面的代碼時,函數會繪製地圖,但只有混合「mapOption」有效。縮放設置爲默認 - 不是我改變它。有任何想法嗎?Jquery Geocomplete選項不起作用

$(document).ready(function(){ 
    $("#street-address-id").geocomplete({ 
     map: "#map_canvas", 
     mapOptions: { 
      zoom: 18, 
      mapTypeId: "hybrid" 

     } 
    }) 

}); 

回答

2

變化jquery.geocomplete.js

var defaults = { 
    bounds: true, 
    country: null, 
    map: false, 
    details: false, 
    detailsAttribute: "name", 
    location: false, 

    mapOptions: { 
     zoom: 14,//Change Here 
     scrollwheel: false, 
     mapTypeId: "roadmap" 
    }, 

    markerOptions: { 
     draggable: false 
    }, 

    maxZoom: 16,//Change Here 
    types: ['geocode'], 
    blur: false 
    };