拖动时,Google地图不会更新切片

sev*_*ves 27 javascript google-maps google-maps-api-3

我必须在webview中使用谷歌地图javascript api.问题是,在拖动地图时,不会加载丢失的图块.在我桌面电脑上的浏览器中,我无法获得相同的行为,但在拖动地图时加载图块.在图片中我拿着地图,直到我松开手指才发生任何事情.

拖动并按住

我在gmaps bugtracker中发现了一个问题(不完全适合我的问题,但有点接近)并尝试了所有提到的解决方案:https://code.google.com/p/gmaps-api-issues/issues/detail? id = 1448

这是我到目前为止所尝试的:

// Setting the maps div container to a fixed size
#map-canvas {
    height: 600px;
    width: 600px;
}

// Emit resize trigger on mouse move
$(document).ready(function () {
    $("#map-canvas").mousemove(function (event) {
        setTimeout(function () { 
            google.maps.event.trigger(map,'resize');
            map.setZoom(map.getZoom());
        }, 100);
    });
});

// loading Google Maps API after document has been loaded
function loadScript() {
  var script = document.createElement('script');
  script.type = 'text/javascript';
  script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&' +
      'callback=initialize';
  document.body.appendChild(script);
}
window.onload = loadScript;
Run Code Online (Sandbox Code Playgroud)

代码正常工作,mousemove事件被触发.我在我的nexus 10设备上使用android:minSdkVersion ="19".

Ale*_*lan 1

您是否可以缓冲更大的地图,并仅在视口中显示一部分?EG 将地图加载到 600x600 的 div 中的 1200x1200 div 中,并使用溢出:隐藏?