1

我试图在 Google Maps V3 中获得以下行为:

  1. 地图拖动已禁用,因此用户使用鼠标时地图中心不会丢失
  2. 启用地图缩放,因此可以使用滚轮鼠标根据客户需求调整地图细节

为此,我使用以下设置:

map = new google.maps.Map(document.getElementById('map_canvas'), {
        center : new google.maps.LatLng(41, 14),  
        zoom : 13,
        mapTypeId : google.maps.MapTypeId.TERRAIN,                      
        mapTypeControl: true,
        mapTypeControlOptions: {
            style: google.maps.MapTypeControlStyle.DROPDOWN_MENU        
            },
        draggable: false,
        scrollwheel: true,
        streetViewControl: true,
        fullscreenControl: true,
        scaleControl: true,
        rotateControl: true,
        overviewMapControl: true,
        overviewMapControlOptions: {opened: true},
        gestureHandling: 'greedy'
        });

但是不起作用,而如果我设置draggable:true,那么滚轮功能也将被启用。换句话说,它看起来像有 scrollwheel: true 我们还必须设置 draggable:true 否则该设置将被忽略。有什么线索吗?

4

0 回答 0