<i id='RhToX'><tr id='RhToX'><dt id='RhToX'><q id='RhToX'><span id='RhToX'><b id='RhToX'><form id='RhToX'><ins id='RhToX'></ins><ul id='RhToX'></ul><sub id='RhToX'></sub></form><legend id='RhToX'></legend><bdo id='RhToX'><pre id='RhToX'><center id='RhToX'></center></pre></bdo></b><th id='RhToX'></th></span></q></dt></tr></i><div id='RhToX'><tfoot id='RhToX'></tfoot><dl id='RhToX'><fieldset id='RhToX'></fieldset></dl></div>
  • <tfoot id='RhToX'></tfoot>

      1. <small id='RhToX'></small><noframes id='RhToX'>

          <bdo id='RhToX'></bdo><ul id='RhToX'></ul>

        <legend id='RhToX'><style id='RhToX'><dir id='RhToX'><q id='RhToX'></q></dir></style></legend>

        谷歌地图模式问题

        Google map modal issue(谷歌地图模式问题)
          • <bdo id='UDpxA'></bdo><ul id='UDpxA'></ul>

              <small id='UDpxA'></small><noframes id='UDpxA'>

            1. <tfoot id='UDpxA'></tfoot>
                <legend id='UDpxA'><style id='UDpxA'><dir id='UDpxA'><q id='UDpxA'></q></dir></style></legend>
                  <tbody id='UDpxA'></tbody>
                <i id='UDpxA'><tr id='UDpxA'><dt id='UDpxA'><q id='UDpxA'><span id='UDpxA'><b id='UDpxA'><form id='UDpxA'><ins id='UDpxA'></ins><ul id='UDpxA'></ul><sub id='UDpxA'></sub></form><legend id='UDpxA'></legend><bdo id='UDpxA'><pre id='UDpxA'><center id='UDpxA'></center></pre></bdo></b><th id='UDpxA'></th></span></q></dt></tr></i><div id='UDpxA'><tfoot id='UDpxA'></tfoot><dl id='UDpxA'><fieldset id='UDpxA'></fieldset></dl></div>

                  本文介绍了谷歌地图模式问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试将谷歌地图显示到 Twitter 引导模式中.当用户第一次单击按钮 Show map 时,他能够成功地看到地图,因为我正在生成地图 onclick() 函数,但是当他关闭模式并重新打开时然后地图无法正确显示,地图的 90% 部分变为灰色,如下所示

                  I am trying to display google map into the Twitter bootstrap modal. When user first click on the button Show map then he is able to see the map successfuly as i am generating the map onclick() function but when he closes the modal and reopen it then the map doesnot show properly and 90% part of the map goes grey like following

                  我什至尝试了这种解决方法,删除绑定地图的整个 div 并重新生成它,但这个技巧不起作用,请告诉我如何解决我的问题.

                  I even try this workaround that remove that whole div in which the map is bind and regenerate it but that trick doesnot work too kindly let me know how can i resolve my issue.

                  以下是我调用显示地图的 onclick 事件的 js 函数

                  Following is my js function which i am calling onclick event of show map

                  function mapp()
                  {
                  
                  //google.maps.event.trigger(map, "resize");
                    //$("#map_google_canvas").empty();
                  $("#map_google_canvas").remove();
                  
                  $("#crmap").append("<div id='map_google_canvas'></div>")
                  
                  
                      var myOptions = {
                          center: new google.maps.LatLng(54, -2),
                          zoom: 6,
                          mapTypeId: google.maps.MapTypeId.ROADMAP
                      };
                  
                      var map = new google.maps.Map(document.getElementById("map_google_canvas"), myOptions);
                  
                          var addressArray = new Array("London, United Kingdom", "London Road, Brentwood, United Kingdom", "Brentwood, United Kingdom");
                  
                  
                      var geocoder = new google.maps.Geocoder();
                  
                      var markerBounds = new google.maps.LatLngBounds();
                  
                      for (var i = 0; i < addressArray.length; i++) {
                          geocoder.geocode({
                              'address': addressArray[i]
                          }, function (results, status) {
                              if (status == google.maps.GeocoderStatus.OK) {
                                  var marker = new google.maps.Marker({
                                      map: map,
                                      position: results[0].geometry.location
                                  });
                                  markerBounds.extend(results[0].geometry.location);
                                  map.fitBounds(markerBounds);
                              } else {
                                  alert("Geocode was not successful for the following reason: " + status);
                              }
                          });
                      }
                  
                  
                  }
                  

                  请帮助,

                  谢谢

                  推荐答案

                  我也遇到了同样的问题.但我发现模态显示事件存在问题.因为它不适用于某些版本的问题,所以我只是按照引导模式文档来实现它.

                  I had the same issue. but I found an issue with modal shown event. as its not working with some version of issue so I just follow the bootstrap modal documentation to achieve it.

                  Bootstrap Modal Map 问题解决方案:

                  Bootstrap Modal Map Issue Solution :

                  $(document).ready(function(){
                    $('#locationMap').on('shown.bs.modal', function(){
                      google.maps.event.trigger(map, 'resize');
                      map.setCenter(new google.maps.LatLng(-33.8688, 151.2195));
                    });
                  });
                  

                  最后这对我有用,它可以帮助某人.

                  Finally This works for me, It could help to someone.

                  这篇关于谷歌地图模式问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  What are valid deviceNames for Chrome emulation testing with Protractor?(使用 Protractor 进行 Chrome 模拟测试的有效设备名称是什么?)
                  Protractor Check if Element Does Not Exist(量角器检查元素是否不存在)
                  Protractor e2e Tests Login Redirection(Protractor e2e 测试登录重定向)
                  Explain about async/ await in Protractor(解释 Protractor 中的 async/await)
                  Protractor browser.wait doesn#39;t wait(量角器 browser.wait 不等待)
                  How to use Protractor with Angular 2?(如何在 Angular 2 中使用量角器?)

                      • <bdo id='qBWXY'></bdo><ul id='qBWXY'></ul>

                          <tfoot id='qBWXY'></tfoot>

                          • <i id='qBWXY'><tr id='qBWXY'><dt id='qBWXY'><q id='qBWXY'><span id='qBWXY'><b id='qBWXY'><form id='qBWXY'><ins id='qBWXY'></ins><ul id='qBWXY'></ul><sub id='qBWXY'></sub></form><legend id='qBWXY'></legend><bdo id='qBWXY'><pre id='qBWXY'><center id='qBWXY'></center></pre></bdo></b><th id='qBWXY'></th></span></q></dt></tr></i><div id='qBWXY'><tfoot id='qBWXY'></tfoot><dl id='qBWXY'><fieldset id='qBWXY'></fieldset></dl></div>

                            <small id='qBWXY'></small><noframes id='qBWXY'>

                            <legend id='qBWXY'><style id='qBWXY'><dir id='qBWXY'><q id='qBWXY'></q></dir></style></legend>
                              <tbody id='qBWXY'></tbody>