pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

  • <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="i38p3bp" 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="zobuz72" 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="4hoc8lz" id='b9sbO'><tfoot id='b9sbO'></tfoot><dl id='b9sbO'><fieldset id='b9sbO'></fieldset></dl></div>

                          1. 主站蜘蛛池模板: 河南砖机首页-全自动液压免烧砖机,小型砌块水泥砖机厂家[十年老厂] | 软装设计-提供软装装饰和软装配饰及软装陈设的软装设计公司 | 山东彩钢板房,山东彩钢活动房,临沂彩钢房-临沂市贵通钢结构工程有限公司 | 合肥风管加工厂-安徽螺旋/不锈钢风管-通风管道加工厂家-安徽风之范 | 定坤静电科技静电消除器厂家-除静电设备| 商标转让-购买商标专业|放心的商标交易网-蜀易标商标网 | 蜘蛛车-高空作业平台-升降机-高空作业车租赁-臂式伸缩臂叉装车-登高车出租厂家 - 普雷斯特机械设备(北京)有限公司 | 泰来华顿液氮罐,美国MVE液氮罐,自增压液氮罐,定制液氮生物容器,进口杜瓦瓶-上海京灿精密机械有限公司 | 口信网(kousing.com) - 行业资讯_行业展会_行业培训_行业资料 | 购买舔盐、舔砖、矿物质盐压块机,鱼饵、鱼饲料压块机--请到杜甫机械 | 浙江清风侠环保设备有限公司| NMRV减速机|铝合金减速机|蜗轮蜗杆减速机|NMRV减速机厂家-东莞市台机减速机有限公司 | 郑州宣传片拍摄-TVC广告片拍摄-微电影短视频制作-河南优柿文化传媒有限公司 | 儋州在线-儋州招聘找工作、找房子、找对象,儋州综合生活信息门户! | 缠膜机|缠绕包装机|无纺布包装机-济南达伦特机械设备有限公司 | 苹果售后维修点查询,苹果iPhone授权售后维修服务中心 – 修果网 拼装地板,悬浮地板厂家,悬浮式拼装运动地板-石家庄博超地板科技有限公司 | 房车价格_依维柯/大通/东风御风/福特全顺/江铃图片_云梯搬家车厂家-程力专用汽车股份有限公司 | 自动气象站_农业气象站_超声波气象站_防爆气象站-山东万象环境科技有限公司 | 多功能真空滤油机_润滑油全自动滤油机_高效真空滤油机价格-重庆润华通驰 | 对辊式破碎机-对辊制砂机-双辊-双齿辊破碎机-巩义市裕顺机械制造有限公司 | 合肥钣金加工-安徽激光切割加工-机箱机柜加工厂家-合肥通快 | CPSE安博会| 哈希PC1R1A,哈希CA9300,哈希SC4500-上海鑫嵩实业有限公司 | 包塑丝_高铁绑丝_地暖绑丝_涂塑丝_塑料皮铁丝_河北创筹金属丝网制品有限公司 | 筛分机|振动筛分机|气流筛分机|筛分机厂家-新乡市大汉振动机械有限公司 | 电机铸铝配件_汽车压铸铝合金件_发动机压铸件_青岛颖圣赫机械有限公司 | 绿叶|绿叶投资|健康产业_绿叶投资集团有限公司 | 智能案卷柜_卷宗柜_钥匙柜_文件流转柜_装备柜_浙江福源智能科技有限公司 | 橡胶膜片,夹布膜片,橡胶隔膜密封,泵阀设备密封膜片-衡水汉丰橡塑科技公司网站 | 中式装修设计_全屋定制家具_实木仿古门窗花格厂家-喜迎门 | 杭州翻译公司_驾照翻译_专业人工翻译-杭州以琳翻译有限公司官网 组织研磨机-高通量组织研磨仪-实验室多样品组织研磨机-东方天净 | 捷码低代码平台 - 3D数字孪生_大数据可视化开发平台「免费体验」 | 清管器,管道清管器,聚氨酯发泡球,清管球 - 承德嘉拓设备 | 北京西风东韵品牌与包装设计公司,创造视觉销售力! | FAG轴承,苏州FAG轴承,德国FAG轴承-恩梯必传动设备(苏州)有限公司 | 废水处理-废气处理-工业废水处理-工业废气处理工程-深圳丰绿环保废气处理公司 | 无负压供水设备,消防稳压供水设备-淄博创辉供水设备有限公司 | 招商帮-一站式网络营销服务|互联网整合营销|网络推广代运营|信息流推广|招商帮企业招商好帮手|搜索营销推广|短视视频营销推广 | 复盛空压机配件-空气压缩机-复盛空压机(华北)总代理 | 全自动包装秤_全自动上袋机_全自动套袋机_高位码垛机_全自动包装码垛系统生产线-三维汉界机器(山东)股份有限公司 | 全自动端子机|刺破式端子压接机|全自动双头沾锡机|全自动插胶壳端子机-东莞市傅氏兄弟机械设备有限公司 |