html - 谷歌地图无法正确移动 map

标签 html css google-maps google-maps-api-3

这是一个jfiddle http://jsfiddle.net/w8NRr/

问题是当我尝试移动 map 时(请在里面查看), map 移动然后自动回到它的位置, map 不适合空间,

除了宽度和高度,我没有 map 的 css

你能帮忙吗?

map 在 jfiddle 中最后一个 Next 按钮上

编辑

map 的代码很简单,如果你不知道,请告诉我,告诉你

最佳答案

删除脚本:

            <script>
            function initialize() {
                var map_canvas = document.getElementById('map_canvas');
                var map_options = {
                    center: new google.maps.LatLng(44.5403, -78.5463),
                    zoom: 8,
                    mapTypeId: google.maps.MapTypeId.ROADMAP
                }
                var map = new google.maps.Map(map_canvas, map_options);
            }
            google.maps.event.addDomListener(window, 'load', initialize);
        </script>

$(".next").click(function () {

添加

if ($('fieldset').index($(this).parents('fieldset'))==2){
      var map_canvas = document.getElementById('map_canvas');
      var map_options = {
      center: new google.maps.LatLng(44.5403, -78.5463),
      zoom: 8,
      mapTypeId: google.maps.MapTypeId.ROADMAP
      }
      var map = new google.maps.Map(map_canvas, map_options);
}  

工作示例:http://jsfiddle.net/w8NRr/2/

关于html - 谷歌地图无法正确移动 map ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24223439/

相关文章:

html - 如何使用div模拟这个表?

javascript - Canvas 在 IoS 移动设备上无法正常工作

html - 使用 display flex 时不显示按钮文本(仅在 IE 中)

swift - ios swift 中谷歌地图上的侧面自定义形状的四个方形 field

html - 设置 HTML5 Canvas 的高度和宽度并使内容在比例尺内

html - z-index 和转换问题

html - 悬停时列表项不变

javascript - Google+ signinCallback 调用了两次并且在处理过程中丢失了 authresult

javascript - 谷歌地图未捕获范围错误: Maximum call stack size exceeded main. js.27

javascript - Angular 2 : Multiple included error