久久久久久久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. 在容器調整大小時調整傳單地圖的大小

        Resizing a leaflet map on container resize(在容器調整大小時調整傳單地圖的大小)
      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>

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

                  問題描述

                  限時送ChatGPT賬號..

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

                  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%).

                  單擊此按鈕后,將觸發 map-container-resize 事件,以便我可以使地圖調整大小并以舊的(即在調整大小之前)中心為中心.然后,地圖本身也應調整為其初始高度的 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 [...]"

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

                  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 的大小調整是通過 css 轉換完成的.轉換尚未開始,更不用說結束了,此時調用了 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.

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

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

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

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

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

                  相關文檔推薦

                  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?(是否可以將標志傳遞給 Gulp 以使其以不同的方式運行任務?)
                  Why do we need to install gulp globally and locally?(為什么我們需要在全局和本地安裝 gulp?)
                  How to run Gulp tasks sequentially one after the other(如何一個接一個地依次運行 Gulp 任務)
                  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. 主站蜘蛛池模板: 国产综合在线视频 | 视频一区二区在线观看 | 国产精品成人一区二区 | 国产精品99久久免费观看 | 亚洲国产一区二区三区, | 色综合久 | 国产精品一级 | 九九热re | 中文字幕国产 | 亚洲综合色视频在线观看 | 欧美日韩视频在线第一区 | 日本涩涩网 | 欧美三级在线 | 久久精品中文字幕 | 黑人中文字幕一区二区三区 | www久久国产| 日韩在线视频免费观看 | 中文一区二区 | 婷婷丁香在线视频 | 4h影视| 亚洲精品久久久 | 久久综合久久综合久久 | 蜜桃在线视频 | 日日干干| 日韩精品999 | 国产成人一区二区三区电影 | 欧美精品一区三区 | 日本一区二区三区在线观看 | 欧美日韩一区二区三区四区 | 久久久久久久亚洲精品 | 欧美精品一区在线发布 | 日韩欧美国产一区二区 | 国产精品伦一区二区三级视频 | 日韩美女在线看免费观看 | 欧美日韩一二三区 | 天天影视亚洲综合网 | 在线一区| 中国一级特黄真人毛片 | 日韩精品 电影一区 亚洲 | 国产成人精品一区二区三区网站观看 | 性色的免费视频 |