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

    <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="nd1djrf" 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="xddlzt1" 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="zf1jvhh" 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>

                          主站蜘蛛池模板: 上海璟文空运首页_一级航空货运代理公司_机场快递当日达 | 粉丝机械,粉丝烘干机,粉丝生产线-招远市远东粉丝机械有限公司 | 耐高温硅酸铝板-硅酸铝棉保温施工|亿欧建设工程 | 挤塑板-XPS挤塑板-挤塑板设备厂家[襄阳欧格] | 珠海白蚁防治_珠海灭鼠_珠海杀虫灭鼠_珠海灭蟑螂_珠海酒店消杀_珠海工厂杀虫灭鼠_立净虫控防治服务有限公司 | 石家庄律师_石家庄刑事辩护律师_石家庄取保候审-河北万垚律师事务所 | 礼堂椅厂家|佛山市艺典家具有限公司 | 鹤壁创新仪器公司-全自动量热仪,定硫仪,煤炭测硫仪,灰熔点测定仪,快速自动测氢仪,工业分析仪,煤质化验仪器 | 交变/复合盐雾试验箱-高低温冲击试验箱_安奈设备产品供应杭州/江苏南京/安徽马鞍山合肥等全国各地 | 合肥白癜风医院_合肥治疗白癜风医院_合肥看白癜风医院哪家好_合肥华研白癜风医院 | 天津热油泵_管道泵_天津高温热油泵-天津市金丰泰机械泵业有限公司【官方网站】 | 防水套管厂家_刚性防水套管_柔性防水套管_不锈钢防水套管-郑州中泰管道 | 大型工业风扇_工业大风扇_大吊扇_厂房车间降温-合昌大风扇 | 万师讲师网-优质讲师培训师供应商,讲师认证,找讲师来万师 | 高柔性拖链电缆_卷筒电缆_耐磨耐折聚氨酯电缆-玖泰特种电缆 | 高低温老化试验机-步入式/低温恒温恒湿试验机-百科 | 澳门精准正版免费大全,2025新澳门全年免费,新澳天天开奖免费资料大全最新,新澳2025今晚开奖资料,新澳马今天最快最新图库-首页-东莞市傲马网络科技有限公司 | 全自动包装机_灌装机生产厂家-迈驰包装设备有限公司 | 北京网站建设-企业网站建设-建站公司-做网站-北京良言多米网络公司 | 祝融环境-地源热泵多恒系统高新技术企业,舒适生活环境缔造者! | 杭州标识标牌|文化墙|展厅|导视|户内外广告|发光字|灯箱|铭阳制作公司 - 杭州标识标牌|文化墙|展厅|导视|户内外广告|发光字|灯箱|铭阳制作公司 | 刮板输送机,粉尘加湿搅拌机,螺旋输送机,布袋除尘器 | 异噻唑啉酮-均三嗪-三丹油-1227-中北杀菌剂厂家 | 上海噪音治理公司-专业隔音降噪公司-中广通环保 | POM塑料_PBT材料「进口」聚甲醛POM杜邦原料、加纤PBT塑料报价格找利隆塑料 | 安徽集装箱厂-合肥国彩钢结构板房工程有限公司 | TPE_TPE热塑性弹性体_TPE原料价格_TPE材料厂家-惠州市中塑王塑胶制品公司- 中塑王塑胶制品有限公司 | 永嘉县奥阳陶瓷阀门有限公司 | 广州各区危化证办理_危险化学品经营许可证代办 | 贵州水玻璃_-贵阳花溪闽兴水玻璃厂| 游戏版号转让_游戏资质出售_游戏公司转让-【八九买卖网】 | 猪I型/II型胶原-五克隆合剂-细胞冻存培养基-北京博蕾德科技发展有限公司 | 专业生物有机肥造粒机,粉状有机肥生产线,槽式翻堆机厂家-郑州华之强重工科技有限公司 | 工业风机_环保空调_冷风机_工厂车间厂房通风降温设备旺成服务平台 | 钢托盘,铁托盘,钢制托盘,镀锌托盘,饲料托盘,钢托盘制造商-南京飞天金属13260753852 | 次氯酸钠厂家,涉水级次氯酸钠,三氯化铁生产厂家-淄博吉灿化工 | 北京三友信电子科技有限公司-ETC高速自动栏杆机|ETC机柜|激光车辆轮廓测量仪|嵌入式车道控制器 | 浙江红酒库-冰雕库-气调库-茶叶库安装-医药疫苗冷库-食品物流恒温恒湿车间-杭州领顺实业有限公司 | 膜结构车棚|上海膜结构车棚|上海车棚厂家|上海膜结构公司 | 实战IT培训机构_IT培训班选大学生IT技术培训中心_中公优就业 | 智慧消防-消防物联网系统云平台|