Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/430.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Google Maps API enableScrollWheelZoom()-为什么不能正确缩小?_Javascript_Html_Google Maps_Zooming - Fatal编程技术网

Javascript Google Maps API enableScrollWheelZoom()-为什么不能正确缩小?

Javascript Google Maps API enableScrollWheelZoom()-为什么不能正确缩小?,javascript,html,google-maps,zooming,Javascript,Html,Google Maps,Zooming,因此,我有一个问题,谷歌地图使用自定义瓷砖,但我已经设法将其简化为下面的例子 我已经添加了这条线 map.enableScrollWheelZoom(); 这给了我一个简单的HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/

因此,我有一个问题,谷歌地图使用自定义瓷砖,但我已经设法将其简化为下面的例子

我已经添加了这条线

map.enableScrollWheelZoom();
这给了我一个简单的HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"> 
  <head> 
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/> 
    <title>Google Maps JavaScript API Example: Controls</title> 
    <script src="http://maps.google.com/maps?file=api&amp;v=2" type="text/javascript"></script> 
    <script type="text/javascript"> 
    function initialize() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map_canvas"))
        map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
        map.enableScrollWheelZoom();
      }
    }
    </script> 
  </head> 
  <body onload="initialize()" onunload="GUnload()"> 
    <div id="map_canvas" style="width: 500px; height: 300px"></div> 
  </body> 
</html> 

GoogleMapsJavaScriptAPI示例:控件
函数初始化(){
if(GBrowserIsCompatible()){
VarMap=newGMAP2(document.getElementById(“map_canvas”))
赛特中心地图(新格拉特林(37.4419,-122.1419),13);
addControl(新的gsmallmappcontrol());
addControl(新的GMapTypeControl());
map.enableCrollWheelZoom();
}
}
在使用鼠标滚轮缩小到最大缩放级别(查看整个世界)之前,一切看起来都很好。大约有一半的时间,它会在最后一次出现之前停留在缩放级别。滚动显示两个缩放级别的地图分幅

我试过Chrome、IE8和FF3.6,它们的表现都一样

有什么想法吗



被当作臭虫养大的-

非常奇怪。我也能用他们的样本图重现这个bug:

启用连续缩放似乎可以解决这个问题

添加
map.enableContinuousZoom()
after
map.enableScrollWheelZoom()


祝你好运

谢谢-我会提交一个bug,看看他们怎么说。