2011-10-11 47 views
1

我在我的網站上使用谷歌地圖。它在所有瀏覽器中都能很好地工作,但我在移動設備上使用它時遇到問題:我無法滾動地圖。我懷疑它是由eventListener「點擊」引起的,可能是這種情況?我將標記放置在用戶點擊的地方。
下面是代碼:谷歌地圖:不能在手機上滾動

<script src="http://maps.google.com/maps/api/js?sensor=false&language=${Locale.getDefault()}" type="text/javascript"></script> 

$(document).ready(function(){ 
    createMap(); 
}); 


function createMap(){ 

    geocoder = new google.maps.Geocoder(); 
    infowindow = new google.maps.InfoWindow(); 
    latlng = new google.maps.LatLng(55.783234,12.518363); 
    var myOptions = { 
    zoom: 7, 
    center: latlng, 
    mapTypeId: google.maps.MapTypeId.ROADMAP 
    }; 
    map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); 
    marker = new google.maps.Marker(); 
    google.maps.event.addListener(map, 'click', function(event) { 
    makeMarker(event.latLng, true); 
    }); 
} 

回答

1

事實證明,它不是使用谷歌地圖在移動設備上一個非常好的主意。