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

  • <tfoot id='DaxER'></tfoot>
  • <legend id='DaxER'><style id='DaxER'><dir id='DaxER'><q id='DaxER'></q></dir></style></legend>

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

          <bdo id='DaxER'></bdo><ul id='DaxER'></ul>
        <i id='DaxER'><tr id='DaxER'><dt id='DaxER'><q id='DaxER'><span id='DaxER'><b id='DaxER'><form id='DaxER'><ins id='DaxER'></ins><ul id='DaxER'></ul><sub id='DaxER'></sub></form><legend id='DaxER'></legend><bdo id='DaxER'><pre id='DaxER'><center id='DaxER'></center></pre></bdo></b><th id='DaxER'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='DaxER'><tfoot id='DaxER'></tfoot><dl id='DaxER'><fieldset id='DaxER'></fieldset></dl></div>
      1. 在容器調(diào)整大小時調(diào)整傳單地圖的大小

        Resizing a leaflet map on container resize(在容器調(diào)整大小時調(diào)整傳單地圖的大小)
      2. <tfoot id='GDMGj'></tfoot>
          • <small id='GDMGj'></small><noframes id='GDMGj'>

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

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

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

                • 本文介紹了在容器調(diào)整大小時調(diào)整傳單地圖的大小的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我有一個包含傳單地圖的 <div>.在某些事件中,<div> 的高度將會改變.我想讓地圖調(diào)整到其周圍 <div> 的新尺寸,以便舊中心在調(diào)整后的更小或更大的地圖中居中.我嘗試使用 invalidateSize() 函數(shù),但它似乎根本不起作用.在 map-container-resize 事件之后如何調(diào)整地圖大小和居中?

                  I have a <div> containing a leaflet map. Upon certain events the height of the <div> will be altered. I'd like for the map to resize to the new dimensions of its surrounding <div> so that the old center is centered in the resized smaller or larger map. I tried using the invalidateSize() function, but it doesn't seem to work at all. How can I resize and center the map after that map-container-resize event?

                  $mapContainer.on('map-container-resize', function () {
                     map.invalidateSize(); // doesn't seem to do anything
                  });
                  

                  編輯以提供更多上下文:

                  地圖容器最初的樣式為

                  #map-container {
                      width: 100%;
                      height: 100%;
                      position: absolute;
                      top: 0;
                      left: 0;
                  
                      transition: height 0.5s ease-in-out;
                  }
                  

                  用戶單擊某個按鈕后,頁面底部會顯示另一個面板,并且地圖容器的高度將降低到小于 100%(例如 80%).

                  After a user clicks a certain button, another panel shows at the bottom of the page and the map-container's height will be reduced to something less than 100% (say 80%).

                  單擊此按鈕后,將觸發(fā) map-container-resize 事件,以便我可以使地圖調(diào)整大小并以舊的(即在調(diào)整大小之前)中心為中心.然后,地圖本身也應(yīng)調(diào)整為其初始高度的 80%.

                  Upon click on this button, the map-container-resize event is triggered so that I can make the map resize and center on its old (i.e. before the resizing happened) center. The map itself should then also be resized to 80% of its initial height.

                  invalidateSize 的 APi 文檔似乎是我想要的:

                  The APi doc for invalidateSize seemed to be what I wanted:

                  "檢查地圖容器大小是否改變,如果改變則更新地圖[...]"

                  "Checks if the map container size changed and updates the map if so [...]"

                  但是看看調(diào)用 invalidateSize 前后 getSize 函數(shù)的輸出,沒有什么不同,地圖保持原來的大小.

                  But having a look with the output of the getSize function before and after the call to invalidateSize, nothing is different, the map remains at its old size.

                  推薦答案

                  問題是 #map-container div 的大小調(diào)整是通過 css 轉(zhuǎn)換完成的.轉(zhuǎn)換尚未開始,更不用說結(jié)束了,此時調(diào)用了 invalidateSize,因此傳單地圖無法識別其周圍 div 的任何尺寸變化.

                  The problem is that the resizing of the #map-container div is done via a css transition. The transition hasn't started yet, let alone ended, when the call to invalidateSize happens so the leaflet map cannot recognize any change of dimensions of its surrounding div.

                  延遲觸發(fā) map-container-resize 事件解決了這個問題.這樣:

                  Triggering the map-container-resize event with a delay solved the problem. This way :

                  setTimeout(function(){ map.invalidateSize()}, 400);
                  

                  這篇關(guān)于在容器調(diào)整大小時調(diào)整傳單地圖的大小的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  Browserify, Babel 6, Gulp - Unexpected token on spread operator(Browserify,Babel 6,Gulp - 傳播運算符上的意外令牌)
                  Is it possible to pass a flag to Gulp to have it run tasks in different ways?(是否可以將標(biāo)志傳遞給 Gulp 以使其以不同的方式運行任務(wù)?)
                  Why do we need to install gulp globally and locally?(為什么我們需要在全局和本地安裝 gulp?)
                  How to run Gulp tasks sequentially one after the other(如何一個接一個地依次運行 Gulp 任務(wù))
                  Visual Studio 2015 crashes when opening Javascript files(打開 Javascript 文件時 Visual Studio 2015 崩潰)
                  Detect FLASH plugin crashes(檢測 FLASH 插件崩潰)
                  • <bdo id='b9sbO'></bdo><ul id='b9sbO'></ul>
                    <tfoot id='b9sbO'></tfoot>

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

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

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

                          1. 主站蜘蛛池模板: 日韩精品一区二区三区免费观看 | h片在线看 | 成人av观看 | 一级a爱片性色毛片免费 | 精品国产一区二区三区久久久久久 | 视频一区二区在线观看 | 欧洲视频一区二区 | 一级毛片在线播放 | www.久久艹 | 免费日韩av网站 | 日韩精品一区二区三区视频播放 | 青青草社区| 精品真实国产乱文在线 | 国产欧美日韩精品在线观看 | 欧美国产一区二区 | 国产一级一片免费播放 | 国产专区在线 | 国家aaa的一级看片 h片在线看 | 国产精品一区二区av | 久久久久国产精品 | 亚洲 欧美 综合 | 日韩在线h | 国产乱码精品一区二区三区av | 日韩一区二区三区精品 | 国产精品久久久久久久久久免费看 | 一区二区三区高清 | 国产日韩久久 | 99久久久久| 久久久久国色av免费观看性色 | 看片地址| 欧美成人一区二区 | av男人的天堂av | 91伊人网 | 福利片一区二区 | 久久久久久久久久久成人 | 九一在线观看 | 国内毛片毛片毛片毛片 | 欧美乱码精品一区二区三区 | 男女爱爱福利视频 | 国产激情一区二区三区 | 一级黄色裸片 |