久久久久久久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>

                          主站蜘蛛池模板: 久久久妇女国产精品影视 | 久久久久久久一区二区三区 | 国产精品久久久久久久久大全 | 日韩在线视频一区二区三区 | 欧洲一区二区三区 | 成人av一区二区在线观看 | 少妇特黄a一区二区三区88av | 日本精品一区二区三区在线观看视频 | 91精品国产91久久综合桃花 | 中文字幕在线三区 | 丁香综合 | 国产在线1区 | 日韩高清国产一区在线 | 伊人免费在线观看 | 国产一二三视频在线观看 | 在线免费观看毛片 | 人人艹人人爽 | 黄色大片观看 | 亚洲h色| www.国产一区 | 中文字幕在线观看视频网站 | 狠狠躁夜夜躁人人爽天天高潮 | 国产区在线看 | 在线视频一区二区三区 | 国产精品国产精品国产专区不卡 | 日本人做爰大片免费观看一老师 | 欧美二区在线 | 精品欧美一区二区精品久久 | 久久91| www.午夜| 国产一区久久 | 在线免费看黄 | 久久久久久久国产精品影院 | 免费一区二区三区 | 国产美女在线观看 | 久久久久免费 | 欧美电影在线 | 国产精品久久久久久吹潮 | 久久草在线视频 | 成人久久18免费网站图片 | 国产91丝袜在线熟 |