久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

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

    1. 隱藏“顯示:無"時如何渲染傳單地圖父母

      How to render leaflet map when in hidden quot;display: none;quot; parent(隱藏“顯示:無時如何渲染傳單地圖父母)
      <i id='EDPrI'><tr id='EDPrI'><dt id='EDPrI'><q id='EDPrI'><span id='EDPrI'><b id='EDPrI'><form id='EDPrI'><ins id='EDPrI'></ins><ul id='EDPrI'></ul><sub id='EDPrI'></sub></form><legend id='EDPrI'></legend><bdo id='EDPrI'><pre id='EDPrI'><center id='EDPrI'></center></pre></bdo></b><th id='EDPrI'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='EDPrI'><tfoot id='EDPrI'></tfoot><dl id='EDPrI'><fieldset id='EDPrI'></fieldset></dl></div>

        <tfoot id='EDPrI'></tfoot>

          1. <legend id='EDPrI'><style id='EDPrI'><dir id='EDPrI'><q id='EDPrI'></q></dir></style></legend>

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

            • <bdo id='EDPrI'></bdo><ul id='EDPrI'></ul>
                <tbody id='EDPrI'></tbody>
                本文介紹了隱藏“顯示:無"時如何渲染傳單地圖父母的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                在我的頁面上顯示傳單地圖時,我遇到了奇怪的行為.通常地圖會按預期渲染并且運行良好.但是,我只想在我在 javascript 中檢測到的表單中出現錯誤時才顯示地圖.因此,如果我將父 <div id="map"> 設置為 display: none; 并稍后根據需要顯示,則不會加載圖塊(或僅部分加載并且不繼續)并且地圖奇怪地錯位"(不是在 js 中定義的居中).

                I am experiencing strange behaviour when displaying leaflet map on my page. Normally the map is rendered as expected and works well. However I want to display the map only when an error occurs in forms which I detect in javascript. So if I set the parent <div id="map"> to display: none; and show it later as needed, the tiles are not loaded (or only partially load and do not continue) and the map is strangely "dislocated" (not centred as defined in js).

                我的想法是,也許瀏覽器沒有呈現 display: none; 父級中的元素?

                My thought is that maybe the browser does not render the elements inside a display: none; parent?

                我嘗試使用 $(document).ready(...) 函數隱藏地圖,但沒有任何區別.一旦我隱藏并顯示地圖,同樣的行為就會重復.我在 Firefox 44.0 和 Chromium 48.0 上對此進行了測試,行為是一致的.

                I tried hiding the map with the $(document).ready(...) function but it made no difference. The same behaviour repeats as soon as I hide and show the map. I tested this on Firefox 44.0 and Chromium 48.0 and the behaviour is consistent.

                任何提示都會有所幫助.這是遠程加載元素 (ajax) 的一般行為嗎?

                Any tip would be helpful. Is this general behaviour for remotely loaded elements (ajax)?

                現在我知道了解決方案和解決方法(請參閱下面的答案),但我仍然不確定這是否是遠程加載元素的全局行為?感謝您的任何解釋.

                Now I know the solution and a workaround (see the answers bellow), but I am still unsure if this is a global behaviour for remotely loaded elements? Thanks for any explanation.

                請參閱接受的答案以獲得解釋.

                See the accepted answer for explanation.

                推薦答案

                您的 L.Map 實例由于 display:none CSS 規則.如果它沒有得到正確的尺寸,它不知道要加載多少瓷磚以及如何布置它們,它只會不加載.XHR 與它無關.地圖不知道 XHR 是什么,這就是問題所在.

                What's happening is that your L.Map instance can not correctly calculate it's dimensions because of the display:none CSS rule. If it doesn't get the proper dimensions it doesn't know how many tiles to load and how to lay them out, it just loads none. XHR has nothing to do with it. The map doesn't know what to XHR, that's the problem.

                display:none 切換到 display:block 后,在 L.Map<上調用 invalidateSize 方法/代碼>實例.它將強制地圖(重新)渲染:

                After you've switched from display:none to display:block call the invalidateSize method on your L.Map instance. It will force the map to (re)render:

                檢查地圖容器大小是否發生變化,如果發生變化,則更新地圖 - 在您動態更改地圖大小后調用它,默認情況下也會為平移設置動畫.如果 options.pan 為 false,則不會發生平移.如果 options.debounceMoveend 為 true,它會延遲 moveend 事件,這樣即使連續多次調用該方法也不會經常發生.

                Checks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically, also animating pan by default. If options.pan is false, panning will not occur. If options.debounceMoveend is true, it will delay moveend event so that it doesn't happen often even if the method is called many times in a row.

                http://leafletjs.com/reference.html#map-invalidatesize

                這篇關于隱藏“顯示:無"時如何渲染傳單地圖父母的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                Trigger click on leaflet marker(觸發點擊傳單標記)
                Add external geojson to leaflet layer(將外部geojson添加到傳單層)
                How do I show a label beyond a certain zoom level in Leaflet?(如何在 Leaflet 中顯示超出特定縮放級別的標簽?)
                Making polyline snap to roads in leaflet(使折線捕捉到傳單中的道路)
                leafletjs - marker.bindPopup - keep all popups open(Leafletjs - marker.bindPopup - 保持所有彈出窗口打開)
                How to identify Leaflet#39;s Marker during a `popupopen` event?(如何在“popupopen事件期間識別 Leaflet 的標記?)
              1. <i id='ckzTF'><tr id='ckzTF'><dt id='ckzTF'><q id='ckzTF'><span id='ckzTF'><b id='ckzTF'><form id='ckzTF'><ins id='ckzTF'></ins><ul id='ckzTF'></ul><sub id='ckzTF'></sub></form><legend id='ckzTF'></legend><bdo id='ckzTF'><pre id='ckzTF'><center id='ckzTF'></center></pre></bdo></b><th id='ckzTF'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ckzTF'><tfoot id='ckzTF'></tfoot><dl id='ckzTF'><fieldset id='ckzTF'></fieldset></dl></div>

                      <legend id='ckzTF'><style id='ckzTF'><dir id='ckzTF'><q id='ckzTF'></q></dir></style></legend>
                    1. <tfoot id='ckzTF'></tfoot>
                      • <small id='ckzTF'></small><noframes id='ckzTF'>

                          <bdo id='ckzTF'></bdo><ul id='ckzTF'></ul>
                            <tbody id='ckzTF'></tbody>

                          主站蜘蛛池模板: www日本高清视频 | 欧美三级视频在线观看 | 麻豆久久久久久 | 最新日韩在线视频 | 中文字幕免费视频 | 欧美日韩亚洲视频 | 尤物在线精品视频 | 欧美色图另类 | 国产成人精品在线 | 狠狠干网| 日韩欧美不卡 | 久久久一区二区三区 | 精品视频www | 国产精品视频网 | 国产欧美精品在线观看 | 中文字幕在线一区 | 亚洲va欧美va天堂v国产综合 | 美女视频.| 国产精品一区免费 | 精品三区| 欧美jizzhd精品欧美巨大免费 | 日韩最新网址 | 精品日韩一区二区 | 国产美女一区 | 搞av.com | 综合久久一区 | 天天人人精品 | 久久男人 | 欧美成人一区二区三区 | 国产在线视频一区 | 国产精品毛片无码 | 一级黄色片日本 | 亚洲国产成人av | 欧美一区二区大片 | 一区二区三区精品视频 | 日日日操 | 午夜一区| 成人免费视频网站在线看 | 一区二区三区观看视频 | 亚洲欧美日韩一区二区 | 夜夜爽99久久国产综合精品女不卡 |